Exemple #1
0
    static void MassBuildQPrefab()
    {
        string output   = "";
        var    oldScene = EditorSceneManager.GetActiveScene().path;
        Dictionary <int, List <GameObjectDifference> > result = GetDifference();

        EditorUtility.DisplayProgressBar("Mass Build QPrefab", "Building", 0);
        for (int iter = 0; iter < result[0].Count; ++iter)
        {
            string path = Application.dataPath.Substring(0, Application.dataPath.IndexOf("Assets")) + "Assets/Scripts/UI/Prefab/" + result[0][iter].q_UI.name + ".unity";

            if (!System.IO.File.Exists(path))
            {
                output += "Unable to Open Scene " + result[0][iter].q_UI.name + "\n";
                continue;
            }

            var scene = EditorSceneManager.OpenScene(path);

            var go = GameObject.FindObjectOfType <UI_VersionNumber>();
            if (go != null)
            {
                UIEditorTools.Create_QUI_Prefab(go.gameObject);
                output += "Q prefab made successfully " + result[0][iter].q_UI.name + "\n";
            }
            else
            {
                output += "Unable to Find Object with UI_VersionNumber " + result[0][iter].q_UI.name + "\n";
            }

            EditorUtility.DisplayProgressBar("Mass Build QPrefab", "Building", iter / result[0].Count);
        }
        EditorSceneManager.OpenScene(oldScene);
        EditorUtility.ClearProgressBar();
        foreach (var obj in result[1])
        {
            output += "Unable to Find Scene " + obj.p_UI.name + "\n";
        }
        Debug.Log(output);
    }
Exemple #2
0
 public static void CreateProgrammerUIPrefab()
 {
     UIEditorTools.Create_QUI_Prefab(Selection.activeGameObject as GameObject);
 }