From 10d751c21ed33d02e41c19bf38030f90dfff6192 Mon Sep 17 00:00:00 2001 From: max Date: Wed, 22 Dec 2021 12:53:49 +0100 Subject: [PATCH] Scriptable Data & Events --- CHANGELOG.md | 5 +- CHANGELOG.md.meta | 7 + Editor/COMPANYNAME.PACKAGENAME.Editor.asmdef | 16 -- Editor/EditorExample.cs | 6 - LICENSE.md | 2 +- LICENSE.md.meta | 7 + README.md | 43 ++- README.md.meta | 7 + Runtime.meta | 8 + Runtime/RuntimeExample.cs | 5 - Runtime/ScriptableData.cs | 255 ++++++++++++++++++ Runtime/ScriptableData.cs.meta | 11 + Runtime/ScriptableEvent.cs | 56 ++++ Runtime/ScriptableEvent.cs.meta | 11 + ...mdef => VertexColor.ScriptableData.asmdef} | 6 +- .../VertexColor.ScriptableData.asmdef.meta | 7 + Samples~/BaseTypes.meta | 8 + Samples~/BaseTypes/Data.meta | 8 + Samples~/BaseTypes/Data/SDBool.cs | 7 + Samples~/BaseTypes/Data/SDBool.cs.meta | 11 + Samples~/BaseTypes/Data/SDFloat.cs | 7 + Samples~/BaseTypes/Data/SDFloat.cs.meta | 11 + Samples~/BaseTypes/Data/SDGameObject.cs | 7 + Samples~/BaseTypes/Data/SDGameObject.cs.meta | 11 + Samples~/BaseTypes/Data/SDInt.cs | 7 + Samples~/BaseTypes/Data/SDInt.cs.meta | 11 + Samples~/BaseTypes/Data/SDQuaternion.cs | 7 + Samples~/BaseTypes/Data/SDQuaternion.cs.meta | 11 + Samples~/BaseTypes/Data/SDTransform.cs | 7 + Samples~/BaseTypes/Data/SDTransform.cs.meta | 11 + Samples~/BaseTypes/Data/SDVector3.cs | 7 + Samples~/BaseTypes/Data/SDVector3.cs.meta | 11 + Samples~/BaseTypes/Events.meta | 8 + Samples~/BaseTypes/Events/SEBool.cs | 7 + Samples~/BaseTypes/Events/SEBool.cs.meta | 11 + Samples~/BaseTypes/Events/SEFloat.cs | 7 + Samples~/BaseTypes/Events/SEFloat.cs.meta | 11 + Samples~/BaseTypes/Events/SEGameObject.cs | 7 + .../BaseTypes/Events/SEGameObject.cs.meta | 11 + Samples~/BaseTypes/Events/SEInt.cs | 7 + Samples~/BaseTypes/Events/SEInt.cs.meta | 11 + Samples~/BaseTypes/Events/SEQuaternion.cs | 7 + .../BaseTypes/Events/SEQuaternion.cs.meta | 11 + Samples~/BaseTypes/Events/SETransform.cs | 7 + Samples~/BaseTypes/Events/SETransform.cs.meta | 11 + Samples~/BaseTypes/Events/SEVector3.cs | 7 + Samples~/BaseTypes/Events/SEVector3.cs.meta | 11 + Samples~/BaseTypes/Example.md | 24 ++ Samples~/BaseTypes/Example.md.meta | 7 + Samples~/Example1/Example.txt | 2 - THIRD PARTY NOTICES.md.meta | 7 + ...OMPANYNAME.PACKAGENAME.Editor.Tests.asmdef | 20 -- Tests/Editor/TestEditorExample.cs | 26 -- .../COMPANYNAME.PACKAGENAME.Tests.asmdef | 17 -- Tests/Runtime/TestRuntimeExample.cs | 25 -- package.json | 29 +- package.json.meta | 7 + 57 files changed, 746 insertions(+), 146 deletions(-) create mode 100644 CHANGELOG.md.meta delete mode 100644 Editor/COMPANYNAME.PACKAGENAME.Editor.asmdef delete mode 100644 Editor/EditorExample.cs create mode 100644 LICENSE.md.meta create mode 100644 README.md.meta create mode 100644 Runtime.meta delete mode 100644 Runtime/RuntimeExample.cs create mode 100644 Runtime/ScriptableData.cs create mode 100644 Runtime/ScriptableData.cs.meta create mode 100644 Runtime/ScriptableEvent.cs create mode 100644 Runtime/ScriptableEvent.cs.meta rename Runtime/{COMPANYNAME.PACKAGENAME.asmdef => VertexColor.ScriptableData.asmdef} (62%) create mode 100644 Runtime/VertexColor.ScriptableData.asmdef.meta create mode 100644 Samples~/BaseTypes.meta create mode 100644 Samples~/BaseTypes/Data.meta create mode 100644 Samples~/BaseTypes/Data/SDBool.cs create mode 100644 Samples~/BaseTypes/Data/SDBool.cs.meta create mode 100644 Samples~/BaseTypes/Data/SDFloat.cs create mode 100644 Samples~/BaseTypes/Data/SDFloat.cs.meta create mode 100644 Samples~/BaseTypes/Data/SDGameObject.cs create mode 100644 Samples~/BaseTypes/Data/SDGameObject.cs.meta create mode 100644 Samples~/BaseTypes/Data/SDInt.cs create mode 100644 Samples~/BaseTypes/Data/SDInt.cs.meta create mode 100644 Samples~/BaseTypes/Data/SDQuaternion.cs create mode 100644 Samples~/BaseTypes/Data/SDQuaternion.cs.meta create mode 100644 Samples~/BaseTypes/Data/SDTransform.cs create mode 100644 Samples~/BaseTypes/Data/SDTransform.cs.meta create mode 100644 Samples~/BaseTypes/Data/SDVector3.cs create mode 100644 Samples~/BaseTypes/Data/SDVector3.cs.meta create mode 100644 Samples~/BaseTypes/Events.meta create mode 100644 Samples~/BaseTypes/Events/SEBool.cs create mode 100644 Samples~/BaseTypes/Events/SEBool.cs.meta create mode 100644 Samples~/BaseTypes/Events/SEFloat.cs create mode 100644 Samples~/BaseTypes/Events/SEFloat.cs.meta create mode 100644 Samples~/BaseTypes/Events/SEGameObject.cs create mode 100644 Samples~/BaseTypes/Events/SEGameObject.cs.meta create mode 100644 Samples~/BaseTypes/Events/SEInt.cs create mode 100644 Samples~/BaseTypes/Events/SEInt.cs.meta create mode 100644 Samples~/BaseTypes/Events/SEQuaternion.cs create mode 100644 Samples~/BaseTypes/Events/SEQuaternion.cs.meta create mode 100644 Samples~/BaseTypes/Events/SETransform.cs create mode 100644 Samples~/BaseTypes/Events/SETransform.cs.meta create mode 100644 Samples~/BaseTypes/Events/SEVector3.cs create mode 100644 Samples~/BaseTypes/Events/SEVector3.cs.meta create mode 100644 Samples~/BaseTypes/Example.md create mode 100644 Samples~/BaseTypes/Example.md.meta delete mode 100644 Samples~/Example1/Example.txt create mode 100644 THIRD PARTY NOTICES.md.meta delete mode 100644 Tests/Editor/COMPANYNAME.PACKAGENAME.Editor.Tests.asmdef delete mode 100644 Tests/Editor/TestEditorExample.cs delete mode 100644 Tests/Runtime/COMPANYNAME.PACKAGENAME.Tests.asmdef delete mode 100644 Tests/Runtime/TestRuntimeExample.cs create mode 100644 package.json.meta diff --git a/CHANGELOG.md b/CHANGELOG.md index 2da9e92..9509232 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,5 @@ # Change Log: -## 0.1.0 +## 1.0.0 -- Start Project: - - ... +- Base project. diff --git a/CHANGELOG.md.meta b/CHANGELOG.md.meta new file mode 100644 index 0000000..8c6363e --- /dev/null +++ b/CHANGELOG.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3d077b5779f81994097715ac0982a56e +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/COMPANYNAME.PACKAGENAME.Editor.asmdef b/Editor/COMPANYNAME.PACKAGENAME.Editor.asmdef deleted file mode 100644 index 2c9e8f1..0000000 --- a/Editor/COMPANYNAME.PACKAGENAME.Editor.asmdef +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "COMPANYNAME.PACKAGENAME.Editor", - "references": [ - "COMPANYNAME.PACKAGENAME" - ], - "includePlatforms": [ - "Editor" - ], - "excludePlatforms": [], - "allowUnsafeCode": false, - "overrideReferences": false, - "precompiledReferences": [], - "autoReferenced": true, - "defineConstraints": [], - "versionDefines": [] -} \ No newline at end of file diff --git a/Editor/EditorExample.cs b/Editor/EditorExample.cs deleted file mode 100644 index 7bf43e5..0000000 --- a/Editor/EditorExample.cs +++ /dev/null @@ -1,6 +0,0 @@ -using UnityEngine; -using UnityEditor; - -namespace COMPANYNAME.PACKAGENAME.Editor -{ -} \ No newline at end of file diff --git a/LICENSE.md b/LICENSE.md index b8a0b36..eeec6c1 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 COMPANYNAME +Copyright (c) 2021 Max Kruf Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/LICENSE.md.meta b/LICENSE.md.meta new file mode 100644 index 0000000..32708e9 --- /dev/null +++ b/LICENSE.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3f1cf957ba3177244ae054de6f577495 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/README.md b/README.md index d1a57a1..d88f444 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,43 @@ -# [COMPANYNAME]() - PACKAGENAME - -Description. +# ScriptableData +## Data +ScriptableData stores runtime data to be accessed by scripts that reference the ScriptableObject. It has a OnValueChangedEvent to subscribe when data changes. +With this workflow you can remove dependencies and increase flexibility. +### Extendable Data: +```C# +public class ScriptableData : ScriptableObject {} +public class ScriptableData : ScriptableObject {} +public class ScriptableData : ScriptableObject {} +public class ScriptableData : ScriptableObject {} +``` +### Example: +```C# +[CreateAssetMenu(menuName = "ScriptableData/Data/Vector3", order = 147)] +public class SDVector3 : ScriptableData {} +``` +## Events +ScriptableEvent does not contain any runtime data but can be used to send events (with data) around. +### Base Event +```C# +[CreateAssetMenu(menuName = "ScriptableData/Event/Event", order = 147)] +public class ScriptableEvent : ScriptableObject {} +``` +### Extendable Events: +```C# +public class ScriptableEvent : ScriptableObject {} +public class ScriptableEvent : ScriptableObject {} +public class ScriptableEvent : ScriptableObject {} +public class ScriptableEvent : ScriptableObject {} +``` +### Example: +```C# +[CreateAssetMenu(menuName = "ScriptableData/Event/Vector3", order = 147)] +public class SEVector3 : ScriptableEvent {} +``` ## Install - [Installing from a Git URL](https://docs.unity3d.com/Manual/upm-ui-giturl.html) -[Unitypackage](https://github.com/COMPANYNAME/PACKAGENAME/releases) - +[Unitypackage](https://github.com/maxartz15/ScriptableData/releases) ## LICENSE - Overall package is licensed under [MIT](/LICENSE.md), unless otherwise noted in the [3rd party licenses](/THIRD%20PARTY%20NOTICES.md) file and/or source code. \ No newline at end of file diff --git a/README.md.meta b/README.md.meta new file mode 100644 index 0000000..ba4a002 --- /dev/null +++ b/README.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8d70691f088be874a969b026fa3eb74b +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime.meta b/Runtime.meta new file mode 100644 index 0000000..5f3e8ff --- /dev/null +++ b/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2058d177a0fc3c04696e56c9c3ea6677 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/RuntimeExample.cs b/Runtime/RuntimeExample.cs deleted file mode 100644 index 9315689..0000000 --- a/Runtime/RuntimeExample.cs +++ /dev/null @@ -1,5 +0,0 @@ -using UnityEngine; - -namespace COMPANYNAME.PACKAGENAME -{ -} \ No newline at end of file diff --git a/Runtime/ScriptableData.cs b/Runtime/ScriptableData.cs new file mode 100644 index 0000000..9d6d95b --- /dev/null +++ b/Runtime/ScriptableData.cs @@ -0,0 +1,255 @@ +using System; +using UnityEngine; + +namespace ScriptableData +{ + public class ScriptableData : ScriptableObject + { + public event Action OnValueChangedEvent; + + private T0 _value; + public T0 Value + { + get + { + return _value; + } + set + { + _value = value; + OnValueChangedEvent?.Invoke(_value); + } + } + + public void SetWithoutNotify(T0 value) + { + _value = value; + } + + public void Invoke(T0 value) + { + _value = value; + OnValueChangedEvent?.Invoke(value); + } + } + + public class ScriptableData : ScriptableObject + { + public event Action OnValueChangedEvent; + + private T0 _value; + public T0 Value + { + get + { + return _value; + } + set + { + _value = value; + OnValueChangedEvent?.Invoke(_value, _value1); + } + } + + private T1 _value1; + public T1 Value1 + { + get + { + return _value1; + } + set + { + _value1 = value; + OnValueChangedEvent?.Invoke(_value, _value1); + } + } + + public void SetWithoutNotify(T0 value) + { + _value = value; + } + + public void SetWithoutNotify(T0 value, T1 value1) + { + _value = value; + _value1 = value1; + } + + public void Invoke(T0 value, T1 value1) + { + Value = value; + Value1 = value1; + OnValueChangedEvent?.Invoke(value, value1); + } + } + + public class ScriptableData : ScriptableObject + { + public event Action OnValueChangedEvent; + + private T0 _value; + public T0 Value + { + get + { + return _value; + } + set + { + _value = value; + OnValueChangedEvent?.Invoke(_value, _value1, _value2); + } + } + + private T1 _value1; + public T1 Value1 + { + get + { + return _value1; + } + set + { + _value1 = value; + OnValueChangedEvent?.Invoke(_value, _value1, _value2); + } + } + + private T2 _value2; + public T2 Value2 + { + get + { + return _value2; + } + set + { + _value2 = value; + OnValueChangedEvent?.Invoke(_value, _value1, _value2); + } + } + + public void SetWithoutNotify(T0 value) + { + _value = value; + } + + public void SetWithoutNotify(T0 value, T1 value1) + { + _value = value; + _value1 = value1; + } + + public void SetWithoutNotify(T0 value, T1 value1, T2 value2) + { + _value = value; + _value1 = value1; + _value2 = value2; + } + + public void Invoke(T0 value, T1 value1, T2 value2) + { + Value = value; + Value1 = value1; + Value2 = value2; + OnValueChangedEvent?.Invoke(value, value1, value2); + } + } + + public class ScriptableData : ScriptableObject + { + public event Action OnValueChangedEvent; + + private T0 _value; + public T0 Value + { + get + { + return _value; + } + set + { + _value = value; + OnValueChangedEvent?.Invoke(_value, _value1, _value2, _value3); + } + } + + private T1 _value1; + public T1 Value1 + { + get + { + return _value1; + } + set + { + _value1 = value; + OnValueChangedEvent?.Invoke(_value, _value1, _value2, _value3); + } + } + + private T2 _value2; + public T2 Value2 + { + get + { + return _value2; + } + set + { + _value2 = value; + OnValueChangedEvent?.Invoke(_value, _value1, _value2, _value3); + } + } + + private T3 _value3; + public T3 Value3 + { + get + { + return _value3; + } + set + { + _value3 = value; + OnValueChangedEvent?.Invoke(_value, _value1, _value2, _value3); + } + } + + public void SetWithoutNotify(T0 value) + { + _value = value; + } + + public void SetWithoutNotify(T0 value, T1 value1) + { + _value = value; + _value1 = value1; + } + + public void SetWithoutNotify(T0 value, T1 value1, T2 value2) + { + _value = value; + _value1 = value1; + _value2 = value2; + } + + public void SetWithoutNotify(T0 value, T1 value1, T2 value2, T3 value3) + { + _value = value; + _value1 = value1; + _value2 = value2; + _value3 = value3; + } + + public void Invoke(T0 value, T1 value1, T2 value2, T3 value3) + { + Value = value; + Value1 = value1; + Value2 = value2; + Value3 = value3; + OnValueChangedEvent?.Invoke(value, value1, value2, value3); + } + } +} \ No newline at end of file diff --git a/Runtime/ScriptableData.cs.meta b/Runtime/ScriptableData.cs.meta new file mode 100644 index 0000000..c343fe2 --- /dev/null +++ b/Runtime/ScriptableData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: db3264973431f63458697af52994bf57 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/ScriptableEvent.cs b/Runtime/ScriptableEvent.cs new file mode 100644 index 0000000..579c94c --- /dev/null +++ b/Runtime/ScriptableEvent.cs @@ -0,0 +1,56 @@ +using System; +using UnityEngine; + +namespace ScriptableData +{ + [CreateAssetMenu(menuName = "ScriptableData/Event/Event", order = 147)] + public class ScriptableEvent : ScriptableObject + { + public event Action OnScriptableEvent; + + public void Invoke() + { + OnScriptableEvent?.Invoke(); + } + } + + public class ScriptableEvent : ScriptableObject + { + public event Action OnScriptableEvent; + + public void Invoke(T0 value) + { + OnScriptableEvent?.Invoke(value); + } + } + + public class ScriptableEvent : ScriptableObject + { + public event Action OnScriptableEvent; + + public void Invoke(T0 value, T1 value1) + { + OnScriptableEvent?.Invoke(value, value1); + } + } + + public class ScriptableEvent : ScriptableObject + { + public event Action OnScriptableEvent; + + public void Invoke(T0 value, T1 value1, T2 value2) + { + OnScriptableEvent?.Invoke(value, value1, value2); + } + } + + public class ScriptableEvent : ScriptableObject + { + public event Action OnScriptableEvent; + + public void Invoke(T0 value, T1 value1, T2 value2, T3 value3) + { + OnScriptableEvent?.Invoke(value, value1, value2, value3); + } + } +} \ No newline at end of file diff --git a/Runtime/ScriptableEvent.cs.meta b/Runtime/ScriptableEvent.cs.meta new file mode 100644 index 0000000..c3a5921 --- /dev/null +++ b/Runtime/ScriptableEvent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 19a385034782e5145827449109c29d63 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/COMPANYNAME.PACKAGENAME.asmdef b/Runtime/VertexColor.ScriptableData.asmdef similarity index 62% rename from Runtime/COMPANYNAME.PACKAGENAME.asmdef rename to Runtime/VertexColor.ScriptableData.asmdef index 39855df..5e6010f 100644 --- a/Runtime/COMPANYNAME.PACKAGENAME.asmdef +++ b/Runtime/VertexColor.ScriptableData.asmdef @@ -1,5 +1,6 @@ { - "name": "COMPANYNAME.PACKAGENAME", + "name": "VertexColor.ScriptableData", + "rootNamespace": "ScriptableData", "references": [], "includePlatforms": [], "excludePlatforms": [], @@ -8,5 +9,6 @@ "precompiledReferences": [], "autoReferenced": true, "defineConstraints": [], - "versionDefines": [] + "versionDefines": [], + "noEngineReferences": false } \ No newline at end of file diff --git a/Runtime/VertexColor.ScriptableData.asmdef.meta b/Runtime/VertexColor.ScriptableData.asmdef.meta new file mode 100644 index 0000000..c67991d --- /dev/null +++ b/Runtime/VertexColor.ScriptableData.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: bd2fa452e376b7e4e8356eed741e5eea +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Samples~/BaseTypes.meta b/Samples~/BaseTypes.meta new file mode 100644 index 0000000..1396384 --- /dev/null +++ b/Samples~/BaseTypes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 16f93068e5f4e454f9c88232262f36a9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Samples~/BaseTypes/Data.meta b/Samples~/BaseTypes/Data.meta new file mode 100644 index 0000000..5ac313a --- /dev/null +++ b/Samples~/BaseTypes/Data.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c8cbf90db89396a41b51cff454c98560 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Samples~/BaseTypes/Data/SDBool.cs b/Samples~/BaseTypes/Data/SDBool.cs new file mode 100644 index 0000000..cb54a52 --- /dev/null +++ b/Samples~/BaseTypes/Data/SDBool.cs @@ -0,0 +1,7 @@ +using UnityEngine; + +namespace ScriptableData +{ + [CreateAssetMenu(menuName = "ScriptableData/Data/Bool", order = 146)] + public class SDBool : ScriptableData { } +} \ No newline at end of file diff --git a/Samples~/BaseTypes/Data/SDBool.cs.meta b/Samples~/BaseTypes/Data/SDBool.cs.meta new file mode 100644 index 0000000..e37f689 --- /dev/null +++ b/Samples~/BaseTypes/Data/SDBool.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4ead1cfb6b7922e40b6a4caa0efbae67 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Samples~/BaseTypes/Data/SDFloat.cs b/Samples~/BaseTypes/Data/SDFloat.cs new file mode 100644 index 0000000..117cf26 --- /dev/null +++ b/Samples~/BaseTypes/Data/SDFloat.cs @@ -0,0 +1,7 @@ +using UnityEngine; + +namespace ScriptableData +{ + [CreateAssetMenu(menuName = "ScriptableData/Data/Float", order = 146)] + public class SDFloat : ScriptableData { } +} \ No newline at end of file diff --git a/Samples~/BaseTypes/Data/SDFloat.cs.meta b/Samples~/BaseTypes/Data/SDFloat.cs.meta new file mode 100644 index 0000000..55b2c04 --- /dev/null +++ b/Samples~/BaseTypes/Data/SDFloat.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 917e540fe8be80f4f9274e1e998d9329 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Samples~/BaseTypes/Data/SDGameObject.cs b/Samples~/BaseTypes/Data/SDGameObject.cs new file mode 100644 index 0000000..922de06 --- /dev/null +++ b/Samples~/BaseTypes/Data/SDGameObject.cs @@ -0,0 +1,7 @@ +using UnityEngine; + +namespace ScriptableData +{ + [CreateAssetMenu(menuName = "ScriptableData/Data/GameObject", order = 146)] + public class SDGameObject : ScriptableData { } +} \ No newline at end of file diff --git a/Samples~/BaseTypes/Data/SDGameObject.cs.meta b/Samples~/BaseTypes/Data/SDGameObject.cs.meta new file mode 100644 index 0000000..298e68a --- /dev/null +++ b/Samples~/BaseTypes/Data/SDGameObject.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f6dc28fb2198d394fa5a174cfba52560 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Samples~/BaseTypes/Data/SDInt.cs b/Samples~/BaseTypes/Data/SDInt.cs new file mode 100644 index 0000000..2152578 --- /dev/null +++ b/Samples~/BaseTypes/Data/SDInt.cs @@ -0,0 +1,7 @@ +using UnityEngine; + +namespace ScriptableData +{ + [CreateAssetMenu(menuName = "ScriptableData/Data/Int", order = 146)] + public class SDInt : ScriptableData { } +} \ No newline at end of file diff --git a/Samples~/BaseTypes/Data/SDInt.cs.meta b/Samples~/BaseTypes/Data/SDInt.cs.meta new file mode 100644 index 0000000..69d65fd --- /dev/null +++ b/Samples~/BaseTypes/Data/SDInt.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a77d994ca5c579449ba30e60316b47e1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Samples~/BaseTypes/Data/SDQuaternion.cs b/Samples~/BaseTypes/Data/SDQuaternion.cs new file mode 100644 index 0000000..d7fe346 --- /dev/null +++ b/Samples~/BaseTypes/Data/SDQuaternion.cs @@ -0,0 +1,7 @@ +using UnityEngine; + +namespace ScriptableData +{ + [CreateAssetMenu(menuName = "ScriptableData/Data/Quaternion", order = 146)] + public class SDQuaternion : ScriptableData { } +} \ No newline at end of file diff --git a/Samples~/BaseTypes/Data/SDQuaternion.cs.meta b/Samples~/BaseTypes/Data/SDQuaternion.cs.meta new file mode 100644 index 0000000..31c7d4e --- /dev/null +++ b/Samples~/BaseTypes/Data/SDQuaternion.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e9a8c28baf804d34195d0c31032dbabd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Samples~/BaseTypes/Data/SDTransform.cs b/Samples~/BaseTypes/Data/SDTransform.cs new file mode 100644 index 0000000..73cc0e1 --- /dev/null +++ b/Samples~/BaseTypes/Data/SDTransform.cs @@ -0,0 +1,7 @@ +using UnityEngine; + +namespace ScriptableData +{ + [CreateAssetMenu(menuName = "ScriptableData/Data/Transform", order = 146)] + public class SDQTransform : ScriptableData { } +} \ No newline at end of file diff --git a/Samples~/BaseTypes/Data/SDTransform.cs.meta b/Samples~/BaseTypes/Data/SDTransform.cs.meta new file mode 100644 index 0000000..fdb8bee --- /dev/null +++ b/Samples~/BaseTypes/Data/SDTransform.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8ff1e93cfb8df9443806844756073a85 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Samples~/BaseTypes/Data/SDVector3.cs b/Samples~/BaseTypes/Data/SDVector3.cs new file mode 100644 index 0000000..99e1cfa --- /dev/null +++ b/Samples~/BaseTypes/Data/SDVector3.cs @@ -0,0 +1,7 @@ +using UnityEngine; + +namespace ScriptableData +{ + [CreateAssetMenu(menuName = "ScriptableData/Data/SDVector3", order = 146)] + public class SDVector3 : ScriptableData { } +} \ No newline at end of file diff --git a/Samples~/BaseTypes/Data/SDVector3.cs.meta b/Samples~/BaseTypes/Data/SDVector3.cs.meta new file mode 100644 index 0000000..c90377a --- /dev/null +++ b/Samples~/BaseTypes/Data/SDVector3.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 136f21e7e95b1e342aa7fbf8570b4fd0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Samples~/BaseTypes/Events.meta b/Samples~/BaseTypes/Events.meta new file mode 100644 index 0000000..f45d113 --- /dev/null +++ b/Samples~/BaseTypes/Events.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: aab580a8fb0ddf4419b71ee1258bea67 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Samples~/BaseTypes/Events/SEBool.cs b/Samples~/BaseTypes/Events/SEBool.cs new file mode 100644 index 0000000..ad82192 --- /dev/null +++ b/Samples~/BaseTypes/Events/SEBool.cs @@ -0,0 +1,7 @@ +using UnityEngine; + +namespace ScriptableData +{ + [CreateAssetMenu(menuName = "ScriptableData/Event/Bool", order = 147)] + public class SEBool : ScriptableEvent { } +} \ No newline at end of file diff --git a/Samples~/BaseTypes/Events/SEBool.cs.meta b/Samples~/BaseTypes/Events/SEBool.cs.meta new file mode 100644 index 0000000..ef081ec --- /dev/null +++ b/Samples~/BaseTypes/Events/SEBool.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a4aec005e72ed5c4ea8a5fd1e56d47da +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Samples~/BaseTypes/Events/SEFloat.cs b/Samples~/BaseTypes/Events/SEFloat.cs new file mode 100644 index 0000000..c5167de --- /dev/null +++ b/Samples~/BaseTypes/Events/SEFloat.cs @@ -0,0 +1,7 @@ +using UnityEngine; + +namespace ScriptableData +{ + [CreateAssetMenu(menuName = "ScriptableData/Event/Float", order = 147)] + public class SEFloat : ScriptableEvent { } +} \ No newline at end of file diff --git a/Samples~/BaseTypes/Events/SEFloat.cs.meta b/Samples~/BaseTypes/Events/SEFloat.cs.meta new file mode 100644 index 0000000..73d11da --- /dev/null +++ b/Samples~/BaseTypes/Events/SEFloat.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2d1ce65d6edd49e4c994ca41da2916c9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Samples~/BaseTypes/Events/SEGameObject.cs b/Samples~/BaseTypes/Events/SEGameObject.cs new file mode 100644 index 0000000..a2ab99e --- /dev/null +++ b/Samples~/BaseTypes/Events/SEGameObject.cs @@ -0,0 +1,7 @@ +using UnityEngine; + +namespace ScriptableData +{ + [CreateAssetMenu(menuName = "ScriptableData/Event/GameObject", order = 147)] + public class SEGameObject : ScriptableEvent { } +} \ No newline at end of file diff --git a/Samples~/BaseTypes/Events/SEGameObject.cs.meta b/Samples~/BaseTypes/Events/SEGameObject.cs.meta new file mode 100644 index 0000000..2514d6e --- /dev/null +++ b/Samples~/BaseTypes/Events/SEGameObject.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 727a58c71e459eb42b6acd8b499b05d0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Samples~/BaseTypes/Events/SEInt.cs b/Samples~/BaseTypes/Events/SEInt.cs new file mode 100644 index 0000000..b36e1ba --- /dev/null +++ b/Samples~/BaseTypes/Events/SEInt.cs @@ -0,0 +1,7 @@ +using UnityEngine; + +namespace ScriptableData +{ + [CreateAssetMenu(menuName = "ScriptableData/Event/Int", order = 147)] + public class SEInt : ScriptableEvent { } +} \ No newline at end of file diff --git a/Samples~/BaseTypes/Events/SEInt.cs.meta b/Samples~/BaseTypes/Events/SEInt.cs.meta new file mode 100644 index 0000000..bce1292 --- /dev/null +++ b/Samples~/BaseTypes/Events/SEInt.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8a0c983892a2cdb4393e8b8ba67b458e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Samples~/BaseTypes/Events/SEQuaternion.cs b/Samples~/BaseTypes/Events/SEQuaternion.cs new file mode 100644 index 0000000..70723ce --- /dev/null +++ b/Samples~/BaseTypes/Events/SEQuaternion.cs @@ -0,0 +1,7 @@ +using UnityEngine; + +namespace ScriptableData +{ + [CreateAssetMenu(menuName = "ScriptableData/Event/Quaternion", order = 147)] + public class SEQuaternion : ScriptableEvent { } +} \ No newline at end of file diff --git a/Samples~/BaseTypes/Events/SEQuaternion.cs.meta b/Samples~/BaseTypes/Events/SEQuaternion.cs.meta new file mode 100644 index 0000000..005a3b6 --- /dev/null +++ b/Samples~/BaseTypes/Events/SEQuaternion.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7493b17fc08fc674d904c9cfc5370e7e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Samples~/BaseTypes/Events/SETransform.cs b/Samples~/BaseTypes/Events/SETransform.cs new file mode 100644 index 0000000..154b565 --- /dev/null +++ b/Samples~/BaseTypes/Events/SETransform.cs @@ -0,0 +1,7 @@ +using UnityEngine; + +namespace ScriptableData +{ + [CreateAssetMenu(menuName = "ScriptableData/Event/Transform", order = 147)] + public class SETransform : ScriptableEvent { } +} \ No newline at end of file diff --git a/Samples~/BaseTypes/Events/SETransform.cs.meta b/Samples~/BaseTypes/Events/SETransform.cs.meta new file mode 100644 index 0000000..3a1d231 --- /dev/null +++ b/Samples~/BaseTypes/Events/SETransform.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8945c026d7d76de4892a766db77a4b6e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Samples~/BaseTypes/Events/SEVector3.cs b/Samples~/BaseTypes/Events/SEVector3.cs new file mode 100644 index 0000000..c1afd7f --- /dev/null +++ b/Samples~/BaseTypes/Events/SEVector3.cs @@ -0,0 +1,7 @@ +using UnityEngine; + +namespace ScriptableData +{ + [CreateAssetMenu(menuName = "ScriptableData/Event/Vector3", order = 147)] + public class SEVector3 : ScriptableEvent { } +} \ No newline at end of file diff --git a/Samples~/BaseTypes/Events/SEVector3.cs.meta b/Samples~/BaseTypes/Events/SEVector3.cs.meta new file mode 100644 index 0000000..a8cb9a1 --- /dev/null +++ b/Samples~/BaseTypes/Events/SEVector3.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 53c4d0f2b581bcd4aad2fd9f5dbb05d8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Samples~/BaseTypes/Example.md b/Samples~/BaseTypes/Example.md new file mode 100644 index 0000000..21e5f97 --- /dev/null +++ b/Samples~/BaseTypes/Example.md @@ -0,0 +1,24 @@ +Types can be anything: classes, structs etc. +Replace {TYPE} with your type. + +Data: +```C# +using UnityEngine; + +namespace ScriptableData +{ + [CreateAssetMenu(menuName = "ScriptableData/Data/{TYPE}", order = 146)] + public class SD{TYPE} : ScriptableData<{TYPE}> { } +} +``` + +Events: +```C# +using UnityEngine; + +namespace ScriptableData +{ + [CreateAssetMenu(menuName = "ScriptableData/Event/{TYPE}", order = 147)] + public class SE{TYPE} : ScriptableEvent<{TYPE}> {} +} +``` \ No newline at end of file diff --git a/Samples~/BaseTypes/Example.md.meta b/Samples~/BaseTypes/Example.md.meta new file mode 100644 index 0000000..6656361 --- /dev/null +++ b/Samples~/BaseTypes/Example.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f5d5f3d545025a4479b8026b61e29c3e +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Samples~/Example1/Example.txt b/Samples~/Example1/Example.txt deleted file mode 100644 index d505ef0..0000000 --- a/Samples~/Example1/Example.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is just a template package with a template sample folder structure. -Import of this example file is successful! diff --git a/THIRD PARTY NOTICES.md.meta b/THIRD PARTY NOTICES.md.meta new file mode 100644 index 0000000..e76e254 --- /dev/null +++ b/THIRD PARTY NOTICES.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 79a45fd43a13f2b4e9e0bf907986bdb6 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Editor/COMPANYNAME.PACKAGENAME.Editor.Tests.asmdef b/Tests/Editor/COMPANYNAME.PACKAGENAME.Editor.Tests.asmdef deleted file mode 100644 index ef6c99d..0000000 --- a/Tests/Editor/COMPANYNAME.PACKAGENAME.Editor.Tests.asmdef +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "COMPANYNAME.PACKAGENAME.Editor.Tests", - "references": [ - "COMPANYNAME.PACKAGENAME", - "COMPANYNAME.PACKAGENAME.Editor" - ], - "includePlatforms": [ - "Editor" - ], - "excludePlatforms": [], - "allowUnsafeCode": false, - "overrideReferences": false, - "precompiledReferences": [], - "autoReferenced": true, - "defineConstraints": [], - "versionDefines": [], - "optionalUnityReferences": [ - "TestAssemblies" - ] -} \ No newline at end of file diff --git a/Tests/Editor/TestEditorExample.cs b/Tests/Editor/TestEditorExample.cs deleted file mode 100644 index caf7bbb..0000000 --- a/Tests/Editor/TestEditorExample.cs +++ /dev/null @@ -1,26 +0,0 @@ -using UnityEngine; -using UnityEngine.TestTools; -using UnityEditor; -using System.Collections; -using System.Collections.Generic; -using NUnit.Framework; - -namespace COMPANYNAME.PACKAGENAME.Editor.Tests -{ - public class TestEditorExample - { - [Test] - public void TestEditorExampleSimplePasses() - { - // Use the Assert class to test conditions - } - - [UnityTest] - public IEnumerator TestEditorExampleWithEnumeratorPasses() - { - // Use the Assert class to test conditions. - // Use yield to skip a frame. - yield return null; - } - } -} \ No newline at end of file diff --git a/Tests/Runtime/COMPANYNAME.PACKAGENAME.Tests.asmdef b/Tests/Runtime/COMPANYNAME.PACKAGENAME.Tests.asmdef deleted file mode 100644 index d6c0cd3..0000000 --- a/Tests/Runtime/COMPANYNAME.PACKAGENAME.Tests.asmdef +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "COMPANYNAME.PACKAGENAME.Tests", - "references": [ - "COMPANYNAME.PACKAGENAME" - ], - "includePlatforms": [], - "excludePlatforms": [], - "allowUnsafeCode": false, - "overrideReferences": false, - "precompiledReferences": [], - "autoReferenced": true, - "defineConstraints": [], - "versionDefines": [], - "optionalUnityReferences": [ - "TestAssemblies" - ] -} \ No newline at end of file diff --git a/Tests/Runtime/TestRuntimeExample.cs b/Tests/Runtime/TestRuntimeExample.cs deleted file mode 100644 index bb62108..0000000 --- a/Tests/Runtime/TestRuntimeExample.cs +++ /dev/null @@ -1,25 +0,0 @@ -using UnityEngine; -using UnityEngine.TestTools; -using System.Collections; -using System.Collections.Generic; -using NUnit.Framework; - -namespace COMPANYNAME.PACKAGENAME.Tests -{ - public class TestRuntimeExample - { - [Test] - public void TestRuntimeExampleSimplePasses() - { - // Use the Assert class to test conditions - } - - [UnityTest] - public IEnumerator TestRuntimeExampleEnumeratorPasses() - { - // Use the Assert class to test conditions. - // Use yield to skip a frame. - yield return null; - } - } -} diff --git a/package.json b/package.json index 5c6f7f8..02b672e 100644 --- a/package.json +++ b/package.json @@ -1,30 +1,27 @@ { - "name": "com.COMPANYNAME.PACKAGENAME", - "displayName": "Template Unity Package", - "version": "0.1.0", - "unity": "2019.3", - "unityRelease": "7f1", - "description": "This is a template package, used as a basis to build a bigger one.", + "name": "com.vertexcolor.scriptabledata", + "displayName": "ScriptableData", + "version": "1.0.0", + "unity": "2019.1", + "description": "ScriptableData code base for ScriptableObject workflow.", "category": "Tool", - "type": "tool", + "type": "library", "license": "MIT", "author": { "name": "Max Kruf", "email": "info@maxartz15.com", "url": "https://www.maxartz15.com" }, - "dependencies": { - "com.maxartz15.package1": "0.1.0" - }, "keywords": [ - "COMPANYNAME", - "PACKAGENAME" + "ScriptableObject", + "ScriptableData", + "ScriptableEvent" ], "samples": [ { - "displayName": "Example 1", - "description": "This sample is just an example", - "path": "Samples~/Example1" + "displayName": "BaseTypes", + "description": "ScriptableData base types", + "path": "Samples~/BaseTypes" } ] -} +} \ No newline at end of file diff --git a/package.json.meta b/package.json.meta new file mode 100644 index 0000000..dac92c0 --- /dev/null +++ b/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f48ddd375aee7dd459a643aed1951997 +PackageManifestImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: