private void updateDataFolder() { string objectPath2 = "Assets/AP/Assets/Datas/ProjectManagerDatas.asset"; datasProjectManager _datasProjectManager = AssetDatabase.LoadAssetAtPath(objectPath2, typeof(UnityEngine.Object)) as datasProjectManager; string objectPath = "Assets/AP/Assets/Resources/" + _datasProjectManager.currentDatasProjectFolder + "/TextList/wTextnVoices.asset"; _textList = AssetDatabase.LoadAssetAtPath(objectPath, typeof(UnityEngine.Object)) as TextList; serializedObject2 = new UnityEditor.SerializedObject(_textList); helpBoxEditor = serializedObject2.FindProperty("helpBoxEditor"); diaryList = serializedObject2.FindProperty("diaryList"); currentLanguage = serializedObject2.FindProperty("currentLanguage"); languageSlot = diaryList.GetArrayElementAtIndex(currentLanguage.intValue).FindPropertyRelative("_languageSlot"); _listOfLanguage = serializedObject2.FindProperty("listOfLanguage"); showMoreOptions = serializedObject2.FindProperty("showMoreOptions"); fisrtTextDisplayedInEditor = serializedObject2.FindProperty("fisrtTextDisplayedInEditor"); howManyEntryDisplayed = serializedObject2.FindProperty("howManyEntryDisplayed"); selectedID = serializedObject2.FindProperty("selectedID"); editorType = serializedObject2.FindProperty("editorType"); showDefaultLanguage = serializedObject2.FindProperty("showDefaultLanguage"); updateListOfTitle(currentLanguage.intValue); }
void OnEnable() { manipulateTextList = new EditorManipulateTextList(); _MakeTexture(); string objectPath = "Assets/AP/Assets/Datas/ProjectManagerDatas.asset"; _ProjectManagerDatas = AssetDatabase.LoadAssetAtPath(objectPath, typeof(UnityEngine.Object)) as datasProjectManager; if (_ProjectManagerDatas) { serializedObject2 = new UnityEditor.SerializedObject(_ProjectManagerDatas); helpBoxEditor = serializedObject2.FindProperty("helpBoxEditor"); currentDatasProjectFolder = serializedObject2.FindProperty("currentDatasProjectFolder"); int_CurrentDatasProjectFolder = serializedObject2.FindProperty("int_CurrentDatasProjectFolder"); int_CurrentDatasSaveSystem = serializedObject2.FindProperty("int_CurrentDatasSaveSystem"); s_newProjectName = serializedObject2.FindProperty("s_newProjectName"); s_newLanguageName = serializedObject2.FindProperty("s_newLanguageName"); firstSceneBuildInIndex = serializedObject2.FindProperty("firstSceneBuildInIndex"); buildinList = serializedObject2.FindProperty("buildinList"); newSceneName = serializedObject2.FindProperty("newSceneName"); specificChar = serializedObject2.FindProperty("specificChar"); } else { b_ProjectManagerAssetExist = false; } updateProjectList(); string objectEye = "Assets/AP/Assets/Textures/Edit/Eye.png"; eye = AssetDatabase.LoadAssetAtPath(objectEye, typeof(UnityEngine.Object)) as Texture2D; }
//--> checkIfIDExist private void checkIfIDExist(SerializedProperty selectedID) { string objectPath2 = "Assets/AP/Assets/Datas/ProjectManagerDatas.asset"; datasProjectManager _datasProjectManager = AssetDatabase.LoadAssetAtPath(objectPath2, typeof(UnityEngine.Object)) as datasProjectManager; string objectPath = "Assets/AP/Assets/Resources/" + _datasProjectManager.currentDatasProjectFolder + "/TextList/wItem.asset"; TextList _textList = AssetDatabase.LoadAssetAtPath(objectPath, typeof(UnityEngine.Object)) as TextList; if (_textList) { SerializedObject serializedObject2 = new UnityEditor.SerializedObject(_textList); if (selectedID.intValue < serializedObject2.FindProperty("diaryList").GetArrayElementAtIndex(0).FindPropertyRelative("_languageSlot").arraySize && selectedID.intValue >= 0) { SerializedProperty _Title = serializedObject2.FindProperty("diaryList").GetArrayElementAtIndex(0).FindPropertyRelative("_languageSlot").GetArrayElementAtIndex(selectedID.intValue).FindPropertyRelative("diaryTitle").GetArrayElementAtIndex(0); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Item :", GUILayout.Width(40)); EditorGUILayout.LabelField(_Title.stringValue.ToString()); EditorGUILayout.EndHorizontal(); } else { EditorGUILayout.HelpBox("This ID doesn't exist", MessageType.Warning); } } }
void OnEnable() { instance = this; manipulateTextList = new EditorManipulateTextList(); _MakeTexture(); string objectPath2 = "Assets/AP/Assets/Datas/ProjectManagerDatas.asset"; datasProjectManager _datasProjectManager = AssetDatabase.LoadAssetAtPath(objectPath2, typeof(UnityEngine.Object)) as datasProjectManager; string objectPath = "Assets/AP/Assets/Resources/" + _datasProjectManager.currentDatasProjectFolder + "/TextList/wTextnVoices.asset"; _textList = AssetDatabase.LoadAssetAtPath(objectPath, typeof(UnityEngine.Object)) as TextList; if (_textList) { } else { b_inventoryAssetExist = false; } serializedObject2 = new UnityEditor.SerializedObject(_textList); helpBoxEditor = serializedObject2.FindProperty("helpBoxEditor"); diaryList = serializedObject2.FindProperty("diaryList"); currentLanguage = serializedObject2.FindProperty("currentLanguage"); languageSlot = diaryList.GetArrayElementAtIndex(currentLanguage.intValue).FindPropertyRelative("_languageSlot"); _listOfLanguage = serializedObject2.FindProperty("listOfLanguage"); showMoreOptions = serializedObject2.FindProperty("showMoreOptions"); fisrtTextDisplayedInEditor = serializedObject2.FindProperty("fisrtTextDisplayedInEditor"); howManyEntryDisplayed = serializedObject2.FindProperty("howManyEntryDisplayed"); selectedID = serializedObject2.FindProperty("selectedID"); b_EditSubtitle = serializedObject2.FindProperty("b_EditSubtitle"); currentAudioSubtitleEdit = serializedObject2.FindProperty("currentAudioSubtitleEdit"); editorType = serializedObject2.FindProperty("editorType"); showDefaultLanguage = serializedObject2.FindProperty("showDefaultLanguage"); multipleVoiceOver = serializedObject2.FindProperty("multipleVoiceOver"); b_ShowEye = serializedObject2.FindProperty("b_ShowEye"); updateListOfTitle(currentLanguage.intValue); subtitleSystem = new EditorSubtitleSystem(); string objectEye = "Assets/AP/Assets/Textures/Edit/Eye.png"; eye = AssetDatabase.LoadAssetAtPath(objectEye, typeof(UnityEngine.Object)) as Texture2D; }
public TextList loadTextList(string s_Load) { TextList _textList; string objectPath2 = "Assets/AP/Assets/Datas/ProjectManagerDatas.asset"; datasProjectManager _datasProjectManager = AssetDatabase.LoadAssetAtPath(objectPath2, typeof(UnityEngine.Object)) as datasProjectManager; string objectPath = "Assets/AP/Assets/Resources/" + _datasProjectManager.currentDatasProjectFolder + "/TextList/" + s_Load + ".asset"; //Debug.Log("objectPath : " + objectPath); _textList = AssetDatabase.LoadAssetAtPath(objectPath, typeof(UnityEngine.Object)) as TextList; return(_textList); }
//--> Create a list of scenes used in the Save System //[MenuItem("Tools/AP/Update/Save System/Create a list of build in scenes", false, 2)] public void builinScene(bool b_LaunchScene, bool b_UpdateProcessDone) { string objectPath = "Assets/AP/Assets/Datas/ProjectManagerDatas.asset"; datasProjectManager _ProjectManagerDatas = AssetDatabase.LoadAssetAtPath(objectPath, typeof(UnityEngine.Object)) as datasProjectManager; if (_ProjectManagerDatas) { Undo.RegisterFullObjectHierarchyUndo(_ProjectManagerDatas, _ProjectManagerDatas.name); _ProjectManagerDatas.buildinList.Clear(); for (var i = 0; i < EditorBuildSettings.scenes.Length; i++) { string scenName = EditorBuildSettings.scenes[i].path; scenName = scenName.Replace(".unity", ""); for (var j = scenName.Length - 1; j > 1; j--) { char tmp = scenName[j]; if (tmp == '/') { scenName = scenName.Substring(j + 1, scenName.Length - 1 - j); break; } } _ProjectManagerDatas.buildinList.Add(scenName); } } else { if (EditorUtility.DisplayDialog("Info : This action is not possible." , "You need an object datasProjectManager in your Project Tab : Assets/AP/Assets/Datas/ProjectManagerDatas.asset." , "Continue")) { } } Debug.Log("Build In Scene Ok"); if (b_LaunchScene) { bool_UpdateProcessDone = true; } }
void OnEnable() { //-> Load the needed TextList TextProperties myScript = (TextProperties)target; string objectPath = "Assets/AP/Assets/Datas/ProjectManagerDatas.asset"; datasProjectManager _ProjectManagerDatas = AssetDatabase.LoadAssetAtPath(objectPath, typeof(UnityEngine.Object)) as datasProjectManager; string s_dataType = "wTextnVoices.asset"; if (myScript.editorType == 1) { s_dataType = "wItem.asset"; } if (myScript.editorType == 2) { s_dataType = "wUI.asset"; } if (myScript.editorType == 3) { s_dataType = "wFeedback.asset"; } string objectPath2 = "Assets/AP/Assets/Resources/" + _ProjectManagerDatas.currentDatasProjectFolder + "/TextList/" + s_dataType; //Debug.Log (objectPath2); TextList tmpTextList = AssetDatabase.LoadAssetAtPath(objectPath2, typeof(UnityEngine.Object)) as TextList; myScript.textList = tmpTextList; //-> Setup the SerializedProperties. SeeInspector = serializedObject.FindProperty("SeeInspector"); managerID = serializedObject.FindProperty("managerID"); uniqueID = serializedObject.FindProperty("uniqueID"); _textList = serializedObject.FindProperty("textList"); language_AutoUpdate = serializedObject.FindProperty("language_AutoUpdate"); b_UIButtonShowTitle = serializedObject.FindProperty("b_UIButtonShowTitle"); b_UpdateID = serializedObject.FindProperty("b_UpdateID"); Find_UniqueId_In_The_TextList(); Tex_01 = MakeTex(2, 2, new Color(1, .8f, 0.2F, .4f)); }
private void builinScene(EditorBuildSettingsScene[] newEditorBuilingSettings) { string objectPath = "Assets/AP/Assets/Datas/ProjectManagerDatas.asset"; datasProjectManager _ProjectManagerDatas = AssetDatabase.LoadAssetAtPath(objectPath, typeof(UnityEngine.Object)) as datasProjectManager; if (_ProjectManagerDatas) { Undo.RegisterFullObjectHierarchyUndo(_ProjectManagerDatas, _ProjectManagerDatas.name); buildinList.ClearArray(); for (var i = 0; i < newEditorBuilingSettings.Length; i++) { string scenName = EditorBuildSettings.scenes[i].path; scenName = scenName.Replace(".unity", ""); for (var j = scenName.Length - 1; j > 1; j--) { char tmp = scenName[j]; if (tmp == '/') { scenName = scenName.Substring(j + 1, scenName.Length - 1 - j); break; } } buildinList.InsertArrayElementAtIndex(0); buildinList.GetArrayElementAtIndex(0).stringValue = scenName; } } else { if (EditorUtility.DisplayDialog("Info : This action is not possible." , "You need an object datasProjectManager in your Project Tab : Assets/AP/Assets/Datas/ProjectManagerDatas.asset." , "Continue")) { } } }
void OnGUI() { //--> Scrollview scrollPosAll = EditorGUILayout.BeginScrollView(scrollPosAll); //--> Window description //GUI.backgroundColor = _cGreen; CheckTex(); GUIStyle style_Yellow_01 = new GUIStyle(GUI.skin.box); style_Yellow_01.normal.background = Tex_01; GUIStyle style_Blue = new GUIStyle(GUI.skin.box); style_Blue.normal.background = Tex_03; GUIStyle style_Purple = new GUIStyle(GUI.skin.box); style_Purple.normal.background = Tex_04; GUIStyle style_Orange = new GUIStyle(GUI.skin.box); style_Orange.normal.background = Tex_05; GUIStyle style_Yellow_Strong = new GUIStyle(GUI.skin.box); style_Yellow_Strong.normal.background = Tex_02; // EditorGUILayout.BeginVertical(style_Purple); EditorGUILayout.HelpBox("Window Tab : Project Manager", MessageType.Info); EditorGUILayout.EndVertical(); // --> Display data EditorGUILayout.BeginHorizontal(); _ProjectManagerDatas = EditorGUILayout.ObjectField(_ProjectManagerDatas, typeof(UnityEngine.Object), true) as datasProjectManager; EditorGUILayout.EndHorizontal(); if (_ProjectManagerDatas != null) { GUILayout.Label(""); serializedObject2.Update(); //--> Update the list of available projects updateProjectList(); EditorGUILayout.LabelField(""); //--> Section to create a new project currentNewProjectFolder(style_Yellow_01); EditorGUILayout.LabelField(""); //--> Display informations about the current project currentProject(style_Blue, style_Purple); EditorGUILayout.LabelField(""); //--> Display informations DataSaveSystem saveSystem(style_Yellow_01); EditorGUILayout.LabelField(""); //--> Display the buildin Index for the first scene loaded when a new game is created currentFirstSceneBuildinIndex(style_Blue); EditorGUILayout.LabelField(""); //--> Display the list of scene included in the save system ListOfSceneIncludedInTheSaveSystem(style_Yellow_01); serializedObject2.ApplyModifiedProperties(); EditorGUILayout.LabelField(""); EditorGUILayout.LabelField(""); } EditorGUILayout.EndScrollView(); }