Exemple #1
0
        public static void SS_CreateFloor(GameObject theParent)
        {
            bool         isValid = false;
            SS_LevelArea theRect = (theParent).GetComponent <SS_LevelArea>();

            if (theRect != null)
            {
                isValid = true;
            }

            if (isValid)
            {
                GameObject newGO   = new GameObject("SS_Floor");
                SS_Floor   SSFloor = newGO.AddComponent <SS_Floor>();


                SSFloor.thePrefabs = new SS_FloorInstanceObject[1];

                SSFloor.thePrefabs[0]           = new SS_FloorInstanceObject();
                SSFloor.thePrefabs[0].thePrefab = SS_DefaultFloorPrefab();

                //SSFloor.moduleSize = new Vector3(3, 0.25f, 3);

                SSFloor.moduleSize = GetPrefabSize(SSFloor.thePrefabs[0].thePrefab.name, '_');

                newGO.transform.position = theRect.transform.position;
                newGO.transform.rotation = theRect.transform.rotation;
                newGO.transform.SetParent(theRect.transform);

                theRect.UpdateLevelCanvas();
            }
        }
Exemple #2
0
        public static void SS_CreateGridScatters(GameObject theParent)
        {
            bool         isValid = false;
            SS_LevelArea theRect = (Selection.activeGameObject).GetComponent <SS_LevelArea>();

            if (theRect != null)
            {
                isValid = true;
            }

            if (isValid)
            {
                GameObject     newGO  = new GameObject("SS_Scatter");
                SS_GridScatter SSGrid = newGO.AddComponent <SS_GridScatter>();

                SSGrid.thePrefabs = new SS_GridObjects[1];

                SSGrid.thePrefabs[0]           = new SS_GridObjects();
                SSGrid.thePrefabs[0].thePrefab = SS_DefaultScatterPrefab();

                newGO.transform.position = theRect.transform.position;
                newGO.transform.rotation = theRect.transform.rotation;
                newGO.transform.SetParent(theRect.transform);

                theRect.UpdateLevelCanvas();
            }
        }
Exemple #3
0
        public static void SS_CreateWall(GameObject theParent)
        {
            bool         isValid = false;
            SS_LevelArea theRect = (theParent).GetComponent <SS_LevelArea>();

            if (theRect != null)
            {
                isValid = true;
            }

            if (isValid)
            {
                GameObject newGO  = new GameObject("SS_Wall");
                SS_Wall    SSWall = newGO.AddComponent <SS_Wall>();


                //Setup Placeholder Wall Prefab
                SSWall.theWallPrefabs              = new SS_WallObjects[1];
                SSWall.theWallPrefabs[0]           = new SS_WallObjects();
                SSWall.theWallPrefabs[0].thePrefab = SS_DefaultWallPrefab();

                // SSWall.moduleSize = new Vector3(3, 0.4f, 3);
                SSWall.moduleSize = GetPrefabSize(SSWall.theWallPrefabs[0].thePrefab.name, '_');


                //Setup Placeholder Corner Prefab

                SSWall.theCornerPrefabs = new SS_CornerObjects[1];

                SSWall.theCornerPrefabs[0] = new SS_CornerObjects();

                SSWall.theCornerPrefabs[0].thePrefab = SS_DefaultCornerPrefab();



                newGO.transform.position = theRect.transform.position;
                newGO.transform.rotation = theRect.transform.rotation;
                newGO.transform.SetParent(theRect.transform);

                theRect.UpdateLevelCanvas();
            }
        }