コード例 #1
0
ファイル: CreateNewLevel.cs プロジェクト: Koesterc/PuzzleGem
        public static void AddTemplateLevel()
        {
            AddNewLevel();
            Object templateObject;                                            //Make an empty object to instantiate into so we can manipulate the empty objects name
            string clone = "(Clone)";                                         //String to replace

            Object[] template = Resources.LoadAll("Level Template");          //Load the clipboard
            for (int x = 0; x < template.Length; x++)                         //Loop through the clipboard
            {
                templateObject      = Instantiate(template[x]);               //Instantiate clipboard object
                templateObject.name = templateObject.name.Replace(clone, ""); //Replace (Clone) in the name with nothing
            }
            CreateNewLevel.SaveScene();
        }
コード例 #2
0
        static void PasteAll()                                                  //Instantiate all objects in resource folder
        {
            GameObject clipboardObject;                                         //Make an empty object to instantiate into so we can manipulate the empty objects name
            string     clone = "(Clone)";                                       //String to replace

            Object[] clipboard = Resources.LoadAll("Clipboard");                //Load the clipboard
            for (int x = 0; x < clipboard.Length; x++)                          //Loop through the clipboard
            {
                clipboardObject      = Instantiate((GameObject)clipboard[x]);   //Instantiate clipboard object
                clipboardObject.name = clipboardObject.name.Replace(clone, ""); //Replace (Clone) in the name with nothing
                if (SelectionHandler.GetSelected() != null)
                {
                    clipboardObject.transform.parent = SelectionHandler.GetSelected().transform;
                }
            }
            CreateNewLevel.SaveScene();
        }
コード例 #3
0
 static void PasteNewLevel() //Copy clipboard
 {
     CreateNewLevel.AddNewLevel();
     PasteAll();
 }
コード例 #4
0
ファイル: CacheClear.cs プロジェクト: Koesterc/PuzzleGem
 static void ClearLevelTemplate()    //Recursively delete level template folder
 {
     CreateNewLevel.ClearLevelTemplate();
     AssetDatabase.Refresh();
 }