Beispiel #1
0
    void Start()
    {
        gridWorld = GridWorld.getInstance();
        allCells  = gridWorld.ListAllCells();
        foreach (CellPosition cell in allCells)
        {
            PhysicalCell physicalCell = new PhysicalCell();
            physicalCell.position = gridWorld.GetRealPosition(cell);
            Instantiate(cellPrefab, physicalCell.position);

            /*
             * if (optionalPlayerEffect != null) {
             * GameObject playerEffect = Instantiate(optionalPlayerEffect, physicalCell.position);
             * physicalCell.playerEffect = playerEffect.GetComponentInChildren<ParticleSystem>();
             * physicalCell.playerEffect.Stop();
             * }
             *
             * if (optionalEnemyEffect != null) {
             * GameObject enemyEffect = Instantiate(optionalEnemyEffect, physicalCell.position);
             * physicalCell.enemyEffect = enemyEffect.GetComponentInChildren<ParticleSystem>();
             * physicalCell.enemyEffect.Stop();
             * }
             */

            foreach (DwellerInfo info in dwellerInfoSet)
            {
                physicalCell.data.Add(info.type, new PhysicalCell.TypeSpecificData());

                if (info.optionalEffect != null)
                {
                    GameObject effect = Instantiate(info.optionalEffect, physicalCell.position);
                    physicalCell.data[info.type].effect = effect.GetComponentInChildren <ParticleSystem>();
                    physicalCell.data[info.type].effect.Stop();
                }
            }

            physicalCells.Add(physicalCell);
        }
    }