Пример #1
0
        public bool CheckRestrictions(BaseTile selectedTile, UnityObject _unityObject)
        {
            BaseTile tileType = selectedTile.GetComponentInChildren <BaseTile>();

            if (selectedTile.State != State.Unavailable && selectedTile.State != State.Off)
            {
                if (tileType is AsphaltTile)
                {
                    if (_unityObject.CanBePlacedOn().Contains(TileType.Asphalt))
                    {
                        return(true);
                    }
                }
                else if (tileType is GrassTile)
                {
                    if (_unityObject.CanBePlacedOn().Contains(TileType.Grass))
                    {
                        return(true);
                    }
                }
                else if (tileType is WaterTile)
                {
                    if (_unityObject.CanBePlacedOn().Contains(TileType.Water))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }