static public void DrawDialogListUtil(DialogPartNode node) { GUICommon.DrawLineSpace(10f, 5f); ViNoEditorUtil.BeginGUIColor(Color.green, GUI.backgroundColor, GUI.contentColor); //Color.black , Color.white ); GUILayout.BeginHorizontal(); // GUILayout.Space( Screen.width/2f ); if (GUILayout.Button("+")) { // if( GUILayout.Button( ViNoEditorResources.plusIcon ) ){ // node.AddData( new DialogPartData() );// AddData( node ); // Debug.Log( "Register Scene Undo"); Undo.RegisterUndo(node, node.name); // Undo.SetSnapshotTarget( node , node.name ); int itemNum = node.GetMessageNum(); node.AddItemAt(itemNum); node.ReAssignDialogIDsInThisObject(); } if (GUILayout.Button("-")) { // if( GUILayout.Button( ViNoEditorResources.minusIcon ) ){//} , GUILayout.Width( sa ) ) ){ Undo.RegisterUndo(node, node.name); // if( EditorUtility.DisplayDialog( "Remove the Last Item ?" , "Are you sure you really want to remove?" // , "Yes", "Cancel" ) ){ if (node.dlgDataList != null && node.dlgDataList.Count > 0) { node.dlgDataList.RemoveAt(node.dlgDataList.Count - 1); } node.ReAssignDialogIDsInThisObject(); // } } GUILayout.EndHorizontal(); ViNoEditorUtil.EndGUIColor(); }
// static private Vector2 m_ScrollPos = Vector2.zero; void OnEnable( ) { // Debug.Log( "OnEnable DialogPartNode"); DialogPartNode dlgNode = (target as DialogPartNode); serializedObject.FindProperty("__dummy__"); // soundDataProp = serializedObject.FindProperty ("soundData"); // DialogPartNodeUtility.RestoreSceneData( dlgNode ); dlgNode.FindTextBoxObjects(); // Assign DialogID. dlgNode.ReAssignDialogIDsInThisObject(); if (m_SoundPlInstance == null) { m_SoundPlInstance = GameObject.FindObjectOfType(typeof(ViNoSoundPlayer)) as ViNoSoundPlayer; } if (m_SoundPlInstance != null) { m_BgmEntries = m_SoundPlInstance.GetSoundEntryNames(); m_VoiceEntries = m_SoundPlInstance.GetVoiceEntryNames(); m_SeEntries = m_SoundPlInstance.GetSeEntryNames(); #if false ScriptableSoundData sound = soundDataProp.objectReferenceValue as ScriptableSoundData; if (sound != null) { /* m_SoundPlInstance.soundEntry = sound.bgmEntries; * m_SoundPlInstance.seEntries = sound.seEntries; * m_SoundPlInstance.voiceEntries = sound.voiceEntries; * * //*/ } #endif } #if false if (m_AnimManagerInstance == null) { m_AnimManagerInstance = GameObject.FindObjectOfType(typeof(ViNoAnimationManager)) as ViNoAnimationManager; } if (m_AnimManagerInstance != null) { m_AnimManagerInstance.CollectAnimationNames(); m_AnimationEntries = m_AnimManagerInstance.animNames; } #endif }
// ViewMode 0 : Actions 1 : Edit Text. public static void DrawDialogItemBar( DialogPartNode node , ref DialogPartData unit , int index , ViNoTextBox textBox , ViNoTextBox nameTextBox ) { #if true DrawItemBarBackground(); #else EditorGUIUtility.LookLikeInspector(); #endif EditorGUILayout.BeginHorizontal(); unit.active = EditorGUILayout.Toggle( unit.active , GUILayout.Width( 10f ) ); #if true EditorGUILayout.LabelField( "ID_" + unit.dialogID , GUILayout.Width( 42f ) ); //*/ unit.actionID = (DialogPartNodeActionType)EditorGUILayout.EnumPopup( unit.actionID , GUILayout.Width( 100f ) ); if( node != null ){ // if( unit.actionID != DialogPartNodeActionType.ClearScene ){ if( GUILayout.Button( "Edit" , GUILayout.Width( 40f ) ) ){ DialogItemInspector browser = EditorWindow.GetWindow( typeof(DialogItemInspector) ) as DialogItemInspector; browser.InitWith( node , index ); } // } } switch( unit.actionID){ case DialogPartNodeActionType.Dialog: // unit.show = EditorGUILayout.Foldout( unit.show , "" ); break; } /* if( GUILayout.Button( "View" , GUILayout.Width( 40f ) ) ){ DialogPartNodeUtility.ViewDialog( unit , textBox , nameTextBox ); DialogPartNodeUtility.ViewScene( unit ); } //*/ #else // EditorGUILayout.LabelField( "ID_" + unit.dialogID , GUILayout.Width( 42f ) ); #endif ///////////////////////// #if true if( GUILayout.Button( "+" , GUILayout.Width( 25f ) ) ){ node.AddItemAt( index + 1 ); node.ReAssignDialogIDsInThisObject(); } if( GUILayout.Button( "-" , GUILayout.Width( 25f ) ) ){ if( EditorUtility.DisplayDialog( "Remove Item at ID_" + index.ToString() + " ?" , "Are you sure you really want to remove?" , "Yes", "Cancel" ) ){ node.RemoveItemAt( index ); node.ReAssignDialogIDsInThisObject(); } } #else // unit.show = EditorGUILayout.Foldout( unit.show , "_" ); EditorGUILayout.BeginHorizontal(); GUILayout.Space( 15f ); unit.isName = EditorGUILayout.Toggle( unit.isName , GUILayout.Width( 10f ) ); EditorGUILayout.LabelField( "Name" , GUILayout.Width(40f ) , GUILayout.Height( 20f ) ); if( unit.isName ){ unit.nameText = EditorGUILayout.TextField( unit.nameText , GUI.skin.textArea, GUILayout.Width(75f ) , GUILayout.Height(20f)); } unit.dialogText = EditorGUILayout.TextArea( unit.dialogText , GUI.skin.textArea ); DrawBGMPopupField( node , unit ); DrawSEPopupField( node , unit ); DrawVoicePopupField( node , unit ); EditorGUILayout.EndHorizontal(); #endif EditorGUILayout.EndHorizontal(); }
public static void DrawDialogListUtil( DialogPartNode node ) { GUICommon.DrawLineSpace( 10f , 5f ); ViNoEditorUtil.BeginGUIColor( Color.green , GUI.backgroundColor , GUI.contentColor );//Color.black , Color.white ); GUILayout.BeginHorizontal(); // GUILayout.Space( Screen.width/2f ); if( GUILayout.Button( "+" ) ){ // if( GUILayout.Button( ViNoEditorResources.plusIcon ) ){ // node.AddData( new DialogPartData() );// AddData( node ); // Debug.Log( "Register Scene Undo"); Undo.RegisterUndo ( node , node.name ); // Undo.SetSnapshotTarget( node , node.name ); int itemNum = node.GetMessageNum(); node.AddItemAt( itemNum ); node.ReAssignDialogIDsInThisObject(); } if( GUILayout.Button( "-" ) ){ // if( GUILayout.Button( ViNoEditorResources.minusIcon ) ){//} , GUILayout.Width( sa ) ) ){ Undo.RegisterUndo ( node , node.name ); // if( EditorUtility.DisplayDialog( "Remove the Last Item ?" , "Are you sure you really want to remove?" // , "Yes", "Cancel" ) ){ if( node.dlgDataList != null && node.dlgDataList.Count > 0 ){ node.dlgDataList.RemoveAt( node.dlgDataList.Count - 1 ); } node.ReAssignDialogIDsInThisObject(); // } } GUILayout.EndHorizontal(); ViNoEditorUtil.EndGUIColor(); }
// ViewMode 0 : Actions 1 : Edit Text. static public void DrawDialogItemBar(DialogPartNode node, ref DialogPartData unit, int index, ViNoTextBox textBox, ViNoTextBox nameTextBox) { #if true DrawItemBarBackground(); #else EditorGUIUtility.LookLikeInspector(); #endif EditorGUILayout.BeginHorizontal(); unit.active = EditorGUILayout.Toggle(unit.active, GUILayout.Width(10f)); #if true EditorGUILayout.LabelField("ID_" + unit.dialogID, GUILayout.Width(42f)); //*/ unit.actionID = (DialogPartNodeActionType)EditorGUILayout.EnumPopup(unit.actionID, GUILayout.Width(100f)); if (node != null) { // if( unit.actionID != DialogPartNodeActionType.ClearScene ){ if (GUILayout.Button("Edit", GUILayout.Width(40f))) { DialogItemInspector browser = EditorWindow.GetWindow(typeof(DialogItemInspector)) as DialogItemInspector; browser.InitWith(node, index); } // } } switch (unit.actionID) { case DialogPartNodeActionType.Dialog: // unit.show = EditorGUILayout.Foldout( unit.show , "" ); break; } /* if( GUILayout.Button( "View" , GUILayout.Width( 40f ) ) ){ * DialogPartNodeUtility.ViewDialog( unit , textBox , nameTextBox ); * DialogPartNodeUtility.ViewScene( unit ); * } * //*/ #else // EditorGUILayout.LabelField( "ID_" + unit.dialogID , GUILayout.Width( 42f ) ); #endif ///////////////////////// #if true if (GUILayout.Button("+", GUILayout.Width(25f))) { node.AddItemAt(index + 1); node.ReAssignDialogIDsInThisObject(); } if (GUILayout.Button("-", GUILayout.Width(25f))) { if (EditorUtility.DisplayDialog("Remove Item at ID_" + index.ToString() + " ?", "Are you sure you really want to remove?" , "Yes", "Cancel")) { node.RemoveItemAt(index); node.ReAssignDialogIDsInThisObject(); } } #else // unit.show = EditorGUILayout.Foldout( unit.show , "_" ); EditorGUILayout.BeginHorizontal(); GUILayout.Space(15f); unit.isName = EditorGUILayout.Toggle(unit.isName, GUILayout.Width(10f)); EditorGUILayout.LabelField("Name", GUILayout.Width(40f), GUILayout.Height(20f)); if (unit.isName) { unit.nameText = EditorGUILayout.TextField(unit.nameText, GUI.skin.textArea, GUILayout.Width(75f), GUILayout.Height(20f)); } unit.dialogText = EditorGUILayout.TextArea(unit.dialogText, GUI.skin.textArea); DrawBGMPopupField(node, unit); DrawSEPopupField(node, unit); DrawVoicePopupField(node, unit); EditorGUILayout.EndHorizontal(); #endif EditorGUILayout.EndHorizontal(); }