Пример #1
0
    public void Move(Vector2Int Vector)
    {
        transform.position += new Vector3(Vector.x, Vector.y, 0f);
        GridElement.UpdateInGridManager();

        AudioManager.instance.PlaySound("Move");

        DestroyIndicators();

        if (Global.GridManager.ContainsElementWithTag(GridElement.GetPosition(), "Player"))
        {
            Global.GameManager.Player.Movement.LastCapturedEnemy = this;
            Global.GameManager.Player.Movement.OnCapture.Invoke();
            Global.GameManager.Player.GetComponent <Health>().Damage(1);
            Destroy(gameObject);
        }
    }