Skip to content

Commit

Permalink
stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Sgtfishtank committed Nov 20, 2015
2 parents 9e5a7e8 + aea7640 commit 51670a0
Show file tree
Hide file tree
Showing 112 changed files with 12,593 additions and 5 deletions.
Binary file added Curly Kumquat Project/Assets/AudioManager.prefab
Binary file not shown.
8 changes: 8 additions & 0 deletions Curly Kumquat Project/Assets/AudioManager.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 74 additions & 0 deletions Curly Kumquat Project/Assets/Editor/FMODEventEmitterInspector.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
using UnityEngine;
using UnityEditor;

[CustomEditor(typeof(FMOD_StudioEventEmitter))]
public class FMODEventEmitterInspector : Editor
{
FMOD_StudioEventEmitter emitter;

bool is3D;
float minDistance, maxDistance;

void Awake()
{
emitter = (FMOD_StudioEventEmitter)target;

is3D = false;

if (emitter == null || emitter.asset == null)
{
return;
}

FMOD.Studio.EventDescription desc = FMODEditorExtension.GetEventDescription(emitter.asset.id);

if (desc != null)
{
desc.is3D(out is3D);
desc.getMinimumDistance(out minDistance);
desc.getMaximumDistance(out maxDistance);
}
}

public override void OnInspectorGUI()
{
if (emitter.asset != null)
{
emitter.path = emitter.asset.id; // Note: set path to guid just in case the asset gets deleted
emitter.asset = (FMODAsset)EditorGUILayout.ObjectField(emitter.asset, typeof(FMODAsset), false);

GUILayout.BeginHorizontal();
{
GUILayout.Label("Path:");
EditorGUILayout.SelectableLabel(emitter.asset.path, GUILayout.Height(14));
}
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal();
{
GUILayout.Label("GUID:");
EditorGUILayout.SelectableLabel(emitter.asset.id, GUILayout.Height(14));
}
GUILayout.EndHorizontal();

GUILayout.Label(is3D ? "3D" : "2D");
if (is3D)
{
GUILayout.Label("Distance: (" + minDistance + " - " + maxDistance + ")");
}

bool isDirty = false;
{
bool oldState = emitter.startEventOnAwake;
emitter.startEventOnAwake = GUILayout.Toggle(oldState, "Start Event on Awake");
isDirty = isDirty || (oldState != emitter.startEventOnAwake);
}

if (isDirty)
EditorUtility.SetDirty(emitter);
}
else
{
DrawDefaultInspector();
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

88 changes: 88 additions & 0 deletions Curly Kumquat Project/Assets/Editor/FMODEventInspector.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
using UnityEngine;
using UnityEditor;

[CustomEditor(typeof(FMODAsset))]
public class FMODEventInspector : Editor
{
FMODAsset currentAsset; //Make an easy shortcut to the Dialogue your editing
bool isPlaying = false;
struct Param
{
public FMOD.Studio.PARAMETER_DESCRIPTION desc;
public float val;
}

Param[] parameters = new Param[0];

bool is3D;
float minDistance, maxDistance;

void Awake()
{
currentAsset=(FMODAsset)target;
FMODEditorExtension.StopEvent();
isPlaying = false;

// set up parameters
FMOD.Studio.EventDescription desc = FMODEditorExtension.GetEventDescription(currentAsset.id);
int count;

if (desc == null)
{
return;
}

desc.is3D(out is3D);
desc.getMinimumDistance(out minDistance);
desc.getMaximumDistance(out maxDistance);

desc.getParameterCount(out count);
parameters = new Param[count];

for (int i = 0; i < count; ++i)
{
desc.getParameterByIndex(i, out parameters[i].desc);
parameters[i].val = parameters[i].desc.minimum;
}
}

void OnDestroy()
{
FMODEditorExtension.StopEvent();
}

public override void OnInspectorGUI()
{
//GUILayout.Label("Event: " + currentAsset.name);
GUILayout.Label("Path: " + currentAsset.path);
GUILayout.Label("GUID: " + currentAsset.id);

GUILayout.Label(is3D ? "3D" : "2D");
if (is3D)
{
GUILayout.Label("Distance: (" + minDistance + " - " + maxDistance + ")");
}

GUILayout.BeginHorizontal();
if (!isPlaying && GUILayout.Button("Play", new GUILayoutOption[0]))
{
FMODEditorExtension.AuditionEvent(currentAsset);
isPlaying = true;
}
if (isPlaying && GUILayout.Button("Stop", new GUILayoutOption[0]))
{
FMODEditorExtension.StopEvent();
isPlaying = false;
}
GUILayout.EndHorizontal();

for (int i = 0; i < parameters.Length; ++i)
{
GUILayout.BeginHorizontal();
GUILayout.Label(parameters[i].desc.name);
parameters[i].val = GUILayout.HorizontalSlider(parameters[i].val, parameters[i].desc.minimum, parameters[i].desc.maximum, new GUILayoutOption[0]);
FMODEditorExtension.SetEventParameterValue(i, parameters[i].val);
GUILayout.EndHorizontal();
}
}
}
10 changes: 10 additions & 0 deletions Curly Kumquat Project/Assets/Editor/FMODEventInspector.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Curly Kumquat Project/Assets/Plugins.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Curly Kumquat Project/Assets/Plugins/Android.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
6 changes: 6 additions & 0 deletions Curly Kumquat Project/Assets/Plugins/Android/fmod.jar.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Curly Kumquat Project/Assets/Plugins/Android/libs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Curly Kumquat Project/Assets/Plugins/Android/libs/x86.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Curly Kumquat Project/Assets/Plugins/FMOD.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Curly Kumquat Project/Assets/Plugins/FMOD/Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 51670a0

Please sign in to comment.