示例#1
0
 public void MovePlayerLeft()
 {
     playerDirection           = -1;
     this.transform.localScale = new Vector3(
         Mathf.Abs(this.transform.localScale.x) * playerDirection,
         this.transform.localScale.y,
         this.transform.localScale.z
         );
     if (gm.InBounds(monsterStats.GetXPosition() - 1, monsterStats.GetYPosition()) &&
         gm.GetArenaCellData()[monsterStats.GetYPosition(), monsterStats.GetXPosition() - 1] == 0)
     {
         if (!gm.GetEnemyMechanics().IsEnemyDefending())
         {
             this.walking   = true;
             this.attacking = false;
             anim.SetTrigger("Walk");
             LerpPlayerTo(monsterStats.GetXPosition() - 1, monsterStats.GetYPosition());
         }
     }
 }
示例#2
0
 private void LerpEnemyTo(int x, int y)
 {
     this.isEnemyLerping = true;
     gm.GetArenaCellData()[monsterStats.GetYPosition(), monsterStats.GetXPosition()] = 0;
     this.enemyNewPosition = gm.GetArenaCellsObjet()[y, x].transform.position;
     monsterStats.SetPosition(x, y);
     gm.GetArenaCellData()[y, x] = 3;
 }