From 97ab9d88e993af9c164fc2002a1a018336bbda5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Heiling?= Date: Mon, 19 Feb 2018 09:05:12 +0100 Subject: [PATCH] added DebugWrapper, bumped version to 1.2.0 --- Code/Utils/Engine/DebugWrapper.cs | 185 ++++++++++++++++++++++ Code/Utils/Engine/DebugWrapper.cs.meta | 13 ++ Examples/Example1/Signals/GravityY.asset | 24 ++- Examples/Example1/Signals/TimeScale.asset | 24 ++- README.md | 5 +- Wrapper/Debug.asset | 13 ++ Wrapper/Debug.asset.meta | 10 ++ 7 files changed, 269 insertions(+), 5 deletions(-) create mode 100644 Code/Utils/Engine/DebugWrapper.cs create mode 100644 Code/Utils/Engine/DebugWrapper.cs.meta create mode 100644 Wrapper/Debug.asset create mode 100644 Wrapper/Debug.asset.meta diff --git a/Code/Utils/Engine/DebugWrapper.cs b/Code/Utils/Engine/DebugWrapper.cs new file mode 100644 index 0000000..fd10ad0 --- /dev/null +++ b/Code/Utils/Engine/DebugWrapper.cs @@ -0,0 +1,185 @@ +using UnityEngine; + + + +namespace Signals.Utils.Engine +{ + [CreateAssetMenu(fileName = "Debug", menuName = "Signals/Utils/Engine/DebugWrapper")] + public class DebugWrapper : ScriptableObject + { + public void Assert(bool condition) + { + Debug.Assert(condition); + } + + public void Break() + { + Debug.Break(); + } + + public void Log(string message) + { + Debug.Log(message); + } + + public void LogWarning(string message) + { + Debug.LogWarning(message); + } + + public void LogError(string message) + { + Debug.LogError(message); + } + + public void Log(bool message) + { + Debug.Log(message); + } + + public void LogWarning(bool message) + { + Debug.LogWarning(message); + } + + public void LogError(bool message) + { + Debug.LogError(message); + } + + public void Log(char message) + { + Debug.Log(message); + } + + public void LogWarning(char message) + { + Debug.LogWarning(message); + } + + public void LogError(char message) + { + Debug.LogError(message); + } + + public void Log(float message) + { + Debug.Log(message); + } + + public void LogWarning(float message) + { + Debug.LogWarning(message); + } + + public void LogError(float message) + { + Debug.LogError(message); + } + + public void Log(int message) + { + Debug.Log(message); + } + + public void LogWarning(int message) + { + Debug.LogWarning(message); + } + + public void LogError(int message) + { + Debug.LogError(message); + } + + public void Log(Quaternion message) + { + Debug.Log(message); + } + + public void LogWarning(Quaternion message) + { + Debug.LogWarning(message); + } + + public void LogError(Quaternion message) + { + Debug.LogError(message); + } + + public void Log(Vector2 message) + { + Debug.Log(message); + } + + public void LogWarning(Vector2 message) + { + Debug.LogWarning(message); + } + + public void LogError(Vector2 message) + { + Debug.LogError(message); + } + + public void Log(Vector2Int message) + { + Debug.Log(message); + } + + public void LogWarning(Vector2Int message) + { + Debug.LogWarning(message); + } + + public void LogError(Vector2Int message) + { + Debug.LogError(message); + } + + public void Log(Vector3 message) + { + Debug.Log(message); + } + + public void LogWarning(Vector3 message) + { + Debug.LogWarning(message); + } + + public void LogError(Vector3 message) + { + Debug.LogError(message); + } + + public void Log(Vector3Int message) + { + Debug.Log(message); + } + + public void LogWarning(Vector3Int message) + { + Debug.LogWarning(message); + } + + public void LogError(Vector3Int message) + { + Debug.LogError(message); + } + + public void Log(Vector4 message) + { + Debug.Log(message); + } + + public void LogWarning(Vector4 message) + { + Debug.LogWarning(message); + } + + public void LogError(Vector4 message) + { + Debug.LogError(message); + } + } +} \ No newline at end of file diff --git a/Code/Utils/Engine/DebugWrapper.cs.meta b/Code/Utils/Engine/DebugWrapper.cs.meta new file mode 100644 index 0000000..6990763 --- /dev/null +++ b/Code/Utils/Engine/DebugWrapper.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 3d7229d17e1eee44ba6021a1756490a9 +timeCreated: 1518990614 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Examples/Example1/Signals/GravityY.asset b/Examples/Example1/Signals/GravityY.asset index 9c6d122..8fd6dab 100644 --- a/Examples/Example1/Signals/GravityY.asset +++ b/Examples/Example1/Signals/GravityY.asset @@ -16,7 +16,29 @@ MonoBehaviour: _initialValue: 0 _onChanged: m_PersistentCalls: - m_Calls: [] + m_Calls: + - m_Target: {fileID: 11400000, guid: 339cb66c787a6fd459ba8306c85481a6, type: 2} + m_MethodName: Log + m_Mode: 5 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: 'Gravity:' + m_BoolArgument: 0 + m_CallState: 2 + - m_Target: {fileID: 11400000, guid: 339cb66c787a6fd459ba8306c85481a6, type: 2} + m_MethodName: Log + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 m_TypeName: Signals.Common.FloatEvent, Signals, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null _useValidation: 1 diff --git a/Examples/Example1/Signals/TimeScale.asset b/Examples/Example1/Signals/TimeScale.asset index 3c19ee5..a6c7e0c 100644 --- a/Examples/Example1/Signals/TimeScale.asset +++ b/Examples/Example1/Signals/TimeScale.asset @@ -16,7 +16,29 @@ MonoBehaviour: _initialValue: 0 _onChanged: m_PersistentCalls: - m_Calls: [] + m_Calls: + - m_Target: {fileID: 11400000, guid: 339cb66c787a6fd459ba8306c85481a6, type: 2} + m_MethodName: Log + m_Mode: 5 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: 'TimeScale:' + m_BoolArgument: 0 + m_CallState: 2 + - m_Target: {fileID: 11400000, guid: 339cb66c787a6fd459ba8306c85481a6, type: 2} + m_MethodName: Log + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 m_TypeName: Signals.Common.FloatEvent, Signals, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null _useValidation: 1 diff --git a/README.md b/README.md index 4a4f4aa..e490c00 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Signals For Unity3D v1.1.0 +# Signals For Unity3D v1.2.0 ## Documentation You can find the API documentation [here](https://jheiling.github.io/unity-signals/). ## What Are Signals? @@ -67,5 +67,4 @@ You can find a simple code generator that can save you a lot of work [here](http ### Examples See Examples folder. ## Credits -Signals was inspired by Ryan Hipple's [talk](https://www.youtube.com/watch?v=raQ3iHhE_Kk) about game architecture with ScriptableObjects. -I also nicked a bit of his code for the ValueReferenceDrawer class. You can find the source [here](https://github.com/roboryantron/Unite2017). \ No newline at end of file +Signals was inspired by Ryan Hipple's [talk](https://www.youtube.com/watch?v=raQ3iHhE_Kk) about game architecture with ScriptableObjects. \ No newline at end of file diff --git a/Wrapper/Debug.asset b/Wrapper/Debug.asset new file mode 100644 index 0000000..b3e4876 --- /dev/null +++ b/Wrapper/Debug.asset @@ -0,0 +1,13 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3d7229d17e1eee44ba6021a1756490a9, type: 3} + m_Name: Debug + m_EditorClassIdentifier: diff --git a/Wrapper/Debug.asset.meta b/Wrapper/Debug.asset.meta new file mode 100644 index 0000000..483f378 --- /dev/null +++ b/Wrapper/Debug.asset.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 339cb66c787a6fd459ba8306c85481a6 +timeCreated: 1518990634 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: