//Weapon change event - called when player changes weapon public void WeaponChange(Component sender) { //Has player changed to this weapon? if (sender.GetInstanceID() == GetInstanceID()) { return; } //Has changed to other weapon. Hide this weapon StopAllCoroutines(); SpriteAnimator.StopSpriteAnimation(); //Deactivate equipped IsEquipped = false; SpriteAnimator.HideAllSprites(); }
//Handle patrol state public void Patrol() { AttackAnimator.HideAllSprites(); StartAnimator(PatrolAnimator); }
//Entered Attack State public void Attack() { PatrolAnimator.HideAllSprites(); StartAnimator(AttackAnimator); }