public override void OnGenerationClicked(AbstractCreationWizardEditorProfile editorProfile) { var editorInformationsData = editorProfile.GetModule <EditorInformations>().EditorInformationsData; this.UpdateLevelHierarchyConfiguration(editorInformationsData.CommonGameConfigurations.GetConfiguration <LevelHierarchyConfiguration>(), editorInformationsData.AssociatedAdventureLevelID, editorInformationsData.LevelZoneChunkID, ref editorProfile); this.UpdateLevelHierarchyConfiguration(editorInformationsData.CommonGameConfigurations.GetConfiguration <LevelHierarchyConfiguration>(), editorInformationsData.AssociatedPuzzleLevelID, editorInformationsData.LevelZoneChunkID, ref editorProfile); }
public override void OnGenerationClicked(AbstractCreationWizardEditorProfile editorProfile) { var editorInformationsData = editorProfile.GetModule <EditorInformations>().EditorInformationsData; this.CreateAsset(InstancePath.LevelZoneChunkSceneConfigurationDataPath, editorInformationsData.LevelZoneChunkID.ToString() + NameConstants.LevelChunkSceneConfigurationData, editorProfile); this.AddToGameConfiguration(editorInformationsData.LevelZoneChunkID, editorInformationsData.CommonGameConfigurations.GetConfiguration <ChunkZonesSceneConfiguration>(), editorProfile); }
public override void OnGenerationClicked(AbstractCreationWizardEditorProfile editorProfile) { var levelZoneConfiguration = this.CreateAsset(InstancePath.LevelZoneSceneConfigurationDataPath, GetLevelZonesID(editorProfile) + NameConstants.LevelSceneConfigurationData, editorProfile); GetCommonGameConfigurations(editorProfile).GetConfiguration <LevelZonesSceneConfiguration>().SetEntry(GetLevelZonesID(editorProfile), levelZoneConfiguration); editorProfile.GameConfigurationModified(GetCommonGameConfigurations(editorProfile).GetConfiguration <LevelZonesSceneConfiguration>(), GetLevelZonesID(editorProfile), levelZoneConfiguration); }
public override void OnGenerationClicked(AbstractCreationWizardEditorProfile editorProfile) { var editorInformationsData = editorProfile.GetModule <EditorInformations>().EditorInformationsData; var createdBaseChunk = this.Create(InstancePath.LevelChunkBaseLevelPrefabPath, editorInformationsData.LevelZoneChunkID.ToString() + NameConstants.BaseLevelChunkPrefab, editorProfile); createdBaseChunk.LevelChunkInteractiveObjectDefinition.LevelZoneChunkID = editorInformationsData.LevelZoneChunkID; PrefabUtility.SavePrefabAsset(createdBaseChunk.gameObject); }
public override void AfterGeneration(AbstractCreationWizardEditorProfile editorProfile) { var levelChunkSceneCreation = editorProfile.GetModule <LevelChunkSceneCreation>(); var serializedCreatedObject = new SerializedObject(this.CreatedObject); serializedCreatedObject.FindProperty(nameof(this.CreatedObject.scene)).objectReferenceValue = levelChunkSceneCreation.CreatedSceneAsset; serializedCreatedObject.ApplyModifiedProperties(); }
public override string ComputeWarningState(AbstractCreationWizardEditorProfile editorProfile) { this.InitProperties(); return(new List <string>() { ErrorHelper.AlreadyPresentInConfigurationV2(this.EditorInformationsData.SelectedKey, this.EditorInformationsData.CommonGameConfigurations.GetConfiguration(this.AllConfigurationTypes[this.selectedTypeIndex])) }.Find(s => !string.IsNullOrEmpty(s))); }
public override void OnGenerationClicked(AbstractCreationWizardEditorProfile editorProfile) { var editorInformationsData = editorProfile.GetModule <EditorInformations>().EditorInformationsData; var createdLevelManager = this.Create(InstancePath.PuzzleLevelDynamicsPath, editorInformationsData.LevelZonesID.ToString() + NameConstants.PuzzleLevelDynamics, editorProfile); createdLevelManager.LevelID = editorInformationsData.LevelZonesID; PrefabUtility.SavePrefabAsset(createdLevelManager.gameObject); }
public override string ComputeErrorState(AbstractCreationWizardEditorProfile editorProfile) { this.InitProperties(); return(new List <string>() { EditorInformationsHelper.ComputeErrorState(ref this.EditorInformationsData.CommonGameConfigurations), this.AttractiveObjectModelVerification() }.Find((s) => !string.IsNullOrEmpty(s))); }
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); }
public override string ComputeWarningState(AbstractCreationWizardEditorProfile editorProfile) { this.InitProperties(); return(new List <string>() { ErrorHelper.AlreadyPresentInConfigurationV2(this.EditorInformationsData.LevelZonesID, this.EditorInformationsData.CommonGameConfigurations.GetConfiguration <LevelZonesSceneConfiguration>()), ErrorHelper.AlreadyPresentInConfigurationV2(this.EditorInformationsData.LevelZonesID, this.EditorInformationsData.CommonGameConfigurations.GetConfiguration <LevelHierarchyConfiguration>()), ErrorHelper.NotAlreadyPresentInConfiguration(this.EditorInformationsData.AssociatedAdventureLevelID, this.EditorInformationsData.CommonGameConfigurations.GetConfiguration <LevelHierarchyConfiguration>().GetKeys(), typeof(LevelHierarchyConfiguration).Name) } .Find((s) => !string.IsNullOrEmpty(s))); }
public override void OnGenerationClicked(AbstractCreationWizardEditorProfile editorProfile) { var generatedHierarchy = this.CreateAsset(InstancePath.PuzzleLevelHierarchyDataPath, this.GetLevelZonesID(editorProfile) + NameConstants.LevelHierarchyConfigurationData, editorProfile); this.GetCommonGameConfigurations(editorProfile).GetConfiguration <LevelHierarchyConfiguration>().SetEntry(this.GetLevelZonesID(editorProfile), generatedHierarchy); editorProfile.GameConfigurationModified(this.GetCommonGameConfigurations(editorProfile).GetConfiguration <LevelHierarchyConfiguration>(), this.GetLevelZonesID(editorProfile), generatedHierarchy); var generatedHierarchySerialized = new SerializedObject(generatedHierarchy); SerializableObjectHelper.SetArray((new List <LevelZoneChunkID>()).ConvertAll(e => (Enum)e), generatedHierarchySerialized.FindProperty(nameof(generatedHierarchy.LevelHierarchy))); generatedHierarchySerialized.ApplyModifiedProperties(); }
public void OnInspectorGUI(AbstractCreationWizardEditorProfile editorProfile) { this.DoInit(); if (!string.IsNullOrEmpty(this.errorMessage)) { this.SetFoldoutStyleTextColor(ref this.foldoutStyle, Color.red); } else if (!string.IsNullOrEmpty(this.warningMessage)) { this.SetFoldoutStyleTextColor(ref this.foldoutStyle, Color.yellow); } else { this.SetFoldoutStyleTextColor(ref this.foldoutStyle, Color.black); } this.warningMessage = this.ComputeWarningState(editorProfile); this.errorMessage = this.ComputeErrorState(editorProfile); EditorGUILayout.BeginVertical(EditorStyles.textArea); EditorGUILayout.BeginHorizontal(); var displayedFoldoutLabel = this.foldoutLabel; if (displayedFoldoutLabel == null) { displayedFoldoutLabel = this.GetType().Name + " : "; } this.ModuleFoldout = EditorGUILayout.Foldout(this.ModuleFoldout, displayedFoldoutLabel, true, this.foldoutStyle); EditorGUILayout.EndHorizontal(); if (this.ModuleFoldout) { var serializedObject = new SerializedObject(this); EditorGUILayout.LabelField(this.headerDescriptionLabel, EditorStyles.miniLabel); this.OnInspectorGUIImpl(serializedObject, editorProfile); serializedObject.ApplyModifiedProperties(); if (!string.IsNullOrEmpty(this.errorMessage)) { EditorGUILayout.HelpBox(this.errorMessage, MessageType.Error, true); } else if (!string.IsNullOrEmpty(this.warningMessage)) { EditorGUILayout.HelpBox(this.warningMessage, MessageType.Warning, true); } } EditorGUILayout.EndVertical(); }
public override void OnGenerationClicked(AbstractCreationWizardEditorProfile editorProfile) { var editorInformationsData = editorProfile.GetModule <EditorInformations>().EditorInformationsData; var levelChunkPrefabCreation = editorProfile.GetModule <LevelChunkPrefabCreation>(); this.CreateNewScene(); var scenePath = LevelPathHelper.BuilChunkPath(InstancePath.LevelBasePath, editorInformationsData.AssociatedAdventureLevelID, editorInformationsData.LevelZoneChunkID); if (this.SaveScene(scenePath)) { PrefabUtility.InstantiatePrefab(levelChunkPrefabCreation.CreatedPrefab); this.SaveScene(scenePath); editorProfile.AddToGeneratedObjects(new Object[] { this.CreatedSceneAsset }); } }
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); }
public override void OnGenerationClicked(AbstractCreationWizardEditorProfile editorProfile) { var editorInformationsData = editorProfile.GetModule <EditorInformations>().EditorInformationsData; var puzzleLevelDynamicsCreation = editorProfile.GetModule <PuzzleLevelDynamicsCreation>(); this.CreateNewScene(); var scenePath = LevelPathHelper.BuildBaseLevelPath(InstancePath.LevelBasePath, editorInformationsData.AssociatedAdventureLevelID, editorInformationsData.LevelZonesID); if (this.SaveScene(scenePath)) { PrefabUtility.InstantiatePrefab(editorInformationsData.CommonGameConfigurations.PuzzleLevelCommonPrefabs.CorePuzzleSceneElements); PrefabUtility.InstantiatePrefab(editorInformationsData.CommonGameConfigurations.PuzzleLevelCommonPrefabs.GameManagerPersistanceInstance); PrefabUtility.InstantiatePrefab(puzzleLevelDynamicsCreation.CreatedPrefab); this.SaveScene(scenePath); editorProfile.AddToGeneratedObjects(new Object[] { this.CreatedSceneAsset }); } }
private void UpdateLevelHierarchyConfiguration(LevelHierarchyConfiguration LevelHierarchyConfiguration, LevelZonesID levelZonesID, LevelZoneChunkID levelZoneChunkID, ref AbstractCreationWizardEditorProfile editorProfile) { if (levelZonesID != LevelZonesID.NONE) { LevelHierarchyConfiguration.AddPuzzleChunkLevel(levelZonesID, levelZoneChunkID); editorProfile.LevelHierarchyAdded(LevelHierarchyConfiguration, levelZonesID, levelZoneChunkID); } }
protected override void OnInspectorGUIImpl(SerializedObject serializedObject, AbstractCreationWizardEditorProfile editorProfile) { }
protected override LevelZonesID GetLevelZonesID(AbstractCreationWizardEditorProfile editorProfile) { var editorInformationsData = editorProfile.GetModule <EditorInformations>().EditorInformationsData; return(editorInformationsData.LevelZonesID); }
protected override CommonGameConfigurations GetCommonGameConfigurations(AbstractCreationWizardEditorProfile editorProfile) { var editorInformationsData = editorProfile.GetModule <EditorInformations>().EditorInformationsData; return(editorInformationsData.CommonGameConfigurations); }
protected override void OnInspectorGUIImpl(SerializedObject serializedObject, AbstractCreationWizardEditorProfile editorProfile) { this.InitProperties(); EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(this.EditorInformationsData)), true); }
public override string ComputeErrorState(AbstractCreationWizardEditorProfile editorProfile) { this.InitProperties(); return(EditorInformationsHelper.ComputeErrorState(ref this.EditorInformationsData.CommonGameConfigurations)); }
protected abstract LevelZonesID GetLevelZonesID(AbstractCreationWizardEditorProfile editorProfile);
protected abstract CommonGameConfigurations GetCommonGameConfigurations(AbstractCreationWizardEditorProfile editorProfile);
public virtual string ComputeErrorState(AbstractCreationWizardEditorProfile editorProfile) { return(string.Empty); }
public override void AfterGeneration(AbstractCreationWizardEditorProfile editorProfile) { SerializableObjectHelper.Modify(this.CreatedObject, (so) => { so.FindProperty(nameof(this.CreatedObject.scene)).objectReferenceValue = this.GetCreatedSceneAsset(editorProfile); }); }
protected abstract SceneAsset GetCreatedSceneAsset(AbstractCreationWizardEditorProfile editorProfile);
public virtual void OnGenerationClicked(AbstractCreationWizardEditorProfile editorProfile) { }
protected override void OnInspectorGUIImpl(SerializedObject serializedObject, AbstractCreationWizardEditorProfile editorProfile) { this.InitProperties(); EditorGUI.BeginChangeCheck(); this.selectedTypeIndex = EditorGUILayout.Popup(this.selectedTypeIndex, this.AllConfigurationTypes.ConvertAll(t => t.Name).ToArray()); if (EditorGUI.EndChangeCheck()) { EditorInformationsData.SelectedKey = (Enum)Activator.CreateInstance(this.AllConfigurationTypes[this.selectedTypeIndex].BaseType.GetGenericArguments()[0]); } if (EditorInformationsData.SelectedKey != null) { var dropwdown = EditorGUILayout.DropdownButton(new GUIContent(EditorInformationsData.SelectedKey.ToString()), FocusType.Keyboard); if (Event.current.type == EventType.Repaint) { this.dropDownRect = GUILayoutUtility.GetLastRect(); } if (dropwdown) { var windowInstance = EditorWindow.CreateInstance <EnumSearchGUIWindow>(); windowInstance.Init(EditorInformationsData.SelectedKey, (newSelectedEnum) => { EditorInformationsData.SelectedKey = newSelectedEnum; }); var windowRect = new Rect(GUIUtility.GUIToScreenPoint(dropDownRect.position), new Vector2(0, dropDownRect.height)); windowInstance.ShowAsDropDown(windowRect, new Vector2(dropDownRect.width, 500)); } } EditorInformationsData.SelectedConfiguration = this.EditorInformationsData.CommonGameConfigurations.GetConfiguration(this.AllConfigurationTypes[this.selectedTypeIndex]); EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(this.EditorInformationsData)).FindPropertyRelative(nameof(EditorInformationsData.CommonGameConfigurations)), true); }
protected override void OnInspectorGUIImpl(SerializedObject serializedObject, AbstractCreationWizardEditorProfile editorProfile) { EditorGUILayout.PropertyField(serializedObject.FindProperty("createdSceneAsset")); }
protected override SceneAsset GetCreatedSceneAsset(AbstractCreationWizardEditorProfile editorProfile) { var sceneCreation = editorProfile.GetModule <LevelSceneCreation>(); return(sceneCreation.CreatedSceneAsset); }