|
In my game, I have a "Peace Mode" and a "Combat Mode." While in Peace mode, I want to have the combat textures disabled and greyed out. Do I need to make separate "greyed-out" versions? While I have the textures showing on and off when clicked, I can't quite get it working right.
void OnMouseDown()
{
if(PeaceButton)
Mode ();
if(AttackHackButton)
HackAttack();
...etc
}
void Mode()
{
if(!CombatMode) //bool
{
guiTexture.texture=CombatButton;
CombatMode=true;
//AttackHackButton=enabled; (Should this be a bool?)
Debug.Log("Combat Mode" +CombatMode);
}
else
{
guiTexture.texture=PeaceButton;
CombatMode=false;
Debug.Log("Peace Mode" +CombatMode);
}
}
What am I missing?
Thanks!
(comments are locked)
|
|
best way at least in performance reason is to have two sets of textures. on draw controls, just check the Combatode and use texture that shows the activity I can't quite get it working right. what exactly working wrong? I wasn't quite able to wrap my brain around what needed to happen. I've since worked out one thing, but the rest is still elusive. I added this to onMouseDown: if (CombatMode=true) { if(RangedButton) RangedAttackMode(); if(AttackHackButton) HackAttack(); if(AttackSlashButton) SlashAttack(); if(AttackThrustButton) ThrustAttack(); if(AttackUppercutButton) UppercutAttack(); } But if I try more than one texture in the Mode function(which switches between peace and combat modes) it's blank. Need some way to differentiate the different pieces. Will draw controls work for this?
Aug 11 '12 at 08:14 PM
Gilead7
show sources of both textures declaration and implementation.
Aug 13 '12 at 09:51 PM
ScroodgeM
Finally got it working!
Aug 16 '12 at 08:34 PM
Gilead7
(comments are locked)
|
