chrisgregan
9 years ago
12 changed files with 359 additions and 28 deletions
@ -0,0 +1,61 @@
|
||||
using UnityEditor; |
||||
using UnityEditorInternal; |
||||
using UnityEngine; |
||||
using System.Collections; |
||||
using System.Collections.Generic; |
||||
using Rotorz.ReorderableList; |
||||
|
||||
namespace Fungus |
||||
{ |
||||
|
||||
[CustomEditor (typeof(WriterAudio))] |
||||
public class WriterAudioEditor : Editor |
||||
{ |
||||
protected SerializedProperty volumeProp; |
||||
protected SerializedProperty loopProp; |
||||
protected SerializedProperty audioSourceProp; |
||||
protected SerializedProperty audioModeProp; |
||||
protected SerializedProperty beepSoundsProp; |
||||
protected SerializedProperty soundEffectProp; |
||||
protected SerializedProperty beepDelayProp; |
||||
protected SerializedProperty randomizeDelayProp; |
||||
|
||||
protected virtual void OnEnable() |
||||
{ |
||||
volumeProp = serializedObject.FindProperty("volume"); |
||||
loopProp = serializedObject.FindProperty("loop"); |
||||
audioSourceProp = serializedObject.FindProperty("audioSource"); |
||||
audioModeProp = serializedObject.FindProperty("audioMode"); |
||||
beepSoundsProp = serializedObject.FindProperty("beepSounds"); |
||||
soundEffectProp = serializedObject.FindProperty("soundEffect"); |
||||
beepDelayProp = serializedObject.FindProperty("beepDelay"); |
||||
randomizeDelayProp = serializedObject.FindProperty("randomizeDelay"); |
||||
} |
||||
|
||||
public override void OnInspectorGUI() |
||||
{ |
||||
serializedObject.Update(); |
||||
|
||||
EditorGUILayout.PropertyField(volumeProp); |
||||
EditorGUILayout.PropertyField(loopProp); |
||||
EditorGUILayout.PropertyField(audioSourceProp); |
||||
|
||||
EditorGUILayout.PropertyField(audioModeProp); |
||||
if ((WriterAudio.AudioMode)audioModeProp.enumValueIndex == WriterAudio.AudioMode.Beeps) |
||||
{ |
||||
ReorderableListGUI.Title(new GUIContent("Beep Sounds", "A list of beep sounds to play at random")); |
||||
ReorderableListGUI.ListField(beepSoundsProp); |
||||
|
||||
EditorGUILayout.PropertyField(beepDelayProp); |
||||
EditorGUILayout.PropertyField(randomizeDelayProp); |
||||
} |
||||
else |
||||
{ |
||||
EditorGUILayout.PropertyField(soundEffectProp); |
||||
} |
||||
|
||||
serializedObject.ApplyModifiedProperties(); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2 |
||||
guid: f07068d2254394c5d9367a7b738d8c86 |
||||
timeCreated: 1440497180 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
Binary file not shown.
@ -0,0 +1,22 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 0cec78902391f4944881c028a5bd61e2 |
||||
timeCreated: 1440502847 |
||||
licenseType: Free |
||||
AudioImporter: |
||||
serializedVersion: 6 |
||||
defaultSettings: |
||||
loadType: 1 |
||||
sampleRateSetting: 0 |
||||
sampleRateOverride: 0 |
||||
compressionFormat: 0 |
||||
quality: .5 |
||||
conversionMode: 0 |
||||
platformSettingOverrides: {} |
||||
forceToMono: 0 |
||||
normalize: 1 |
||||
preloadAudioData: 1 |
||||
loadInBackground: 0 |
||||
3D: 0 |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
Binary file not shown.
@ -0,0 +1,22 @@
|
||||
fileFormatVersion: 2 |
||||
guid: e63f93fa5d357441485c639326e9e8f7 |
||||
timeCreated: 1440502847 |
||||
licenseType: Free |
||||
AudioImporter: |
||||
serializedVersion: 6 |
||||
defaultSettings: |
||||
loadType: 1 |
||||
sampleRateSetting: 0 |
||||
sampleRateOverride: 0 |
||||
compressionFormat: 0 |
||||
quality: .5 |
||||
conversionMode: 0 |
||||
platformSettingOverrides: {} |
||||
forceToMono: 0 |
||||
normalize: 1 |
||||
preloadAudioData: 1 |
||||
loadInBackground: 0 |
||||
3D: 0 |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
Binary file not shown.
@ -0,0 +1,22 @@
|
||||
fileFormatVersion: 2 |
||||
guid: c40373edf37cb4a3f8b7b1103d03b1bb |
||||
timeCreated: 1440502847 |
||||
licenseType: Free |
||||
AudioImporter: |
||||
serializedVersion: 6 |
||||
defaultSettings: |
||||
loadType: 1 |
||||
sampleRateSetting: 0 |
||||
sampleRateOverride: 0 |
||||
compressionFormat: 0 |
||||
quality: .5 |
||||
conversionMode: 0 |
||||
platformSettingOverrides: {} |
||||
forceToMono: 0 |
||||
normalize: 1 |
||||
preloadAudioData: 1 |
||||
loadInBackground: 0 |
||||
3D: 0 |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
Loading…
Reference in new issue