summaryrefslogtreecommitdiff
path: root/Assets/Scripts/Utils
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/Scripts/Utils')
-rw-r--r--Assets/Scripts/Utils/LogHelper.cs17
-rw-r--r--Assets/Scripts/Utils/LogHelper.cs.meta11
-rw-r--r--Assets/Scripts/Utils/UnityExtends.cs16
-rw-r--r--Assets/Scripts/Utils/UnityExtends.cs.meta11
4 files changed, 55 insertions, 0 deletions
diff --git a/Assets/Scripts/Utils/LogHelper.cs b/Assets/Scripts/Utils/LogHelper.cs
new file mode 100644
index 00000000..9c835bbe
--- /dev/null
+++ b/Assets/Scripts/Utils/LogHelper.cs
@@ -0,0 +1,17 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public static class LogHelper
+{
+ public static void LogError(string msg)
+ {
+ Debug.LogError("[Erika] " + msg);
+ }
+
+ public static void Log(string msg)
+ {
+ Debug.Log("[Erika] " + msg);
+ }
+
+}
diff --git a/Assets/Scripts/Utils/LogHelper.cs.meta b/Assets/Scripts/Utils/LogHelper.cs.meta
new file mode 100644
index 00000000..c8d1f167
--- /dev/null
+++ b/Assets/Scripts/Utils/LogHelper.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: dd089c734de45ce41b5d8cf87dfbd0bf
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Utils/UnityExtends.cs b/Assets/Scripts/Utils/UnityExtends.cs
new file mode 100644
index 00000000..d1a66f48
--- /dev/null
+++ b/Assets/Scripts/Utils/UnityExtends.cs
@@ -0,0 +1,16 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public static class UnityExtends
+{
+ public static T GetOrAddComponent<T>(this GameObject go) where T : MonoBehaviour
+ {
+ T component = go.GetComponent<T>();
+ if (component == null)
+ component = go.AddComponent<T>();
+ return component;
+ }
+
+
+}
diff --git a/Assets/Scripts/Utils/UnityExtends.cs.meta b/Assets/Scripts/Utils/UnityExtends.cs.meta
new file mode 100644
index 00000000..44139deb
--- /dev/null
+++ b/Assets/Scripts/Utils/UnityExtends.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 3d655d75a9052fa499fa925877bb9340
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant: