コード例 #1
0
 public static void DemoEditorCoroutines()
 {
     // adds a menu item to test the coroutine system.
     if (!Application.isPlaying)
     {
         // lets fire off the demo coroutine with a UI so we can see what its doing. We could also run it without a UI by using EditorCoroutineRunner.StartCoroutine(...)
         EditorCoroutineRunner.StartCoroutineWithUI(DemoCoroutiune(), "Lotte's Coroutine Demo", true);
     }
 }
コード例 #2
0
        public static void Import()
        {
            if (!ImportSettings.InstanceExists)
            {
                GenerateImportSettings();
                EditorUtility.DisplayDialog("Settings Required", "Set Import Settings and Run Importer Again.", "OK");
                return;
            }
            string gameMakerProjectFile = EditorUtility.OpenFilePanel("Find Game Maker .project.gmx", "", "project.gmx");

            basePath = GetBasePath(gameMakerProjectFile);

            XmlElement root = GetRootXmlElement(gameMakerProjectFile);

            sounds      = root.SelectNodes("sounds");
            sprites     = root.SelectNodes("sprites");
            backgrounds = root.SelectNodes("backgrounds");
            objects     = root.SelectNodes("objects");
            rooms       = root.SelectNodes("rooms");

            EditorCoroutineRunner.StartCoroutineWithUI(CopyData(), "Copying GM files");
        }
コード例 #3
0
ファイル: T3DImporter.cs プロジェクト: webdes27/t3dImporter
        static void Import()
        {
            string filePath = EditorUtility.OpenFilePanel("Select t3d", Application.dataPath, "t3d");

            if (string.IsNullOrEmpty(filePath))
            {
                Debug.LogWarning("No file selected");
                return;
            }
            else
            {
                Map map = ImportMap(filePath);
                if (map == null)
                {
                    Debug.LogWarning("Map contents couldn't be read");
                    return;
                }
                Debug.Log(map);

                Transform root = new GameObject("Imported T3D map").transform;
                EditorCoroutineRunner.StartCoroutineWithUI(map.Spawn(root, new Vector3(0.01f, 0.01f, 0.01f)), "Importing", true);
            }
        }