Example #1
0
        public static void CreateWidget()
        {
            var info = GetClassInfo();

            var path = GetPath();
            var gen  = new ScriptsGenerator(info, path);

            gen.Generate();
        }
Example #2
0
        void Init(ScriptsGenerator gen, Action action)
        {
            scriptGenerator = gen;
            actionContinue  = action;

            foreach (var script in scriptGenerator.Info.Scripts)
            {
                if (!script.Value)
                {
                    requestScripts[script.Key] = true;
                }
            }

            foreach (var prefab in scriptGenerator.Info.Prefabs)
            {
                if (!prefab.Value)
                {
                    requestPrefabs[prefab.Key] = true;
                }
            }

            foreach (var scene in scriptGenerator.Info.Scenes)
            {
                if (!scene.Value)
                {
                    requestScenes[scene.Key] = true;
                }
            }

            if (RequestsCount == 0)
            {
                Close();
                actionContinue();
            }
            else
            {
#if UNITY_5_1 || UNITY_5_2 || UNITY_5_3 || UNITY_5_3_OR_NEWER
                titleContent = new GUIContent("Widget Generation");
#else
                title = "Widget Generation";
#endif

                var size = new Vector2(600, GetHeight());

                position = new Rect(Screen.width / 2, Screen.height / 2, size[0], size[1]);
                minSize  = size;
                Show();
            }
        }
Example #3
0
        public static void CreateWidget()
        {
            var info = GetClassInfo();

            if (info.IsUnityObject && !EditorUtility.DisplayDialog(
                    "Widgets Generation",
                    "Class is derived from Unity.Object.\nUsing it as a data class can be a bad practice and lead to future problems.",
                    "Continue generation",
                    "Cancel"))
            {
                return;
            }

            var path = GetPath();
            var gen  = new ScriptsGenerator(info, path);

            gen.Generate();
        }
Example #4
0
        /// <summary>
        /// Open window.
        /// </summary>
        /// <param name="gen">Script generator.</param>
        /// <param name="action">Action to continue.</param>
        public static void Open(ScriptsGenerator gen, Action action)
        {
            var window = GetWindow <OverwriteRequestWindow>();

            window.Init(gen, action);
        }