Пример #1
0
 private void ResetOccupantInfo()
 {
     _occupiedBy   = null;
     _isOccupied   = false;
     _occupantType = OccupyingType.Null;
     _blockAbove   = null;
 }
Пример #2
0
    private void SetOccupiedBy(GameObject occupant)
    {
        _occupiedBy = occupant;

        var blockOfOccupant = occupant.GetComponentInChildren <Block>();

        if (blockOfOccupant != null)
        {
            blockOfOccupant.SetBlockBeneath(this);
            _occupantType = OccupyingType.Block;
            _blockAbove   = blockOfOccupant;
        }
        else
        {
            _occupantType = GetOccupantType(occupant);
        }

        _isOccupied = true;
    }