Example #1
0
 Arena.CellType[,] GetLevelCellTypes(string[] levelMap)
 {
     Arena.CellType[,] cellTypes = new Arena.CellType[levelMap.Length, levelMap.Length];
     for (var row = 0; row < levelMap.Length; row++)
     {
         for (var col = 0; col < levelMap.Length; col++)
         {
             cellTypes[row, col] = GetCellType(levelMap[row][col]);
         }
     }
     return(cellTypes);
 }
Example #2
0
    public void Init(Main main, Arena.CellType cellType)
    {
        this.main     = main;
        this.cellType = cellType;

        var activatableMaterial = Resources.Load <Material>("Material/Cell_Activatable_Material");
        var basicMaterial       = Resources.Load <Material>("Material/Cell_Basic_Material");
        var touchMaterial       = Resources.Load <Material>("Material/Cell_Touch_Material");
        var wallMaterial        = Resources.Load <Material>("Material/Cell_Wall_Material");

        cellMaterials = new Dictionary <Arena.CellType, Material>
        {
            { Arena.CellType.ACTIVATABLE, activatableMaterial },
            { Arena.CellType.BASIC, basicMaterial },
            { Arena.CellType.TOUCH, touchMaterial },
            { Arena.CellType.WALL, wallMaterial },
        };
    }
Example #3
0
        /// <summary>
        /// Returns color based of the cell based on its type.
        /// </summary>
        static Vector3 GetCellColor(Arena.CellType type)
        {
            switch (type)
            {
            case Arena.CellType.empty:
                return(new Vector3(1.0f, 1.0f, 1.0f));

            case Arena.CellType.wall:
                return(new Vector3(0.4f, 0.4f, 0.4f));

            case Arena.CellType.spawn:
                return(new Vector3(0.8f, 0.8f, 0.8f));

            case Arena.CellType.shield:
                return(new Vector3(0.4f, 0.8f, 0.4f));

            default:
                throw new NotImplementedException("Someone forgot to add case for this CellType");
            }
        }