Пример #1
0
    void Update()
    {
        playerPosition = new Vector3(player.transform.position.x, player.transform.position.y, 0f);

        Vector3 temp = Map.PositionToCoord(transform.position);

        CurrentTileID.Set(Mathf.FloorToInt(temp.x), Mathf.FloorToInt(temp.y));

        // StartCoroutine(At


        if (CurrentTileID == player.GetCurrTileID() && !Battle)
        {
            gameObject.tag = "InBattle";
            JoinBattle();
            player.JoinBattle();
        }

        if (currentTurn < player.GetTurn() && !Battle)
        {
            if (!RunOnce)
            {
                CheckState();
                UpdateState();
            }

            Movement();
        }

        if (health <= 0 && !dead)
        {
            Die();
        }
    }