Ejemplo n.º 1
0
    public void endWork()
    {
        if (tile.type == WorldData.TILE_TYPE_FURNITURE || tile.type == WorldData.TILE_TYPE_WALL)
        {
            if (sprite.status == WorldData.TILE_STATUS_GROW)
            {
                sprite.status = WorldData.TILE_STATUS_READY;
            }
            return;
        }

        if (sprite.status == WorldData.TILE_STATUS_READY)
        {
            MonoBehaviour.Destroy(gameObject, 0.075f);
            World.tiles[key] = null;

            foreach (DataReward rew in tile.rewards)
            {
                for (int c = 0; c < rew.count; c++)
                {
                    GameObject reward = TerrainControler.createObject(x, y, "TileResource");
                    reward.GetComponent <Resource>().tileID = rew.id;
                }
            }
        }
    }
Ejemplo n.º 2
0
    public void create()
    {
        gameObject    = TerrainControler.createObject(x, y);
        sprite        = gameObject.GetComponent <WorldSprite>();
        sprite.tileID = tileID;

        //gameObject.transform.localScale = new Vector3(0.3f, 0.3f, 1f);
    }