void PlayScale(PitchTest obj) { EditorGUILayout.LabelField("PLAY SCALE"); EditorGUI.indentLevel++; { if( GUILayout.Button("Reset Index")) { index = 0; } EditorGUILayout.BeginHorizontal(); { if( GUILayout.Button("Play Random(Diatonic)")) { obj.PlaySE( PitchTest.CLIP_TYPE.PIANO_C3, 0f, DIATONIC_SCALE[ UnityEngine.Random.Range(0, DIATONIC_SCALE.Length)]); } if( GUILayout.Button("Play Random(PentaTonic)")) { obj.PlaySE( PitchTest.CLIP_TYPE.PIANO_C3, 0f, PENTATONIC_SCALE[ UnityEngine.Random.Range(0, PENTATONIC_SCALE.Length)]); } } EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); { if( GUILayout.Button("Play Incr(Diatonic)")) { obj.PlaySE( PitchTest.CLIP_TYPE.PIANO_C3, 0f, DIATONIC_SCALE[ index++ % DIATONIC_SCALE.Length ]); } if( GUILayout.Button("Play Incr(PentaTonic)")) { obj.PlaySE( PitchTest.CLIP_TYPE.PIANO_C3, 0f, PENTATONIC_SCALE[ index++ % PENTATONIC_SCALE.Length ]); } } EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); { if( GUILayout.Button("Play Incr(ARABIC)")) { obj.PlaySE( PitchTest.CLIP_TYPE.PIANO_C3, 0f, ARABIC_SCALE[ index++ % ARABIC_SCALE.Length ]); } if( GUILayout.Button("Play Decr(ARABIC)")) { index = Mathf.Max( 0, index-1 ); obj.PlaySE( PitchTest.CLIP_TYPE.PIANO_C3, 0f, ARABIC_SCALE[ index % ARABIC_SCALE.Length ]); } } EditorGUILayout.EndHorizontal(); } EditorGUI.indentLevel--; }
void PlayCode(PitchTest obj) { EditorGUILayout.LabelField("PLAY CODE"); EditorGUI.indentLevel++; { if( GUILayout.Button("Play A Code")) { obj.PlaySE( PitchTest.CLIP_TYPE.PIANO_A3, 0f, 1.0f); obj.PlaySE( PitchTest.CLIP_TYPE.PIANO_A3, 0f, THIRD_TONE); obj.PlaySE( PitchTest.CLIP_TYPE.PIANO_A3, 0f, FIFTH_TONE); } if( GUILayout.Button("Play C Code")) { float pitch = UPPER_HALF_TONE * UPPER_HALF_TONE * UPPER_HALF_TONE; obj.PlaySE( PitchTest.CLIP_TYPE.PIANO_A3, 0f, pitch); obj.PlaySE( PitchTest.CLIP_TYPE.PIANO_A3, 0f, pitch * THIRD_TONE); obj.PlaySE( PitchTest.CLIP_TYPE.PIANO_A3, 0f, pitch * FIFTH_TONE); } } EditorGUI.indentLevel--; }