From 97da432c35b8c7aaf9dd2c39e2aa4b1f55f36065 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 27 Jan 2021 16:15:06 +0800 Subject: +behaviour designer --- .../Runtime/Basic Tasks/PlayerPrefs/DeleteAll.cs | 16 +++++++++++ .../Basic Tasks/PlayerPrefs/DeleteAll.cs.meta | 8 ++++++ .../Runtime/Basic Tasks/PlayerPrefs/DeleteKey.cs | 24 +++++++++++++++++ .../Basic Tasks/PlayerPrefs/DeleteKey.cs.meta | 8 ++++++ .../Runtime/Basic Tasks/PlayerPrefs/GetFloat.cs | 31 ++++++++++++++++++++++ .../Basic Tasks/PlayerPrefs/GetFloat.cs.meta | 8 ++++++ .../Runtime/Basic Tasks/PlayerPrefs/GetInt.cs | 31 ++++++++++++++++++++++ .../Runtime/Basic Tasks/PlayerPrefs/GetInt.cs.meta | 8 ++++++ .../Runtime/Basic Tasks/PlayerPrefs/GetString.cs | 31 ++++++++++++++++++++++ .../Basic Tasks/PlayerPrefs/GetString.cs.meta | 8 ++++++ .../Runtime/Basic Tasks/PlayerPrefs/HasKey.cs | 22 +++++++++++++++ .../Runtime/Basic Tasks/PlayerPrefs/HasKey.cs.meta | 8 ++++++ .../Runtime/Basic Tasks/PlayerPrefs/Save.cs | 16 +++++++++++ .../Runtime/Basic Tasks/PlayerPrefs/Save.cs.meta | 8 ++++++ .../Runtime/Basic Tasks/PlayerPrefs/SetFloat.cs | 27 +++++++++++++++++++ .../Basic Tasks/PlayerPrefs/SetFloat.cs.meta | 8 ++++++ .../Runtime/Basic Tasks/PlayerPrefs/SetInt.cs | 27 +++++++++++++++++++ .../Runtime/Basic Tasks/PlayerPrefs/SetInt.cs.meta | 8 ++++++ .../Runtime/Basic Tasks/PlayerPrefs/SetString.cs | 27 +++++++++++++++++++ .../Basic Tasks/PlayerPrefs/SetString.cs.meta | 8 ++++++ 20 files changed, 332 insertions(+) create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteAll.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteAll.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteKey.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteKey.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetFloat.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetFloat.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetInt.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetInt.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetString.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetString.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/HasKey.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/HasKey.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/Save.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/Save.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetFloat.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetFloat.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetInt.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetInt.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetString.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetString.cs.meta (limited to 'Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs') diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteAll.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteAll.cs new file mode 100644 index 00000000..0562303f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteAll.cs @@ -0,0 +1,16 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityPlayerPrefs +{ + [TaskCategory("Basic/PlayerPrefs")] + [TaskDescription("Deletes all entries from the PlayerPrefs.")] + public class DeleteAll : Action + { + public override TaskStatus OnUpdate() + { + PlayerPrefs.DeleteAll(); + + return TaskStatus.Success; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteAll.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteAll.cs.meta new file mode 100644 index 00000000..707b849e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteAll.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0c6d6b2dabc08ac42875cdbe1f86642b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteKey.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteKey.cs new file mode 100644 index 00000000..8fc4c352 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteKey.cs @@ -0,0 +1,24 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityPlayerPrefs +{ + [TaskCategory("Basic/PlayerPrefs")] + [TaskDescription("Deletes the specified key from the PlayerPrefs.")] + public class DeleteKey : Action + { + [Tooltip("The key to delete")] + public SharedString key; + + public override TaskStatus OnUpdate() + { + PlayerPrefs.DeleteKey(key.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + key = ""; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteKey.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteKey.cs.meta new file mode 100644 index 00000000..4f322aea --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteKey.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ed24098bd046f724e90474d47e1677d3 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetFloat.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetFloat.cs new file mode 100644 index 00000000..839980b5 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetFloat.cs @@ -0,0 +1,31 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityPlayerPrefs +{ + [TaskCategory("Basic/PlayerPrefs")] + [TaskDescription("Stores the value with the specified key from the PlayerPrefs.")] + public class GetFloat : Action + { + [Tooltip("The key to store")] + public SharedString key; + [Tooltip("The default value")] + public SharedFloat defaultValue; + [Tooltip("The value retrieved from the PlayerPrefs")] + [RequiredField] + public SharedFloat storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = PlayerPrefs.GetFloat(key.Value, defaultValue.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + key = ""; + defaultValue = 0; + storeResult = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetFloat.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetFloat.cs.meta new file mode 100644 index 00000000..1252e252 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetFloat.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 14752e1987d17d546838a32459045c67 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetInt.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetInt.cs new file mode 100644 index 00000000..3dca7702 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetInt.cs @@ -0,0 +1,31 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityPlayerPrefs +{ + [TaskCategory("Basic/PlayerPrefs")] + [TaskDescription("Stores the value with the specified key from the PlayerPrefs.")] + public class GetInt : Action + { + [Tooltip("The key to store")] + public SharedString key; + [Tooltip("The default value")] + public SharedInt defaultValue; + [Tooltip("The value retrieved from the PlayerPrefs")] + [RequiredField] + public SharedInt storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = PlayerPrefs.GetInt(key.Value, defaultValue.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + key = ""; + defaultValue = 0; + storeResult = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetInt.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetInt.cs.meta new file mode 100644 index 00000000..6e1a400d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetInt.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 66c5c9cfd0fb52344875db0cefc5d6f8 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetString.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetString.cs new file mode 100644 index 00000000..a3d98a97 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetString.cs @@ -0,0 +1,31 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityPlayerPrefs +{ + [TaskCategory("Basic/PlayerPrefs")] + [TaskDescription("Stores the value with the specified key from the PlayerPrefs.")] + public class GetString : Action + { + [Tooltip("The key to store")] + public SharedString key; + [Tooltip("The default value")] + public SharedString defaultValue; + [Tooltip("The value retrieved from the PlayerPrefs")] + [RequiredField] + public SharedString storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = PlayerPrefs.GetString(key.Value, defaultValue.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + key = ""; + defaultValue = ""; + storeResult = ""; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetString.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetString.cs.meta new file mode 100644 index 00000000..155d968b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetString.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 418066da4d19f1742a6435c0ee7aa01b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/HasKey.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/HasKey.cs new file mode 100644 index 00000000..2983fc05 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/HasKey.cs @@ -0,0 +1,22 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityPlayerPrefs +{ + [TaskCategory("Basic/PlayerPrefs")] + [TaskDescription("Retruns success if the specified key exists.")] + public class HasKey : Conditional + { + [Tooltip("The key to check")] + public SharedString key; + + public override TaskStatus OnUpdate() + { + return PlayerPrefs.HasKey(key.Value) ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + key = ""; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/HasKey.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/HasKey.cs.meta new file mode 100644 index 00000000..49883dfe --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/HasKey.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3b16fab74ec9f364f911696814716ca2 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/Save.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/Save.cs new file mode 100644 index 00000000..627fe81a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/Save.cs @@ -0,0 +1,16 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityPlayerPrefs +{ + [TaskCategory("Basic/PlayerPrefs")] + [TaskDescription("Saves the PlayerPrefs.")] + public class Save : Action + { + public override TaskStatus OnUpdate() + { + PlayerPrefs.Save(); + + return TaskStatus.Success; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/Save.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/Save.cs.meta new file mode 100644 index 00000000..a03bd8c4 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/Save.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 898765f1bc90e154e9cab895a814221e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetFloat.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetFloat.cs new file mode 100644 index 00000000..69b578ca --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetFloat.cs @@ -0,0 +1,27 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityPlayerPrefs +{ + [TaskCategory("Basic/PlayerPrefs")] + [TaskDescription("Sets the value with the specified key from the PlayerPrefs.")] + public class SetFloat : Action + { + [Tooltip("The key to store")] + public SharedString key; + [Tooltip("The value to set")] + public SharedFloat value; + + public override TaskStatus OnUpdate() + { + PlayerPrefs.SetFloat(key.Value, value.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + key = ""; + value = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetFloat.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetFloat.cs.meta new file mode 100644 index 00000000..87a00ef2 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetFloat.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 88feec854545b9b428ed714fbebe872f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetInt.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetInt.cs new file mode 100644 index 00000000..3e41760f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetInt.cs @@ -0,0 +1,27 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityPlayerPrefs +{ + [TaskCategory("Basic/PlayerPrefs")] + [TaskDescription("Sets the value with the specified key from the PlayerPrefs.")] + public class SetInt : Action + { + [Tooltip("The key to store")] + public SharedString key; + [Tooltip("The value to set")] + public SharedInt value; + + public override TaskStatus OnUpdate() + { + PlayerPrefs.SetInt(key.Value, value.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + key = ""; + value = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetInt.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetInt.cs.meta new file mode 100644 index 00000000..c9920342 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetInt.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ad23859aa9f9e68468891ba9600b9828 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetString.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetString.cs new file mode 100644 index 00000000..69426c56 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetString.cs @@ -0,0 +1,27 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityPlayerPrefs +{ + [TaskCategory("Basic/PlayerPrefs")] + [TaskDescription("Sets the value with the specified key from the PlayerPrefs.")] + public class SetString : Action + { + [Tooltip("The key to store")] + public SharedString key; + [Tooltip("The value to set")] + public SharedString value; + + public override TaskStatus OnUpdate() + { + PlayerPrefs.SetString(key.Value, value.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + key = ""; + value = ""; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetString.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetString.cs.meta new file mode 100644 index 00000000..bb989dbd --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetString.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 923ae6162a2661e47be9af80a19e48b6 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: -- cgit v1.1-26-g67d0