예제 #1
0
 public void ResetTileHeightAndStates()
 {
     blockUnit.SyncTileStatesAndColors();
     levelUnit.SnapToFloorState();
     SetAlbedoColor(FloorTileStateColor);
     levelUnit.SetEmissiveColor(RiseTileColor);
 }
예제 #2
0
    public void ColorAction(int tileType)
    {
        List <GridTile> tiles = levelEditor.gridController.GetSelectedGridTiles();

        if (tiles.Count == 0)
        {
            return;
        }

        int   currentWaveIndex = PLESpawnManager.Instance.CurrentWaveIndex;
        Color newColor         = TileColors.GetColor(tileType);

        for (int i = 0; i < tiles.Count; i++)
        {
            GridTile     tile      = tiles[i];
            PLEBlockUnit blockUnit = tile.blockUnit;
            blockUnit.riseColor = newColor;
            blockUnit.SyncTileStatesAndColors();
        }
    }
예제 #3
0
    private void UpdateTiles(List <GridTile> tiles, LevelUnitStates state, bool wasToldToChangeColor)
    {
        if (tiles.Count == 0)
        {
            return;
        }

        SFXManager.Instance.Play(SFXType.UI_Click);
        int currentWaveIndex = PLESpawnManager.Instance.CurrentWaveIndex;

        for (int i = 0; i < tiles.Count; i++)
        {
            GridTile     tile      = tiles[i];
            PLEBlockUnit blockUnit = tile.blockUnit;
            LevelUnit    levelUnit = tile.levelUnit;
            if (!blockUnit.HasActiveSpawn)
            {
                List <LevelUnitStates> levelUnitStates = blockUnit.GetLevelStates();
                levelUnitStates[currentWaveIndex] = state;
                blockUnit.SyncTileStatesAndColors();
                levelUnit.TryTransitionToState(state, wasToldToChangeColor);
            }
        }
    }