Пример #1
0
    internal void SetSlime(Slime slime, TileState newState = TileState.EMPTY)
    {
        Slime = slime;

        DamageText.enabled = true;

        Slime.AddTile(this);

        if (newState != TileState.EMPTY)
        {
            CurrentState = newState;
        }

        if (CurrentState == TileState.OCCUPIED)
        {
            GameTile opposite_tile = GetOppositeTile();
            opposite_tile.SetMenaceState(Slime.Type);
        }

        if (newState != TileState.EMPTY)
        {
            SetState(CurrentState);
        }
    }