Skip to content

Commit

Permalink
Updated prefab reference fields in project settings, added missing .m…
Browse files Browse the repository at this point in the history
…eta files and updated gitignore
  • Loading branch information
jackyyang09 committed Apr 24, 2023
1 parent 932c92b commit 6f4caa1
Show file tree
Hide file tree
Showing 10 changed files with 249 additions and 68 deletions.
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,4 @@ sysinfo.txt

# Builds
*.apk
*.unitypackage

LICENSE.md.meta
README.md.meta
package.json.meta
*.unitypackage
72 changes: 72 additions & 0 deletions JSAM/Editor/JSAMSettingsProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,80 @@ public override void OnGUI(string searchContext)
EditorGUILayout.PropertyField(startingSoundChannels);
EditorGUILayout.PropertyField(stopSoundsOnSceneLoad);
EditorGUILayout.PropertyField(timeScaledSounds);

EditorGUILayout.BeginHorizontal();
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(soundChannelPrefabOverride);
if (EditorGUI.EndChangeCheck())
{
var go = soundChannelPrefabOverride.objectReferenceValue as GameObject;
if (go)
{
if (!go.GetComponent<AudioSource>())
{
soundChannelPrefabOverride.objectReferenceValue = null;
EditorUtility.DisplayDialog("Prefab Validation Error!",
"Your prefab is missing an AudioSource component!",
"Damn.");
}
else if (!go.GetComponent<SoundChannelHelper>())
{
go.AddComponent<SoundChannelHelper>();
}

if (go.TryGetComponent(out MusicChannelHelper musicHelper))
{
GameObject.DestroyImmediate(musicHelper, true);
}
}
}
if (GUILayout.Button(" Clear ", GUILayout.ExpandWidth(false)))
{
var go = soundChannelPrefabOverride.objectReferenceValue as GameObject;
if (go.TryGetComponent(out SoundChannelHelper soundHelper))
{
GameObject.DestroyImmediate(soundHelper, true);
}
soundChannelPrefabOverride.objectReferenceValue = null;
}
EditorGUILayout.EndHorizontal();

EditorGUILayout.BeginHorizontal();
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(musicChannelPrefabOverride);
if (EditorGUI.EndChangeCheck())
{
var go = musicChannelPrefabOverride.objectReferenceValue as GameObject;
if (go)
{
if (!go.GetComponent<AudioSource>())
{
musicChannelPrefabOverride.objectReferenceValue = null;
EditorUtility.DisplayDialog("Prefab Validation Error!",
"Your prefab is missing an AudioSource component!",
"Damn.");
}
else if (!go.GetComponent<MusicChannelHelper>())
{
go.AddComponent<MusicChannelHelper>();
}

if (go.TryGetComponent(out SoundChannelHelper soundHelper))
{
GameObject.DestroyImmediate(soundHelper, true);
}
}
}
if (GUILayout.Button(" Clear ", GUILayout.ExpandWidth(false)))
{
var go = musicChannelPrefabOverride.objectReferenceValue as GameObject;
if (go.TryGetComponent(out MusicChannelHelper musicHelper))
{
GameObject.DestroyImmediate(musicHelper, true);
}
musicChannelPrefabOverride.objectReferenceValue = null;
}
EditorGUILayout.EndHorizontal();

EditorGUILayout.Space();
mixerFoldout = EditorCompatability.SpecialFoldouts(mixerFoldout, "Mixer Settings");
Expand Down
20 changes: 0 additions & 20 deletions JSAM/Editor/Preferences/JSAMSettings.asset

This file was deleted.

128 changes: 128 additions & 0 deletions JSAM/Examples/Shmup 2D/Example2D.unity
Original file line number Diff line number Diff line change
Expand Up @@ -3227,6 +3227,23 @@ MonoBehaviour:
m_EditorClassIdentifier:
prefab: {fileID: 6789875963486134159, guid: e8785c53dae4f7a418f967cbb80baab9, type: 3}
objectsToSpawn: 200
--- !u!1 &2427964397332691147
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5054036817685303738}
- component: {fileID: 5024159101188339072}
m_Layer: 0
m_Name: GameObject
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4502563657082201730
Transform:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -3273,3 +3290,114 @@ MonoBehaviour:
m_EditorClassIdentifier:
library: {fileID: 11400000, guid: a994b5d4d0565104ab406807efdb466d, type: 2}
listener: {fileID: 519420029}
--- !u!82 &5024159101188339072
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2427964397332691147}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 0}
m_PlayOnAwake: 1
m_Volume: 1
m_Pitch: 1
Loop: 0
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 1
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!4 &5054036817685303738
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2427964397332691147}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Loading

0 comments on commit 6f4caa1

Please sign in to comment.