public void Interact(bool aNewState) { if (myMovingBackAndForth != null) { myMovingBackAndForth.SetCanMove(!aNewState); } if (aNewState) { myPlayer.GetPlayerUI().ShowDialogue(myTextToSay); } }
private IEnumerator IE_Punch() { myIsPunching = true; myMovingBackAndForth.SetCanMove(false); myAnimator.SetTrigger("Attack"); float timeTaken = myPunchAnimation.length / 1.25f; yield return(new WaitForSeconds(timeTaken)); if (myPlayerTarget != null) { myPlayerTarget.Removelife(20); } yield return(new WaitForSeconds(myPunchAnimation.length - timeTaken)); myMovingBackAndForth.SetCanMove(true); myIsPunching = false; }
public void SetEnemyState(EnemyState aNewState) { myEnemyState = aNewState; if (aNewState == EnemyState.KNOCKED) { if (myEnemyHitBox != null) { myEnemyHitBox.StopAttack(); } } else { myMovingBackAndForth.SetCanMove(true); } }