Example #1
0
        internal Sector(CaveMeshes caveMeshes, int x, int y)
        {
            string index = string.Format("{0},{1}", x, y);

            GameObject = new GameObject(AppendIndex(SECTOR_NAME, index));

            if (caveMeshes.HasCeilingMesh)
            {
                Ceiling = new CaveComponent(caveMeshes.ExtractCeilingMesh(), AppendIndex(CEILING_NAME, index), addCollider: false);
                SetChild(Ceiling);
            }
            if (caveMeshes.HasFloorMesh)
            {
                Floor = new CaveComponent(caveMeshes.ExtractFloorMesh(), AppendIndex(FLOOR_NAME, index), true);
                SetChild(Floor);
            }
            if (caveMeshes.HasWallMesh)
            {
                Walls = new CaveComponent(caveMeshes.ExtractWallMesh(), AppendIndex(WALL_NAME, index), true);
                SetChild(Walls);
            }
        }
Example #2
0
 void SetChild(CaveComponent component)
 {
     component.GameObject.transform.parent = GameObject.transform;
 }