Skip to content
Snippets Groups Projects
Commit fb6eceab authored by Heine, Eric R's avatar Heine, Eric R
Browse files

Added UI, variables, events, and listeners for Vector2, 3, and 4 values.

parent e84203b1
No related branches found
No related tags found
No related merge requests found
Showing
with 300 additions and 0 deletions
using UnityEngine;
using UnityEngine.Events;
namespace Shared.ScriptableVariables {
// Component to tie Vector3GameEvents to Unity's event system
public class Vector3GameEventListener : GameEventListener<Vector3> {
[Tooltip("The game event to listen to")]
public Vector3GameEvent eventToListenTo;
[Tooltip("The UnityEvent to raise in response to the game event being raised")]
public Vector3UnityEvent response;
//---------------------------------------------------------------------------
protected override GameEvent<Vector3> GetGameEvent() { return eventToListenTo; }
//---------------------------------------------------------------------------
protected override UnityEvent<Vector3> GetUnityEvent() { return response; }
}
}
fileFormatVersion: 2
guid: 5ec009a88dcb5144697ce093c13e3d83
timeCreated: 1510599448
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using UnityEngine.Events;
namespace Shared.ScriptableVariables {
/// <summary>
/// Used to trigger a UnityEvent in response to changes on a Vector3Variable
/// </summary>
public class Vector3VariableListener : ScriptableVariableListener<Vector3> {
[Tooltip("The ScriptableVariable to listen for changes")]
public Vector3Variable variable;
[Tooltip("The UnityEvent that gets triggered when the variable changes value")]
public Vector3UnityEvent OnValueChangedEvent;
//---------------------------------------------------------------------------
protected override ScriptableVariable<Vector3> GetScriptableVariable() { return variable; }
//---------------------------------------------------------------------------
protected override UnityEvent<Vector3> GetUnityEvent() { return OnValueChangedEvent; }
}
}
fileFormatVersion: 2
guid: d5af93d9ba9b41e4ab55b5abe12edb2c
timeCreated: 1513208270
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using UnityEngine.Events;
namespace Shared.ScriptableVariables {
// Component to tie Vector4GameEvents to Unity's event system
public class Vector4GameEventListener : GameEventListener<Vector4> {
[Tooltip("The game event to listen to")]
public Vector4GameEvent eventToListenTo;
[Tooltip("The UnityEvent to raise in response to the game event being raised")]
public Vector4UnityEvent response;
//---------------------------------------------------------------------------
protected override GameEvent<Vector4> GetGameEvent() { return eventToListenTo; }
//---------------------------------------------------------------------------
protected override UnityEvent<Vector4> GetUnityEvent() { return response; }
}
}
fileFormatVersion: 2
guid: 8ca17874c6c50a147986d2d5ab155d5d
timeCreated: 1510599448
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using UnityEngine.Events;
namespace Shared.ScriptableVariables {
/// <summary>
/// Used to trigger a UnityEvent in response to changes on a Vector4Variable
/// </summary>
public class Vector4VariableListener : ScriptableVariableListener<Vector4> {
[Tooltip("The ScriptableVariable to listen for changes")]
public Vector4Variable variable;
[Tooltip("The UnityEvent that gets triggered when the variable changes value")]
public Vector4UnityEvent OnValueChangedEvent;
//---------------------------------------------------------------------------
protected override ScriptableVariable<Vector4> GetScriptableVariable() { return variable; }
//---------------------------------------------------------------------------
protected override UnityEvent<Vector4> GetUnityEvent() { return OnValueChangedEvent; }
}
}
fileFormatVersion: 2
guid: c4d5d5145e1deb945bb5b29e2b332e48
timeCreated: 1513208270
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
namespace Shared.ScriptableVariables {
// A Vector2 value to share across components, scenes, and prefabs
[CreateAssetMenu(menuName = "Scriptable Objects/Variables/Vector2")]
public class Vector2Variable : ScriptableVariable<Vector2> {
//---------------------------------------------------------------------------
[ContextMenu("Reset To Default Value")]
public void ContextMenuReset() {
Reset();
}
}
#if UNITY_EDITOR
//-----------------------------------------------------------------------------
[UnityEditor.CustomEditor(typeof(Vector2Variable))]
[UnityEditor.CanEditMultipleObjects]
public class Vector2ScriptableVariableEditor : Vector2Variable.BaseScriptableVariableEditor {
}
#endif
}
fileFormatVersion: 2
guid: ae328bc50f421254396a03e58e8b0638
timeCreated: 1510599427
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
namespace Shared.ScriptableVariables {
// A Vector3 value to share across components, scenes, and prefabs
[CreateAssetMenu(menuName = "Scriptable Objects/Variables/Vector3")]
public class Vector3Variable : ScriptableVariable<Vector3> {
//---------------------------------------------------------------------------
[ContextMenu("Reset To Default Value")]
public void ContextMenuReset() {
Reset();
}
}
#if UNITY_EDITOR
//-----------------------------------------------------------------------------
[UnityEditor.CustomEditor(typeof(Vector3Variable))]
[UnityEditor.CanEditMultipleObjects]
public class Vector3ScriptableVariableEditor : Vector3Variable.BaseScriptableVariableEditor {
}
#endif
}
fileFormatVersion: 2
guid: e9c61337ff4dbe8469dc49c3886561ec
timeCreated: 1510599427
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
namespace Shared.ScriptableVariables {
// A Vector4 value to share across components, scenes, and prefabs
[CreateAssetMenu(menuName = "Scriptable Objects/Variables/Vector4")]
public class Vector4Variable : ScriptableVariable<Vector4> {
//---------------------------------------------------------------------------
[ContextMenu("Reset To Default Value")]
public void ContextMenuReset() {
Reset();
}
}
#if UNITY_EDITOR
//-----------------------------------------------------------------------------
[UnityEditor.CustomEditor(typeof(Vector4Variable))]
[UnityEditor.CanEditMultipleObjects]
public class Vector4ScriptableVariableEditor : Vector4Variable.BaseScriptableVariableEditor {
}
#endif
}
fileFormatVersion: 2
guid: 1fe0e4fa8a8022442a1d26ad60b9a2bb
timeCreated: 1510599427
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEditor;
namespace Shared.ScriptableVariables {
// A custom Inspector Editor for ReferenceVector2Variables
[CustomEditor(typeof(ReferenceVector2Variable))]
[CanEditMultipleObjects]
public class ReferenceVector2VariableInspector : ReferenceScriptableVariableInspector {
}
}
fileFormatVersion: 2
guid: 200dc1216ca52e948b1697340f3744e6
timeCreated: 1510601506
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEditor;
namespace Shared.ScriptableVariables {
// A custom Inspector Editor for ReferenceVector3Variables
[CustomEditor(typeof(ReferenceVector3Variable))]
[CanEditMultipleObjects]
public class ReferenceVector3VariableInspector : ReferenceScriptableVariableInspector {
}
}
fileFormatVersion: 2
guid: 199e2653d66c1164185b434bc83f2818
timeCreated: 1510601506
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEditor;
namespace Shared.ScriptableVariables {
// A custom Inspector Editor for ReferenceVector4Variables
[CustomEditor(typeof(ReferenceVector4Variable))]
[CanEditMultipleObjects]
public class ReferenceVector4VariableInspector : ReferenceScriptableVariableInspector {
}
}
fileFormatVersion: 2
guid: d99bdf84ff7e0c24e89e982049f18891
timeCreated: 1510601506
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment