コード例 #1
0
ファイル: Cell.cs プロジェクト: Jodacam/LevelEditorTFG
        internal void AddWall(SceneObjectContainer obj, Transform t, int wallIndex, bool instancing)
        {
            WallInfo preWall = walls[wallIndex];

            if (preWall.prefabObject != null)
            {
                GUIAuxiliar.Destroy(preWall.prefabObject);
            }
            WallInfo wall = new WallInfo(obj, t, preWall.position, instancing);

            walls[wallIndex] = wall;
        }
コード例 #2
0
ファイル: Cell.cs プロジェクト: Jodacam/LevelEditorTFG
        private void Remove(WallInfo wallInfo)
        {
            if (wallInfo.prefabObject != null)
            {
                GUIAuxiliar.Destroy(wallInfo.prefabObject);
            }

            var newWall = new WallInfo()
            {
                position = wallInfo.position
            };
        }
コード例 #3
0
ファイル: Cell.cs プロジェクト: Jodacam/LevelEditorTFG
        public Cell(Vector3 middlePoint, Vector2 Size)
        {
            position   = middlePoint;
            objectList = new List <ObjectInfo>();
            walls      = new WallInfo[4];
            for (int i = 0; i < walls.Length; i++)
            {
                walls[i] = new WallInfo()
                {
                    height = 0, transitable = true, prefabObject = null
                };
            }
            size = Size / 2;

            walls[1].position = position + new Vector3(size.x, 0, 0);
            walls[0].position = position + new Vector3(0, 0, size.y);
            walls[3].position = position + new Vector3(-size.x, 0, 0);
            walls[2].position = position + new Vector3(0, 0, -size.y);
        }
コード例 #4
0
ファイル: Cell.cs プロジェクト: Jodacam/LevelEditorTFG
        public void RemoveWall(int index)
        {
            WallInfo preWall = walls[index];

            Remove(preWall);
        }