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()); } } }
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; }