private void OnWizardCreate()
        {
            if (string.IsNullOrEmpty(Name))
            {
                return;
            }

            _settings        = AssetDatabase.LoadAssetAtPath <CodeGenerationSettings>(CodeGenPaths.SETTINGS_PATH);
            _operationConfig = _settings.PoolKeyGenerationConfig;

            Dictionary <Type, object> startArgs = new Dictionary <Type, object>()
            {
                {
                    typeof(PoolKeyCodeOperation),
                    new PoolKeyCodeOperation.StartArgs()
                    {
                        Name = this.Name
                    }
                }
            };

            foreach (CodeGenerationOperation operation in _operationConfig.Operations)
            {
                operation.Begin(startArgs);
            }

            //Create necessary operate args.
            Dictionary <Type, object> operateArgs = new Dictionary <Type, object>()
            {
            };

            foreach (CodeGenerationOperation operation in _operationConfig.Operations)
            {
                operation.Operate(operateArgs);
            }

            EditorPrefs.SetString("Name", Name);
            AssetDatabase.Refresh();
        }
Example #2
0
        private void OnWizardCreate()
        {
            if (string.IsNullOrEmpty(Name))
            {
                return;
            }

            _settings        = AssetDatabase.LoadAssetAtPath <CodeGenerationSettings>(CodeGenPaths.SETTINGS_PATH);
            _operationConfig = _settings.ScreenCodeGenerationConfig;

            //Create necessary start args.
            Dictionary <Type, object> startArgs = new Dictionary <Type, object>()
            {
                {
                    typeof(ScreenViewMediatorGenerationOperation),
                    new ScreenViewMediatorGenerationOperation.StartArgs()
                    {
                        Name          = this.Name,
                        Type          = this.Type,
                        ViewEventList = this.ViewEventList
                    }
                },
                {
                    typeof(RootContextGenerationOperation),
                    new RootContextGenerationOperation.StartArgs()
                    {
                        Name = this.Name,
                        Type = this.Type
                    }
                },
                {
                    typeof(GameScreensCodeOperation),
                    new GameScreensCodeOperation.StartArgs()
                    {
                        Name = this.Name
                    }
                },
                {
                    typeof(CreateSceneGenerationOperation),
                    new CreateSceneGenerationOperation.StartArgs()
                    {
                        Name = this.Name
                    }
                }
            };

            foreach (CodeGenerationOperation operation in _operationConfig.Operations)
            {
                operation.Begin(startArgs);
            }

            //Create necessary operate args.
            Dictionary <Type, object> operateArgs = new Dictionary <Type, object>()
            {
            };

            foreach (CodeGenerationOperation operation in _operationConfig.Operations)
            {
                operation.Operate(operateArgs);
            }

            //This is for InitializeOnLoad code above.
            EditorPrefs.SetBool("CreateTestScreenWizard", true);
            EditorPrefs.SetString("Name", Name);
            EditorPrefs.SetString("Type", Type);

            AssetDatabase.Refresh();
        }