From f5d6ff1fc9086aaf7b0535884cee116c44195871 Mon Sep 17 00:00:00 2001 From: Ken Schaefer Date: Thu, 16 Jan 2020 10:15:23 -0600 Subject: [PATCH] Added the Architecture asset into the project. This asset is based on the Unite 2017 session. --- Assets/Architecture.meta | 8 ++ Assets/Architecture/Enums.meta | 8 ++ Assets/Architecture/Enums/EnumValue.cs | 15 ++++ Assets/Architecture/Enums/EnumValue.cs.meta | 11 +++ Assets/Architecture/Events.meta | 8 ++ Assets/Architecture/Events/Editor.meta | 8 ++ .../Architecture/Events/Editor/EventEditor.cs | 20 +++++ .../Events/Editor/EventEditor.cs.meta | 12 +++ Assets/Architecture/Events/GameEvent.cs | 48 ++++++++++++ Assets/Architecture/Events/GameEvent.cs.meta | 11 +++ .../Architecture/Events/GameEventListener.cs | 45 +++++++++++ .../Events/GameEventListener.cs.meta | 11 +++ Assets/Architecture/Variables.meta | 8 ++ Assets/Architecture/Variables/BoolVariable.cs | 38 +++++++++ .../Variables/BoolVariable.cs.meta | 11 +++ Assets/Architecture/Variables/Editor.meta | 8 ++ .../Variables/Editor/FloatReferenceDrawer.cs | 77 +++++++++++++++++++ .../Editor/FloatReferenceDrawer.cs.meta | 11 +++ .../Architecture/Variables/FloatReference.cs | 47 +++++++++++ .../Variables/FloatReference.cs.meta | 11 +++ .../Architecture/Variables/FloatVariable.cs | 50 ++++++++++++ .../Variables/FloatVariable.cs.meta | 11 +++ Assets/Architecture/Variables/IntVariable.cs | 50 ++++++++++++ .../Variables/IntVariable.cs.meta | 11 +++ .../Architecture/Variables/StringVariable.cs | 33 ++++++++ .../Variables/StringVariable.cs.meta | 11 +++ .../Scripts/MouseLook.cs | 7 +- .../Scripts/PlayerMovement.cs | 6 +- Assets/Scripts.meta | 8 ++ 29 files changed, 601 insertions(+), 2 deletions(-) create mode 100644 Assets/Architecture.meta create mode 100644 Assets/Architecture/Enums.meta create mode 100644 Assets/Architecture/Enums/EnumValue.cs create mode 100644 Assets/Architecture/Enums/EnumValue.cs.meta create mode 100644 Assets/Architecture/Events.meta create mode 100644 Assets/Architecture/Events/Editor.meta create mode 100644 Assets/Architecture/Events/Editor/EventEditor.cs create mode 100644 Assets/Architecture/Events/Editor/EventEditor.cs.meta create mode 100644 Assets/Architecture/Events/GameEvent.cs create mode 100644 Assets/Architecture/Events/GameEvent.cs.meta create mode 100644 Assets/Architecture/Events/GameEventListener.cs create mode 100644 Assets/Architecture/Events/GameEventListener.cs.meta create mode 100644 Assets/Architecture/Variables.meta create mode 100644 Assets/Architecture/Variables/BoolVariable.cs create mode 100644 Assets/Architecture/Variables/BoolVariable.cs.meta create mode 100644 Assets/Architecture/Variables/Editor.meta create mode 100644 Assets/Architecture/Variables/Editor/FloatReferenceDrawer.cs create mode 100644 Assets/Architecture/Variables/Editor/FloatReferenceDrawer.cs.meta create mode 100644 Assets/Architecture/Variables/FloatReference.cs create mode 100644 Assets/Architecture/Variables/FloatReference.cs.meta create mode 100644 Assets/Architecture/Variables/FloatVariable.cs create mode 100644 Assets/Architecture/Variables/FloatVariable.cs.meta create mode 100644 Assets/Architecture/Variables/IntVariable.cs create mode 100644 Assets/Architecture/Variables/IntVariable.cs.meta create mode 100644 Assets/Architecture/Variables/StringVariable.cs create mode 100644 Assets/Architecture/Variables/StringVariable.cs.meta create mode 100644 Assets/Scripts.meta diff --git a/Assets/Architecture.meta b/Assets/Architecture.meta new file mode 100644 index 0000000..84be4ca --- /dev/null +++ b/Assets/Architecture.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3c99d607772ce4347be90c8a91b9ebbb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Architecture/Enums.meta b/Assets/Architecture/Enums.meta new file mode 100644 index 0000000..2a72ef3 --- /dev/null +++ b/Assets/Architecture/Enums.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4535e4d344da0844dac2544e46e61ccc +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Architecture/Enums/EnumValue.cs b/Assets/Architecture/Enums/EnumValue.cs new file mode 100644 index 0000000..d50aafb --- /dev/null +++ b/Assets/Architecture/Enums/EnumValue.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; + +namespace Architecture.Enums +{ + [CreateAssetMenu(fileName = "New Enum Value", menuName = "Architecture/Enum Value")] + public class EnumValue : ScriptableObject + { + public string Name; + } +} diff --git a/Assets/Architecture/Enums/EnumValue.cs.meta b/Assets/Architecture/Enums/EnumValue.cs.meta new file mode 100644 index 0000000..17eb562 --- /dev/null +++ b/Assets/Architecture/Enums/EnumValue.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 97a3dd7294f44774184523763afc89ca +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Architecture/Events.meta b/Assets/Architecture/Events.meta new file mode 100644 index 0000000..a31ea37 --- /dev/null +++ b/Assets/Architecture/Events.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7e005abc2b02b7f4eaf6a213a6077126 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Architecture/Events/Editor.meta b/Assets/Architecture/Events/Editor.meta new file mode 100644 index 0000000..a65fe92 --- /dev/null +++ b/Assets/Architecture/Events/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 93c4e8e5652153c468c80377a80cb93d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Architecture/Events/Editor/EventEditor.cs b/Assets/Architecture/Events/Editor/EventEditor.cs new file mode 100644 index 0000000..337adcb --- /dev/null +++ b/Assets/Architecture/Events/Editor/EventEditor.cs @@ -0,0 +1,20 @@ +using UnityEditor; +using UnityEngine; + +namespace Architecture.Events +{ + [CustomEditor(typeof(GameEvent))] + public class EventEditor : Editor + { + public override void OnInspectorGUI() + { + base.OnInspectorGUI(); + + GUI.enabled = Application.isPlaying; + + GameEvent e = target as GameEvent; + if (GUILayout.Button("Raise")) + e.Raise(); + } + } +} \ No newline at end of file diff --git a/Assets/Architecture/Events/Editor/EventEditor.cs.meta b/Assets/Architecture/Events/Editor/EventEditor.cs.meta new file mode 100644 index 0000000..94bff4d --- /dev/null +++ b/Assets/Architecture/Events/Editor/EventEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8564e34357d4a224a838d71bdb631b0c +timeCreated: 1506793093 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Architecture/Events/GameEvent.cs b/Assets/Architecture/Events/GameEvent.cs new file mode 100644 index 0000000..c30dd8f --- /dev/null +++ b/Assets/Architecture/Events/GameEvent.cs @@ -0,0 +1,48 @@ +// ---------------------------------------------------------------------------- +// Unite 2017 - Game Architecture with Scriptable Objects +// +// Author: Ryan Hipple +// Date: 10/04/17 +// ---------------------------------------------------------------------------- + +/****************************************************************************** + * Note from me: + * If you have not watched this presentation, drop everything and watch it now + * https://youtu.be/raQ3iHhE_Kk + * + * YOU MUST MASTER THIS CONTENT! + *****************************************************************************/ + +using System.Collections.Generic; +using UnityEngine; + +namespace Architecture.Events +{ + [CreateAssetMenu(fileName = "New Game Event", menuName = "Architecture/Game Event", order = 1)] + public class GameEvent : ScriptableObject + { + /// + /// The list of listeners that this event will notify if it is raised. + /// + private readonly List eventListeners = + new List(); + + public void Raise() + { + for (int i = eventListeners.Count - 1; i >= 0; i--) + eventListeners[i].OnEventRaised(); + } + + public void RegisterListener(GameEventListener listener) + { + if (!eventListeners.Contains(listener)) + eventListeners.Add(listener); + } + + public void UnregisterListener(GameEventListener listener) + { + if (eventListeners.Contains(listener)) + eventListeners.Remove(listener); + } + } +} diff --git a/Assets/Architecture/Events/GameEvent.cs.meta b/Assets/Architecture/Events/GameEvent.cs.meta new file mode 100644 index 0000000..63f20b1 --- /dev/null +++ b/Assets/Architecture/Events/GameEvent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1f3bbdb45cfb90548ae20b51284bb3ed +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Architecture/Events/GameEventListener.cs b/Assets/Architecture/Events/GameEventListener.cs new file mode 100644 index 0000000..cba824f --- /dev/null +++ b/Assets/Architecture/Events/GameEventListener.cs @@ -0,0 +1,45 @@ +// ---------------------------------------------------------------------------- +// Unite 2017 - Game Architecture with Scriptable Objects +// +// Author: Ryan Hipple +// Date: 10/04/17 +// ---------------------------------------------------------------------------- + +/****************************************************************************** + * Note from me: + * If you have not watched this presentation, drop everything and watch it now + * https://youtu.be/raQ3iHhE_Kk + * + * YOU MUST MASTER THIS CONTENT! + *****************************************************************************/ + +using UnityEngine; +using UnityEngine.Events; + + +namespace Architecture.Events +{ + public class GameEventListener : MonoBehaviour + { + [Tooltip("Event to register with.")] + public GameEvent Event; + + [Tooltip("Response to invoke when Event is raised.")] + public UnityEvent Response; + + private void OnEnable() + { + Event.RegisterListener(this); + } + + private void OnDisable() + { + Event.UnregisterListener(this); + } + + public void OnEventRaised() + { + Response.Invoke(); + } + } +} diff --git a/Assets/Architecture/Events/GameEventListener.cs.meta b/Assets/Architecture/Events/GameEventListener.cs.meta new file mode 100644 index 0000000..69b8cf1 --- /dev/null +++ b/Assets/Architecture/Events/GameEventListener.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6db0e2471827ae743b18e930d1a025dc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Architecture/Variables.meta b/Assets/Architecture/Variables.meta new file mode 100644 index 0000000..ce3d470 --- /dev/null +++ b/Assets/Architecture/Variables.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d24ebc2f864c32f47abd7739a250bedd +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Architecture/Variables/BoolVariable.cs b/Assets/Architecture/Variables/BoolVariable.cs new file mode 100644 index 0000000..f0703b6 --- /dev/null +++ b/Assets/Architecture/Variables/BoolVariable.cs @@ -0,0 +1,38 @@ +// ---------------------------------------------------------------------------- +// Unite 2017 - Game Architecture with Scriptable Objects +// +// Author: Ryan Hipple +// Date: 10/04/17 +// ---------------------------------------------------------------------------- + +/****************************************************************************** + * Note from me: + * If you have not watched this presentation, drop everything and watch it now + * https://youtu.be/raQ3iHhE_Kk + * + * YOU MUST MASTER THIS CONTENT! + *****************************************************************************/ + +using UnityEngine; + +namespace Architecture.Variables +{ + [CreateAssetMenu(fileName = "New Boolean Variable", menuName = "Architecture/Boolean Variable")] + public class BoolVariable : ScriptableObject + { +#if UNITY_EDITOR + [Multiline] + public string DeveloperDescription = ""; +#endif + + [SerializeField] + private bool value = false; + + public bool Value + { + get { return value; } + set { this.value = value; } + } + } + +} \ No newline at end of file diff --git a/Assets/Architecture/Variables/BoolVariable.cs.meta b/Assets/Architecture/Variables/BoolVariable.cs.meta new file mode 100644 index 0000000..7178a34 --- /dev/null +++ b/Assets/Architecture/Variables/BoolVariable.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4d056a20c5b6bba48b50aa8bcc2993d7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Architecture/Variables/Editor.meta b/Assets/Architecture/Variables/Editor.meta new file mode 100644 index 0000000..0c8b73f --- /dev/null +++ b/Assets/Architecture/Variables/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f768077bb3d9eed4aa5a935b516fa366 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Architecture/Variables/Editor/FloatReferenceDrawer.cs b/Assets/Architecture/Variables/Editor/FloatReferenceDrawer.cs new file mode 100644 index 0000000..dfd4e32 --- /dev/null +++ b/Assets/Architecture/Variables/Editor/FloatReferenceDrawer.cs @@ -0,0 +1,77 @@ +// ---------------------------------------------------------------------------- +// Unite 2017 - Game Architecture with Scriptable Objects +// +// Author: Ryan Hipple +// Date: 10/04/17 +// ---------------------------------------------------------------------------- + + /****************************************************************************** + * Note from me: + * If you have not watched this presentation, drop everything and watch it now + * https://youtu.be/raQ3iHhE_Kk + * + * YOU MUST MASTER THIS CONTENT! + *****************************************************************************/ + + using UnityEditor; +using UnityEngine; + +namespace Architecture.Variables +{ + [CustomPropertyDrawer(typeof(FloatReference))] + public class FloatReferenceDrawer : PropertyDrawer + { + /// + /// Options to display in the popup to select constant or variable. + /// + private readonly string[] popupOptions = + { "Use Constant", "Use Variable" }; + + /// Cached style to use to draw the popup button. + private GUIStyle popupStyle; + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + if (popupStyle == null) + { + popupStyle = new GUIStyle(GUI.skin.GetStyle("PaneOptions")); + popupStyle.imagePosition = ImagePosition.ImageOnly; + } + + label = EditorGUI.BeginProperty(position, label, property); + position = EditorGUI.PrefixLabel(position, label); + + EditorGUI.BeginChangeCheck(); + + // Get properties + SerializedProperty useConstant = property.FindPropertyRelative("UseConstant"); + SerializedProperty constantValue = property.FindPropertyRelative("ConstantValue"); + SerializedProperty variable = property.FindPropertyRelative("Variable"); + + // Calculate rect for configuration button + Rect buttonRect = new Rect(position); + buttonRect.yMin += popupStyle.margin.top; + buttonRect.width = popupStyle.fixedWidth + popupStyle.margin.right; + position.xMin = buttonRect.xMax; + + // Store old indent level and set it to 0, the PrefixLabel takes care of it + int indent = EditorGUI.indentLevel; + EditorGUI.indentLevel = 0; + + int result = EditorGUI.Popup(buttonRect, useConstant.boolValue ? 0 : 1, popupOptions, popupStyle); + + useConstant.boolValue = result == 0; + + EditorGUI.PropertyField(position, + useConstant.boolValue ? constantValue : variable, + GUIContent.none); + + if (EditorGUI.EndChangeCheck()) + property.serializedObject.ApplyModifiedProperties(); + + EditorGUI.indentLevel = indent; + EditorGUI.EndProperty(); + } + } + +} \ No newline at end of file diff --git a/Assets/Architecture/Variables/Editor/FloatReferenceDrawer.cs.meta b/Assets/Architecture/Variables/Editor/FloatReferenceDrawer.cs.meta new file mode 100644 index 0000000..a370c18 --- /dev/null +++ b/Assets/Architecture/Variables/Editor/FloatReferenceDrawer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d1339393180531047aef724fdc6f0f74 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Architecture/Variables/FloatReference.cs b/Assets/Architecture/Variables/FloatReference.cs new file mode 100644 index 0000000..16dbfcd --- /dev/null +++ b/Assets/Architecture/Variables/FloatReference.cs @@ -0,0 +1,47 @@ +// ---------------------------------------------------------------------------- +// Unite 2017 - Game Architecture with Scriptable Objects +// +// Author: Ryan Hipple +// Date: 10/04/17 +// ---------------------------------------------------------------------------- + +/****************************************************************************** + * Note from me: + * If you have not watched this presentation, drop everything and watch it now + * https://youtu.be/raQ3iHhE_Kk + * + * YOU MUST MASTER THIS CONTENT! + *****************************************************************************/ + +using System; + +namespace Architecture.Variables +{ + [Serializable] + public class FloatReference + { + public bool UseConstant = true; + public float ConstantValue; + public FloatVariable Variable; + + public FloatReference() + { } + + public FloatReference(float value) + { + UseConstant = true; + ConstantValue = value; + } + + public float Value + { + get { return UseConstant ? ConstantValue : Variable.Value; } + } + + public static implicit operator float(FloatReference reference) + { + return reference.Value; + } + } + +} \ No newline at end of file diff --git a/Assets/Architecture/Variables/FloatReference.cs.meta b/Assets/Architecture/Variables/FloatReference.cs.meta new file mode 100644 index 0000000..e24d95e --- /dev/null +++ b/Assets/Architecture/Variables/FloatReference.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c02f17a3496c0f747b66a060639cc478 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Architecture/Variables/FloatVariable.cs b/Assets/Architecture/Variables/FloatVariable.cs new file mode 100644 index 0000000..4a17e1e --- /dev/null +++ b/Assets/Architecture/Variables/FloatVariable.cs @@ -0,0 +1,50 @@ +// ---------------------------------------------------------------------------- +// Unite 2017 - Game Architecture with Scriptable Objects +// +// Author: Ryan Hipple +// Date: 10/04/17 +// ---------------------------------------------------------------------------- + +/****************************************************************************** + * Note from me: + * If you have not watched this presentation, drop everything and watch it now + * https://youtu.be/raQ3iHhE_Kk + * + * YOU MUST MASTER THIS CONTENT! + *****************************************************************************/ + +using UnityEngine; + +namespace Architecture.Variables +{ + [CreateAssetMenu(fileName = "New Float Variable", menuName = "Architecture/Float Variable")] + public class FloatVariable : ScriptableObject + { +#if UNITY_EDITOR + [Multiline] + public string DeveloperDescription = ""; +#endif + public float Value; + + public void SetValue(float value) + { + Value = value; + } + + public void SetValue(FloatVariable value) + { + Value = value.Value; + } + + public void ApplyChange(float amount) + { + Value += amount; + } + + public void ApplyChange(FloatVariable amount) + { + Value += amount.Value; + } + } + +} \ No newline at end of file diff --git a/Assets/Architecture/Variables/FloatVariable.cs.meta b/Assets/Architecture/Variables/FloatVariable.cs.meta new file mode 100644 index 0000000..8abfedc --- /dev/null +++ b/Assets/Architecture/Variables/FloatVariable.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7cb18c6bb3c4bcd40b8451100e11b136 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Architecture/Variables/IntVariable.cs b/Assets/Architecture/Variables/IntVariable.cs new file mode 100644 index 0000000..a88b9c3 --- /dev/null +++ b/Assets/Architecture/Variables/IntVariable.cs @@ -0,0 +1,50 @@ +// ---------------------------------------------------------------------------- +// Unite 2017 - Game Architecture with Scriptable Objects +// +// Author: Ryan Hipple +// Date: 10/04/17 +// ---------------------------------------------------------------------------- + +/****************************************************************************** + * Note from me: + * If you have not watched this presentation, drop everything and watch it now + * https://youtu.be/raQ3iHhE_Kk + * + * YOU MUST MASTER THIS CONTENT! + *****************************************************************************/ + +using UnityEngine; + +namespace Architecture.Variables +{ + [CreateAssetMenu(fileName = "New Integer Variable", menuName = "Architecture/Integer Variable")] + public class IntVariable : ScriptableObject + { +#if UNITY_EDITOR + [Multiline] + public string DeveloperDescription = ""; +#endif + + public int Value; + + public void SetValue(int value) + { + Value = value; + } + + public void SetValue(IntVariable value) + { + Value = value.Value; + } + + public void ApplyChange(int amount) + { + Value += amount; + } + + public void ApplyChange(IntVariable amount) + { + Value += amount.Value; + } + } +} diff --git a/Assets/Architecture/Variables/IntVariable.cs.meta b/Assets/Architecture/Variables/IntVariable.cs.meta new file mode 100644 index 0000000..5775699 --- /dev/null +++ b/Assets/Architecture/Variables/IntVariable.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f48b43e898ec8f54ca1d8845b39b9c6c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Architecture/Variables/StringVariable.cs b/Assets/Architecture/Variables/StringVariable.cs new file mode 100644 index 0000000..30d15b6 --- /dev/null +++ b/Assets/Architecture/Variables/StringVariable.cs @@ -0,0 +1,33 @@ +// ---------------------------------------------------------------------------- +// Unite 2017 - Game Architecture with Scriptable Objects +// +// Author: Ryan Hipple +// Date: 10/04/17 +// ---------------------------------------------------------------------------- + +/****************************************************************************** + * Note from me: + * If you have not watched this presentation, drop everything and watch it now + * https://youtu.be/raQ3iHhE_Kk + * + * YOU MUST MASTER THIS CONTENT! + *****************************************************************************/ + +using UnityEngine; + +namespace Architecture.Variables +{ + [CreateAssetMenu(fileName = "New String Variable", menuName = "Architecture/String Variable")] + public class StringVariable : ScriptableObject + { + [SerializeField] + private string value = ""; + + public string Value + { + get { return value; } + set { this.value = value; } + } + } + +} \ No newline at end of file diff --git a/Assets/Architecture/Variables/StringVariable.cs.meta b/Assets/Architecture/Variables/StringVariable.cs.meta new file mode 100644 index 0000000..3bffc93 --- /dev/null +++ b/Assets/Architecture/Variables/StringVariable.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d2cbaae3519f6834c87bb047c94b8cbf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FirstPersonController/Scripts/MouseLook.cs b/Assets/FirstPersonController/Scripts/MouseLook.cs index ec5c8e3..3e4caf6 100644 --- a/Assets/FirstPersonController/Scripts/MouseLook.cs +++ b/Assets/FirstPersonController/Scripts/MouseLook.cs @@ -1,4 +1,9 @@ -using System.Collections; +/****************************************************************************** + * Initial code based on Brackey's FPS video + * https://youtu.be/_QajrabyTJc + *****************************************************************************/ + +using System.Collections; using System.Collections.Generic; using UnityEngine; diff --git a/Assets/FirstPersonController/Scripts/PlayerMovement.cs b/Assets/FirstPersonController/Scripts/PlayerMovement.cs index 9db5eb4..40424ce 100644 --- a/Assets/FirstPersonController/Scripts/PlayerMovement.cs +++ b/Assets/FirstPersonController/Scripts/PlayerMovement.cs @@ -1,4 +1,8 @@ -using System.Collections; +/****************************************************************************** + * Initial code based on Brackey's FPS video + * https://youtu.be/_QajrabyTJc + *****************************************************************************/ +using System.Collections; using System.Collections.Generic; using UnityEngine; diff --git a/Assets/Scripts.meta b/Assets/Scripts.meta new file mode 100644 index 0000000..f82b372 --- /dev/null +++ b/Assets/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 84af533f7b759c44287ba593ee3f85c4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: