feat: SongCreator 씬 완성 — Beat Sage URL 지원, info.dat 메타데이터 자동 추출
- BeatSageUploader: audio_url 지원(UploadFromUrl), PollAndDownload 공통화, ZIP 500 오류 3회 재시도 - BeatSageConverter: info.dat 파싱(SongMetadata), BPM 자동 감지 → 노트 타이밍 변환에 적용 - SongCreatorManager: title/BPM 필수 입력 제거, 난이도 4개 자동 선택, GenerateFlowFromUrl 버그 수정 - NasPublisher: audioPath null 허용(URL 흐름에서 로컬 파일 없는 경우 스킵) - .gitignore/.gitattributes 초기 설정 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8e693dc5d484a2d409b0e7bc4e0f4df8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
|
||||
namespace VRBeats.ScriptableEvents
|
||||
{
|
||||
public abstract class BaseEventListener<T1 , T2 ,T3 , T4> : MonoBehaviour ,
|
||||
IExposeInvoke<T2>
|
||||
where T1 :
|
||||
IExposeAddListener<T3> ,
|
||||
IExposeRemoveListener<T3>
|
||||
where T4: UnityEvent<T2>
|
||||
|
||||
{
|
||||
|
||||
[SerializeField] private T1 gameEvent;
|
||||
[SerializeField] private T4 response;
|
||||
|
||||
public T4 Response { get { return response; } }
|
||||
public T1 GameEvent { get { return gameEvent; } }
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (gameEvent != null)
|
||||
{
|
||||
gameEvent.AddListener( (T3) ((System.Object)this) );
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
if (gameEvent != null)
|
||||
{
|
||||
gameEvent.RemoveListener((T3)((System.Object)this));
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (gameEvent != null)
|
||||
{
|
||||
gameEvent.RemoveListener( (T3)((System.Object)this) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void Invoke(T2 value)
|
||||
{
|
||||
if(response != null)
|
||||
response.Invoke(value);
|
||||
}
|
||||
|
||||
public void AddEventListener(UnityAction<T2> unityAction)
|
||||
{
|
||||
response.AddListener( unityAction );
|
||||
}
|
||||
|
||||
public void SetEventListener(T1 gameEvent)
|
||||
{
|
||||
this.gameEvent = gameEvent;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: df5ed0832a6aa6743ad1f64bb4b80d2f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 168243
|
||||
packageName: VR Beats Kit
|
||||
packageVersion: 2.0
|
||||
assetPath: Assets/VRBeatsKit/Scripts/ScritableEvents/Core/Base/BaseEventListener.cs
|
||||
uploadId: 546658
|
||||
@@ -0,0 +1,34 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace VRBeats.ScriptableEvents
|
||||
{
|
||||
public class BaseGameEvent<T1 , T2> : ScriptableObject , IExposeAddListener<T1>, IExposeRemoveListener<T1> , IExposeInvoke<T2> where T1 : IExposeInvoke<T2>
|
||||
{
|
||||
[SerializeField] private List<T1> eventListenerList = null;
|
||||
[HideInInspector] public T2 invokeValue;
|
||||
|
||||
public List<T1> EventListenerList { get { return eventListenerList; } }
|
||||
|
||||
|
||||
public void AddListener(T1 listener)
|
||||
{
|
||||
eventListenerList.Add(listener);
|
||||
}
|
||||
|
||||
public void RemoveListener(T1 listener)
|
||||
{
|
||||
eventListenerList.Remove(listener);
|
||||
}
|
||||
|
||||
public void Invoke(T2 value)
|
||||
{
|
||||
for (int n = eventListenerList.Count - 1; n >= 0; n--)
|
||||
{
|
||||
eventListenerList[n].Invoke(value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 77195594139989a4fb2f82dae5f1c77e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 168243
|
||||
packageName: VR Beats Kit
|
||||
packageVersion: 2.0
|
||||
assetPath: Assets/VRBeatsKit/Scripts/ScritableEvents/Core/Base/BaseGameEvent.cs
|
||||
uploadId: 546658
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e5e389c231710d54bbef17cd54347f38
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,71 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityEditor;
|
||||
|
||||
namespace VRBeats.ScriptableEvents
|
||||
{
|
||||
//T1 IntGameEvent
|
||||
//T2 int
|
||||
//T3 IntEventListener
|
||||
//T4 OnIntValueChange
|
||||
|
||||
public class BaseGameEventInspector<T1 , T2 , T3, T4> : Editor
|
||||
where T1 : BaseGameEvent<T3 , T2>
|
||||
where T3 : BaseEventListener<T1 , T2 , T3 , T4>
|
||||
where T4 : UnityEvent<T2>
|
||||
{
|
||||
|
||||
private T1 targetEvent = null;
|
||||
private SerializedProperty invokeValue;
|
||||
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
targetEvent = (T1) target;
|
||||
invokeValue = serializedObject.FindProperty("invokeValue");
|
||||
}
|
||||
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
if (!Application.isPlaying)
|
||||
{
|
||||
EditorGUILayout.HelpBox("Sritable events can only be use in running time", MessageType.Info);
|
||||
return;
|
||||
}
|
||||
|
||||
EditorGUILayout.LabelField("Listeners");
|
||||
for (int n = 0; n < targetEvent.EventListenerList.Count; n++)
|
||||
{
|
||||
if (GUILayout.Button(targetEvent.EventListenerList[n].gameObject.name))
|
||||
{
|
||||
EditorGUIUtility.PingObject(targetEvent.EventListenerList[n].gameObject);
|
||||
}
|
||||
|
||||
DrawEventNames(targetEvent.EventListenerList[n].Response);
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.PropertyField(invokeValue);
|
||||
|
||||
if (GUILayout.Button("Invoke"))
|
||||
{
|
||||
targetEvent.Invoke( targetEvent.invokeValue);
|
||||
}
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
}
|
||||
|
||||
private void DrawEventNames(UnityEvent<T2> unityEvent)
|
||||
{
|
||||
for (int n = 0; n < unityEvent.GetPersistentEventCount(); n++)
|
||||
{
|
||||
EditorGUILayout.LabelField(unityEvent.GetPersistentTarget(n).GetType().Name + "." + unityEvent.GetPersistentMethodName(n));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1e91efe1ddac6ff4e9414e95247c6dd8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 168243
|
||||
packageName: VR Beats Kit
|
||||
packageVersion: 2.0
|
||||
assetPath: Assets/VRBeatsKit/Scripts/ScritableEvents/Core/Base/Editor/BaseGameEventInspector.cs
|
||||
uploadId: 546658
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ea5f4da0f37512a44a68b18784194cba
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace VRBeats.ScriptableEvents
|
||||
{
|
||||
public interface IExposeAddListener<T>
|
||||
{
|
||||
void AddListener(T value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9411d134adbe0b24abba7d7a9e751c29
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 168243
|
||||
packageName: VR Beats Kit
|
||||
packageVersion: 2.0
|
||||
assetPath: Assets/VRBeatsKit/Scripts/ScritableEvents/Core/Base/Interfaces/IExposeAddListener.cs
|
||||
uploadId: 546658
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace VRBeats.ScriptableEvents
|
||||
{
|
||||
public interface IExposeInvoke<T>
|
||||
{
|
||||
void Invoke(T value);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3d43bca55bcdfe342b3dba605f8c4fcd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 168243
|
||||
packageName: VR Beats Kit
|
||||
packageVersion: 2.0
|
||||
assetPath: Assets/VRBeatsKit/Scripts/ScritableEvents/Core/Base/Interfaces/IExposeInvoke.cs
|
||||
uploadId: 546658
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
namespace VRBeats.ScriptableEvents
|
||||
{
|
||||
public interface IExposeRemoveListener<T>
|
||||
{
|
||||
void RemoveListener(T value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1d5af0a99701e1649b8f6834c1974cc7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 168243
|
||||
packageName: VR Beats Kit
|
||||
packageVersion: 2.0
|
||||
assetPath: Assets/VRBeatsKit/Scripts/ScritableEvents/Core/Base/Interfaces/IExposeRemoveListener.cs
|
||||
uploadId: 546658
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cc50fe34844945744a377cbaa34ab67e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6e09a8beae2136b42879cd1d22e4e026
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a3612ea7b1492a74c9faad137af8243b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
using UnityEditor;
|
||||
|
||||
namespace VRBeats.ScriptableEvents
|
||||
{
|
||||
[CustomEditor(typeof(FloatGameEvent))]
|
||||
public class I_FloatGameEventInspector : BaseGameEventInspector<FloatGameEvent , float , FloatEventListener , OnFloatValueChange>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2a62de6245945424f873582d5eb6c6da
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 168243
|
||||
packageName: VR Beats Kit
|
||||
packageVersion: 2.0
|
||||
assetPath: Assets/VRBeatsKit/Scripts/ScritableEvents/Core/Types/Float/Editor/I_FloatGameEventInspector.cs
|
||||
uploadId: 546658
|
||||
@@ -0,0 +1,16 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
|
||||
namespace VRBeats.ScriptableEvents
|
||||
{
|
||||
public class FloatEventListener : BaseEventListener<FloatGameEvent , float , FloatEventListener , OnFloatValueChange>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class OnFloatValueChange : UnityEvent<float> { }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1208e00e2eb0b704d8c37efdfad0da6b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 168243
|
||||
packageName: VR Beats Kit
|
||||
packageVersion: 2.0
|
||||
assetPath: Assets/VRBeatsKit/Scripts/ScritableEvents/Core/Types/Float/FloatEventListener.cs
|
||||
uploadId: 546658
|
||||
@@ -0,0 +1,11 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace VRBeats.ScriptableEvents
|
||||
{
|
||||
[CreateAssetMenu(fileName = "FloatEvent" , menuName = "VR Beats/Events/Float", order =50)]
|
||||
public class FloatGameEvent : BaseGameEvent<FloatEventListener , float>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4e0384144a5bfa543b5a869a2d44f9f3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 168243
|
||||
packageName: VR Beats Kit
|
||||
packageVersion: 2.0
|
||||
assetPath: Assets/VRBeatsKit/Scripts/ScritableEvents/Core/Types/Float/FloatGameEvent.cs
|
||||
uploadId: 546658
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0e3b1382dccf75a4fb5490799c182c8c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aacde1eb701606e4780dabc9bb279b4e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
using UnityEditor;
|
||||
|
||||
namespace VRBeats.ScriptableEvents
|
||||
{
|
||||
[CustomEditor(typeof(IntGameEvent))]
|
||||
public class I_IntGameEventInspector : BaseGameEventInspector<IntGameEvent , int , IntEventListener , OnIntValueChange>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f5767760e5e62f444854424f18b433f6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 168243
|
||||
packageName: VR Beats Kit
|
||||
packageVersion: 2.0
|
||||
assetPath: Assets/VRBeatsKit/Scripts/ScritableEvents/Core/Types/Int/Editor/I_IntGameEventInspector.cs
|
||||
uploadId: 546658
|
||||
@@ -0,0 +1,16 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
|
||||
namespace VRBeats.ScriptableEvents
|
||||
{
|
||||
public class IntEventListener : BaseEventListener<IntGameEvent , int , IntEventListener , OnIntValueChange>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class OnIntValueChange : UnityEvent<int> { }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eec145ac06a74c54191ccf0649d2e498
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 168243
|
||||
packageName: VR Beats Kit
|
||||
packageVersion: 2.0
|
||||
assetPath: Assets/VRBeatsKit/Scripts/ScritableEvents/Core/Types/Int/IntEventListener.cs
|
||||
uploadId: 546658
|
||||
@@ -0,0 +1,11 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace VRBeats.ScriptableEvents
|
||||
{
|
||||
[CreateAssetMenu(fileName = "IntEvent" , menuName = "VR Beats/Events/Int", order =50)]
|
||||
public class IntGameEvent : BaseGameEvent<IntEventListener , int>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d1f508455a69e8d4aabf6bf1fcdc2fa7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 168243
|
||||
packageName: VR Beats Kit
|
||||
packageVersion: 2.0
|
||||
assetPath: Assets/VRBeatsKit/Scripts/ScritableEvents/Core/Types/Int/IntGameEvent.cs
|
||||
uploadId: 546658
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: afa833f696d490244a04fc89d0f8459c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 95544b544f9cab5468595236677b20f7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace VRBeats.ScriptableEvents
|
||||
{
|
||||
[CustomEditor(typeof(Vector2GameEvent))]
|
||||
public class I_Vector2GameEventInspector : BaseGameEventInspector<Vector2GameEvent , Vector2, Vector2EventListener, OnVector2ValueChange>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f65b84b37d3b2944da9063c18b059a0e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 168243
|
||||
packageName: VR Beats Kit
|
||||
packageVersion: 2.0
|
||||
assetPath: Assets/VRBeatsKit/Scripts/ScritableEvents/Core/Types/Vector2/Editor/I_Vector2GameEventInspector.cs
|
||||
uploadId: 546658
|
||||
@@ -0,0 +1,11 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace VRBeats.ScriptableEvents
|
||||
{
|
||||
[CreateAssetMenu(fileName = "Vector2Event" , menuName = "VR Beats/Events/Vector2", order =50)]
|
||||
public class Vector2GameEvent : BaseGameEvent<Vector2EventListener, Vector2>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c7d9b1390a9b5db4b8fa80182822570b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 168243
|
||||
packageName: VR Beats Kit
|
||||
packageVersion: 2.0
|
||||
assetPath: Assets/VRBeatsKit/Scripts/ScritableEvents/Core/Types/Vector2/Vector2GameEvent.cs
|
||||
uploadId: 546658
|
||||
@@ -0,0 +1,16 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
|
||||
namespace VRBeats.ScriptableEvents
|
||||
{
|
||||
public class Vector2EventListener : BaseEventListener<Vector2GameEvent, Vector2, Vector2EventListener, OnVector2ValueChange>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class OnVector2ValueChange : UnityEvent<Vector2> { }
|
||||
|
||||
}
|
||||
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7f3e0ee29da9ef649a10a2161d2529ac
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 168243
|
||||
packageName: VR Beats Kit
|
||||
packageVersion: 2.0
|
||||
assetPath: Assets/VRBeatsKit/Scripts/ScritableEvents/Core/Types/Vector2/VectorEventListener.cs
|
||||
uploadId: 546658
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4c5d176b12bf51040a4dba4f7e8f5fd0
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9fd8c85185c209540ad58ae58e282ae2
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityEditor;
|
||||
|
||||
namespace VRBeats.ScriptableEvents
|
||||
{
|
||||
[CustomEditor(typeof(GameEvent))]
|
||||
public class I_GameEventInspector : Editor
|
||||
{
|
||||
private GameEvent targetEvent = null;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
targetEvent = (GameEvent)target;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
if (!Application.isPlaying)
|
||||
{
|
||||
EditorGUILayout.HelpBox("Sritable events can only be use in running time" , MessageType.Info);
|
||||
return;
|
||||
}
|
||||
|
||||
EditorGUILayout.LabelField("Listeners" );
|
||||
for (int n = 0; n < targetEvent.EventListenerList.Count; n++)
|
||||
{
|
||||
if (GUILayout.Button(targetEvent.EventListenerList[n].gameObject.name))
|
||||
{
|
||||
EditorGUIUtility.PingObject(targetEvent.EventListenerList[n].gameObject);
|
||||
}
|
||||
|
||||
DrawEventNames(targetEvent.EventListenerList[n].Response );
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
if (GUILayout.Button("Invoke"))
|
||||
{
|
||||
targetEvent.Invoke();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void DrawEventNames(UnityEvent unityEvent)
|
||||
{
|
||||
for (int n = 0; n < unityEvent.GetPersistentEventCount(); n++)
|
||||
{
|
||||
EditorGUILayout.LabelField( unityEvent.GetPersistentTarget(n).GetType().Name + "." +unityEvent.GetPersistentMethodName(n) );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a2d33d31d899f6849b7c062101ee0476
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 168243
|
||||
packageName: VR Beats Kit
|
||||
packageVersion: 2.0
|
||||
assetPath: Assets/VRBeatsKit/Scripts/ScritableEvents/Core/Types/Void/Editor/I_GameEventInspector.cs
|
||||
uploadId: 546658
|
||||
@@ -0,0 +1,54 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using System;
|
||||
|
||||
namespace VRBeats.ScriptableEvents
|
||||
{
|
||||
public class EventListener : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private GameEvent gameEvent = null;
|
||||
[SerializeField] private UnityEvent response = null;
|
||||
|
||||
public UnityEvent Response { get { return response; } }
|
||||
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (gameEvent != null)
|
||||
{
|
||||
gameEvent.AddListener(this);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
if (gameEvent != null)
|
||||
{
|
||||
gameEvent.RemoveListener(this);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (gameEvent != null)
|
||||
{
|
||||
gameEvent.RemoveListener(this);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnSpawn()
|
||||
{
|
||||
if (gameEvent != null)
|
||||
{
|
||||
gameEvent.AddListener(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public virtual void Invoke()
|
||||
{
|
||||
response.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8a74d5da5724d2849bfd4e6403f45305
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 168243
|
||||
packageName: VR Beats Kit
|
||||
packageVersion: 2.0
|
||||
assetPath: Assets/VRBeatsKit/Scripts/ScritableEvents/Core/Types/Void/EventListener.cs
|
||||
uploadId: 546658
|
||||
@@ -0,0 +1,42 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace VRBeats.ScriptableEvents
|
||||
{
|
||||
[CreateAssetMenu(fileName = "Event", menuName = "VR Beats/Events/Void", order = 10000)]
|
||||
public class GameEvent : ScriptableObject
|
||||
{
|
||||
[SerializeField] private List<EventListener> eventListenerList = null;
|
||||
|
||||
public List<EventListener> EventListenerList { get { return eventListenerList; } }
|
||||
|
||||
|
||||
public void AddListener(EventListener listener)
|
||||
{
|
||||
if (!eventListenerList.Contains(listener))
|
||||
{
|
||||
eventListenerList.Add(listener);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void RemoveListener(EventListener listener)
|
||||
{
|
||||
if (eventListenerList.Contains(listener))
|
||||
{
|
||||
eventListenerList.Remove(listener);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void Invoke()
|
||||
{
|
||||
for (int n = eventListenerList.Count - 1; n >= 0; n--)
|
||||
{
|
||||
eventListenerList[n].Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fe14af21ad30b4344870d6dd63656723
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 168243
|
||||
packageName: VR Beats Kit
|
||||
packageVersion: 2.0
|
||||
assetPath: Assets/VRBeatsKit/Scripts/ScritableEvents/Core/Types/Void/GameEvent.cs
|
||||
uploadId: 546658
|
||||
Reference in New Issue
Block a user