示例#1
0
        private void Awake()
        {
            lastSoundTime = Time.time;
            _speaker      = GetComponent <Speaker>();

            ClickToMoveController ctmc = GetComponentInChildren <ClickToMoveController>();

            ctmc.OnNavigationFailed += NavigationFailedEvent;

            _tileLookup = floor.GetComponent <TileLookup>();
        }
示例#2
0
        public bool HandleReplaceTileCollision(TmxLayerTile tile, TileLookupEnum collisionTile, TileLookupEnum newTile)
        {
            if (tile.Gid != TileLookup.GetTileValue(collisionTile))
            {
                return(false);
            }

            //_detailLayer.RemoveTile(tile.X, tile.Y);
            tile.Gid = TileLookup.GetTileValue(newTile);

            _tiledMapRenderer.CollisionLayer.RemoveTile(tile.X, tile.Y);

            return(true);
        }
示例#3
0
    public RenderedTileInfo(TileData tileType, Vector3 location, float rotation, TileNode sourceNode, GameObject graphHolder)
    {
        this.tileType = tileType;
        placedTile    = Object.Instantiate(tileType.prefab, location, Quaternion.Euler(0, rotation, 0), graphHolder.transform);
        TileLookup curr = placedTile.AddComponent <TileLookup>();

        curr.AddRenderedTileInfo(this);
        this.location    = location;
        this.rotation    = rotation;
        this.sourceNode  = sourceNode;
        this.graphHolder = graphHolder;
        doors            = new bool[tileType.doorLocs.Length];
        currDoor         = sourceNode.seed % tileType.doorLocs.Length;
        connectedTiles   = new List <RenderedTileInfo>();
        CheckForDoors();
    }