Exemplo n.º 1
0
        public override void OnGenerationClicked(AbstractCreationWizardEditorProfile editorProfile)
        {
            var editorInformationsData = editorProfile.GetModule <EditorInformations>().EditorInformationsData;
            var levelConfiguration     = editorInformationsData.CommonGameConfigurations.GetConfiguration <LevelConfiguration>();
            var createdAsset           = this.CreateAsset(InstancePath.GetConfigurationDataPath(levelConfiguration), editorInformationsData.LevelZonesID.ToString() + "_" + this.GetType().BaseType.GetGenericArguments()[0].Name, editorProfile);

            levelConfiguration.SetEntry(editorInformationsData.LevelZonesID, createdAsset);
            editorProfile.GameConfigurationModified(editorInformationsData.CommonGameConfigurations.GetConfiguration <LevelConfiguration>(), editorInformationsData.LevelZonesID, createdAsset);
        }
Exemplo n.º 2
0
        public override void OnGenerationClicked(AbstractCreationWizardEditorProfile editorProfile)
        {
            var editorInfomrationsData = editorProfile.GetModule <EditorInformations>().EditorInformationsData;

            var inherentDataClass = editorInfomrationsData.SelectedConfiguration.GetType().BaseType.GetGenericArguments()[1];

            var generateSOObjectManager = new GeneratedScriptableObjectManager <ScriptableObject>(ScriptableObject.CreateInstance(inherentDataClass),
                                                                                                  InstancePath.GetConfigurationDataPath((ScriptableObject)editorInfomrationsData.SelectedConfiguration),
                                                                                                  editorInfomrationsData.SelectedKey.ToString() + "_" + editorInfomrationsData.SelectedConfiguration.GetType().BaseType.GetGenericArguments()[0].Name);

            editorProfile.AddToGeneratedObjects(generateSOObjectManager.GeneratedAsset);

            editorInfomrationsData.SelectedConfiguration.SetEntry(editorInfomrationsData.SelectedKey, generateSOObjectManager.GeneratedAsset);
            EditorUtility.SetDirty((UnityEngine.Object)editorInfomrationsData.SelectedConfiguration);
            editorProfile.GameConfigurationModified((UnityEngine.Object)editorInfomrationsData.SelectedConfiguration, editorInfomrationsData.SelectedKey, generateSOObjectManager.GeneratedAsset);
        }