Ejemplo n.º 1
0
        protected static IEnumerator CopyData()
        {
            startTime = EditorApplication.timeSinceStartup;

            EditorCoroutineRunner.UpdateUITitle("Import 1/5: Sounds");
            EditorCoroutineRunner.UpdateUILabel("Getting Background data");
            TraverseNodes(sounds, "sound");
            yield return(null);

            yield return(EditorCoroutineRunner.StartCoroutine(CopyAssets(targetPaths, ImportType.Sound)));

            targetPaths = new List <ImportAsset>();

            EditorCoroutineRunner.UpdateUITitle("Import 2/5: Backgrounds");
            EditorCoroutineRunner.UpdateUILabel("Getting Background data");
            TraverseNodes(backgrounds, "background");
            yield return(null);

            yield return(EditorCoroutineRunner.StartCoroutine(CopyAssets(targetPaths, ImportType.Background)));

            targetPaths = new List <ImportAsset>();


            EditorCoroutineRunner.UpdateUITitle("Import 3/5: Sprites");
            EditorCoroutineRunner.UpdateUILabel("Getting Sprite data");
            TraverseNodes(sprites, "sprite");
            yield return(null);

            yield return(EditorCoroutineRunner.StartCoroutine(CopyAssets(targetPaths, ImportType.Sprite)));

            targetPaths = new List <ImportAsset>();

            EditorCoroutineRunner.UpdateUITitle("Import 4/5: Objects");
            EditorCoroutineRunner.UpdateUILabel("Getting Object data");
            TraverseNodes(objects, "object");
            yield return(null);

            yield return(EditorCoroutineRunner.StartCoroutine(CopyAssets(targetPaths, ImportType.Object)));

            targetPaths = new List <ImportAsset>();

            EditorCoroutineRunner.UpdateUITitle("Import 5/5: Rooms");
            EditorCoroutineRunner.UpdateUILabel("Getting Room data");
            TraverseNodes(rooms, "room");
            yield return(null);

            yield return(EditorCoroutineRunner.StartCoroutine(CopyAssets(targetPaths, ImportType.Room)));

            TimeSpan timeSpan = TimeSpan.FromSeconds(EditorApplication.timeSinceStartup - startTime);
            string   timeText = string.Format("{0:D2}:{1:D2}:{2:D2}", timeSpan.Hours, timeSpan.Minutes, timeSpan.Seconds);

            print("Project Imported! Total Time: <color=#22ffccff></color> " + "<color=#22ee22ff>" + timeText + "</color>");
        }