Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
    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);
    }
Example #4
0
        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);
        }
Example #5
0
        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();
        }
Example #6
0
 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)));
 }
Example #7
0
        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);
        }
Example #8
0
 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)));
 }
Example #9
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);
        }
Example #10
0
 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)));
 }
Example #11
0
    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();
    }
Example #12
0
    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();
    }
Example #13
0
        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 });
            }
        }
Example #14
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);
        }
Example #15
0
        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 });
            }
        }
Example #16
0
 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);
     }
 }
Example #17
0
 protected override void OnInspectorGUIImpl(SerializedObject serializedObject, AbstractCreationWizardEditorProfile editorProfile)
 {
 }
Example #18
0
        protected override LevelZonesID GetLevelZonesID(AbstractCreationWizardEditorProfile editorProfile)
        {
            var editorInformationsData = editorProfile.GetModule <EditorInformations>().EditorInformationsData;

            return(editorInformationsData.LevelZonesID);
        }
Example #19
0
        protected override CommonGameConfigurations GetCommonGameConfigurations(AbstractCreationWizardEditorProfile editorProfile)
        {
            var editorInformationsData = editorProfile.GetModule <EditorInformations>().EditorInformationsData;

            return(editorInformationsData.CommonGameConfigurations);
        }
Example #20
0
 protected override void OnInspectorGUIImpl(SerializedObject serializedObject, AbstractCreationWizardEditorProfile editorProfile)
 {
     this.InitProperties();
     EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(this.EditorInformationsData)), true);
 }
Example #21
0
 public override string ComputeErrorState(AbstractCreationWizardEditorProfile editorProfile)
 {
     this.InitProperties();
     return(EditorInformationsHelper.ComputeErrorState(ref this.EditorInformationsData.CommonGameConfigurations));
 }
Example #22
0
 protected abstract LevelZonesID GetLevelZonesID(AbstractCreationWizardEditorProfile editorProfile);
Example #23
0
 protected abstract CommonGameConfigurations GetCommonGameConfigurations(AbstractCreationWizardEditorProfile editorProfile);
Example #24
0
 public virtual string ComputeErrorState(AbstractCreationWizardEditorProfile editorProfile)
 {
     return(string.Empty);
 }
Example #25
0
 public override void AfterGeneration(AbstractCreationWizardEditorProfile editorProfile)
 {
     SerializableObjectHelper.Modify(this.CreatedObject, (so) => { so.FindProperty(nameof(this.CreatedObject.scene)).objectReferenceValue = this.GetCreatedSceneAsset(editorProfile); });
 }
Example #26
0
 protected abstract SceneAsset GetCreatedSceneAsset(AbstractCreationWizardEditorProfile editorProfile);
Example #27
0
 public virtual void OnGenerationClicked(AbstractCreationWizardEditorProfile editorProfile)
 {
 }
Example #28
0
        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);
        }
Example #29
0
 protected override void OnInspectorGUIImpl(SerializedObject serializedObject, AbstractCreationWizardEditorProfile editorProfile)
 {
     EditorGUILayout.PropertyField(serializedObject.FindProperty("createdSceneAsset"));
 }
Example #30
0
        protected override SceneAsset GetCreatedSceneAsset(AbstractCreationWizardEditorProfile editorProfile)
        {
            var sceneCreation = editorProfile.GetModule <LevelSceneCreation>();

            return(sceneCreation.CreatedSceneAsset);
        }