mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-21 23:58:49 -05:00
Added code cleanup work
This commit is contained in:
commit
2c726a3c35
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
*.cs eol=lf
|
||||
|
@ -1,7 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
@ -88,36 +86,36 @@ namespace UnityAtoms
|
||||
|
||||
#endregion
|
||||
|
||||
public bool HasTag(string tag)
|
||||
public bool HasTag(string atomicTag)
|
||||
{
|
||||
if (tag == null) return false;
|
||||
return sortedTags.ContainsKey(tag);
|
||||
if (atomicTag == null) return false;
|
||||
return sortedTags.ContainsKey(atomicTag);
|
||||
}
|
||||
|
||||
public void AddTag(StringConstant tag)
|
||||
public void AddTag(StringConstant atomicTag)
|
||||
{
|
||||
if (tag == null || tag.Value == null) return;
|
||||
if (sortedTags.ContainsKey(tag.Value)) return;
|
||||
sortedTags.Add(tag.Value, tag);
|
||||
if (atomicTag == null || atomicTag.Value == null) return;
|
||||
if (sortedTags.ContainsKey(atomicTag.Value)) return;
|
||||
sortedTags.Add(atomicTag.Value, atomicTag);
|
||||
|
||||
Tags = new ReadOnlyList<StringConstant>(sortedTags.Values);
|
||||
|
||||
// Update static accessors:
|
||||
if (!taggedGOs.ContainsKey(tag.Value)) taggedGOs.Add(tag.Value, new List<GameObject>());
|
||||
taggedGOs[tag.Value].Add(this.gameObject);
|
||||
if (!taggedGOs.ContainsKey(atomicTag.Value)) taggedGOs.Add(atomicTag.Value, new List<GameObject>());
|
||||
taggedGOs[atomicTag.Value].Add(this.gameObject);
|
||||
}
|
||||
|
||||
public void RemoveTag(string tag)
|
||||
public void RemoveTag(string atomicTag)
|
||||
{
|
||||
if (tag == null) return;
|
||||
if (sortedTags.ContainsKey(tag)) return;
|
||||
sortedTags.Remove(tag);
|
||||
if (atomicTag == null) return;
|
||||
if (sortedTags.ContainsKey(atomicTag)) return;
|
||||
sortedTags.Remove(atomicTag);
|
||||
|
||||
Tags = new ReadOnlyList<StringConstant>(sortedTags.Values);
|
||||
|
||||
// Update static accessors:
|
||||
if (!taggedGOs.ContainsKey(tag)) return; // this should never happen
|
||||
taggedGOs[tag].Remove(this.gameObject);
|
||||
if (!taggedGOs.ContainsKey(atomicTag)) return; // this should never happen
|
||||
taggedGOs[atomicTag].Remove(this.gameObject);
|
||||
}
|
||||
|
||||
public static GameObject FindByTag(string tag)
|
||||
|
@ -1,25 +1,24 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace UnityAtoms {
|
||||
/// <summary>
|
||||
/// This is basically an IList without everything that could mutate the list
|
||||
/// </summary>
|
||||
public class ReadOnlyList<T> : IEnumerable, IEnumerable<T> {
|
||||
private readonly IList<T> referenceList;
|
||||
|
||||
|
||||
public ReadOnlyList(IList<T> referenceList) { this.referenceList = referenceList; }
|
||||
|
||||
|
||||
public IEnumerator<T> GetEnumerator() { return referenceList.GetEnumerator(); }
|
||||
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); }
|
||||
|
||||
|
||||
public bool Contains(T item) { return referenceList.Contains(item); }
|
||||
public int IndexOf(T item) { return referenceList.IndexOf(item); }
|
||||
|
||||
|
||||
public void CopyTo(T[] array, int arrayIndex) { referenceList.CopyTo(array, arrayIndex); }
|
||||
|
||||
|
||||
public int Count {
|
||||
get { return referenceList.Count; }
|
||||
}
|
||||
@ -33,4 +32,4 @@ using System.Collections;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityAtoms.UI
|
||||
|
@ -1,4 +1,3 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityAtoms
|
||||
|
@ -1,5 +1,3 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityAtoms.Utils;
|
||||
|
@ -1,5 +1,3 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityAtoms.Utils;
|
||||
|
@ -1,4 +1,3 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
|
@ -9,4 +9,4 @@ namespace UnityAtoms
|
||||
{
|
||||
void OnEventRaised(T1 first, T2 second);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,3 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityAtoms
|
||||
@ -28,4 +26,4 @@ namespace UnityAtoms
|
||||
{
|
||||
public abstract void Do(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,4 +24,4 @@ namespace UnityAtoms
|
||||
return reference.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityAtoms
|
||||
{
|
||||
@ -11,4 +9,4 @@ namespace UnityAtoms
|
||||
return (t1 == null && t2 == null) || (t1 != null && t1.Equals(t2));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,4 +7,4 @@ namespace UnityAtoms
|
||||
bool ApplyChange(T amount);
|
||||
bool ApplyChange(EquatableScriptableObjectVariable<T, E1, E2> amount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,4 +4,4 @@ namespace UnityAtoms
|
||||
{
|
||||
T OldValue { get; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,4 +4,4 @@ namespace UnityAtoms
|
||||
{
|
||||
T Value { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,3 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityAtoms
|
||||
@ -24,14 +23,14 @@ namespace UnityAtoms
|
||||
Changed.Raise(Value);
|
||||
}
|
||||
|
||||
public bool SetValue(T value)
|
||||
public bool SetValue(T newValue)
|
||||
{
|
||||
if (!AreEqual(this.value, value))
|
||||
if (!AreEqual(value, newValue))
|
||||
{
|
||||
this.oldValue = this.value;
|
||||
this.value = value;
|
||||
if (Changed != null) { Changed.Raise(value); }
|
||||
if (ChangedWithHistory != null) { ChangedWithHistory.Raise(this.value, this.oldValue); }
|
||||
oldValue = value;
|
||||
value = newValue;
|
||||
if (Changed != null) { Changed.Raise(newValue); }
|
||||
if (ChangedWithHistory != null) { ChangedWithHistory.Raise(value, oldValue); }
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -34,4 +34,4 @@ namespace UnityAtoms
|
||||
public static bool operator ==(ScriptableObjectVariableBase<T> left, ScriptableObjectVariableBase<T> right) { return Equals(left, right); }
|
||||
public static bool operator !=(ScriptableObjectVariableBase<T> left, ScriptableObjectVariableBase<T> right) { return !Equals(left, right); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace UnityAtoms
|
||||
{
|
||||
public abstract class BoolAction : GameAction<bool> { }
|
||||
}
|
||||
}
|
||||
|
@ -5,4 +5,4 @@ namespace UnityAtoms
|
||||
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Bool/Event x 2", fileName = "BoolBoolEvent", order = CreateAssetMenuUtils.Order.EVENTx2)]
|
||||
public class BoolBoolEvent : GameEvent<bool, bool> { }
|
||||
}
|
||||
}
|
||||
|
@ -4,4 +4,4 @@ namespace UnityAtoms
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Bool/Constant", fileName = "BoolConstant", order = CreateAssetMenuUtils.Order.CONSTANT)]
|
||||
public class BoolConstant : ScriptableObjectVariableBase<bool> { }
|
||||
}
|
||||
}
|
||||
|
@ -5,4 +5,4 @@ namespace UnityAtoms
|
||||
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Bool/Event", fileName = "BoolEvent", order = CreateAssetMenuUtils.Order.EVENT)]
|
||||
public class BoolEvent : GameEvent<bool> { }
|
||||
}
|
||||
}
|
||||
|
@ -4,4 +4,4 @@ namespace UnityAtoms
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Bool/List", fileName = "BoolList", order = CreateAssetMenuUtils.Order.LIST)]
|
||||
public class BoolList : ScriptableObjectList<bool, BoolEvent> { }
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,7 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityAtoms
|
||||
{
|
||||
[Serializable]
|
||||
public class BoolReference : ScriptableObjectReference<bool, BoolVariable, BoolEvent, BoolBoolEvent> { }
|
||||
}
|
||||
}
|
||||
|
@ -4,4 +4,4 @@ namespace UnityAtoms
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Bool/Variable", fileName = "BoolVariable", order = CreateAssetMenuUtils.Order.VARIABLE)]
|
||||
public class BoolVariable : EquatableScriptableObjectVariable<bool, BoolEvent, BoolBoolEvent> { }
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityAtoms
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Bool/Set Variable", fileName = "SetBoolVariableValueAction", order = CreateAssetMenuUtils.Order.SET_VARIABLE)]
|
||||
public class SetBoolVariableValue : SetVariableValue<bool, BoolVariable, BoolReference, BoolEvent, BoolBoolEvent> { }
|
||||
}
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityAtoms
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Bool/Set Variable", fileName = "SetBoolVariableValueAction", order = CreateAssetMenuUtils.Order.SET_VARIABLE)]
|
||||
public class SetBoolVariableValue : SetVariableValue<bool, BoolVariable, BoolReference, BoolEvent, BoolBoolEvent> { }
|
||||
}
|
||||
|
@ -5,4 +5,4 @@ namespace UnityAtoms
|
||||
{
|
||||
[Serializable]
|
||||
public class UnityBoolEvent : UnityEvent<bool> { }
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityAtoms
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Collider/Event", fileName = "ColliderEvent", order = CreateAssetMenuUtils.Order.EVENT)]
|
||||
public class ColliderEvent : GameEvent<Collider> { }
|
||||
}
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityAtoms
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Collider/Event", fileName = "ColliderEvent", order = CreateAssetMenuUtils.Order.EVENT)]
|
||||
public class ColliderEvent : GameEvent<Collider> { }
|
||||
}
|
||||
|
@ -3,4 +3,4 @@ using UnityEngine;
|
||||
namespace UnityAtoms
|
||||
{
|
||||
public abstract class ColliderGameObjectAction : GameAction<Collider, GameObject> { }
|
||||
}
|
||||
}
|
||||
|
@ -5,4 +5,4 @@ namespace UnityAtoms
|
||||
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Collider/Event with GameObject", fileName = "ColliderGameObjectEvent", order = CreateAssetMenuUtils.Order.EVENT_WITH_GO)]
|
||||
public class ColliderGameObjectEvent : GameEvent<Collider, GameObject> { }
|
||||
}
|
||||
}
|
||||
|
@ -6,4 +6,4 @@ namespace UnityAtoms
|
||||
{
|
||||
[Serializable]
|
||||
public class UnityColliderGameObjectEvent : UnityEvent<Collider, GameObject> { }
|
||||
}
|
||||
}
|
||||
|
@ -3,4 +3,4 @@ using UnityEngine;
|
||||
namespace UnityAtoms
|
||||
{
|
||||
public abstract class Collider2DAction : GameAction<Collider2D> { }
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityAtoms
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Collider2D/Event", fileName = "Collider2DEvent", order = CreateAssetMenuUtils.Order.EVENT)]
|
||||
public class Collider2DEvent : GameEvent<Collider2D> { }
|
||||
}
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityAtoms
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Collider2D/Event", fileName = "Collider2DEvent", order = CreateAssetMenuUtils.Order.EVENT)]
|
||||
public class Collider2DEvent : GameEvent<Collider2D> { }
|
||||
}
|
||||
|
@ -1,6 +1,4 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityAtoms
|
||||
{
|
||||
public abstract class Collider2DEventAction : GameAction<Collider2DEvent> { }
|
||||
}
|
||||
}
|
||||
|
@ -3,4 +3,4 @@ using UnityEngine;
|
||||
namespace UnityAtoms
|
||||
{
|
||||
public abstract class Collider2DGameObjectAction : GameAction<Collider2D, GameObject> { }
|
||||
}
|
||||
}
|
||||
|
@ -5,4 +5,4 @@ namespace UnityAtoms
|
||||
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Collider2D/Event with GameObject", fileName = "Collider2DGameObjectEvent", order = CreateAssetMenuUtils.Order.EVENT_WITH_GO)]
|
||||
public class Collider2DGameObjectEvent : GameEvent<Collider2D, GameObject> { }
|
||||
}
|
||||
}
|
||||
|
@ -4,4 +4,4 @@ namespace UnityAtoms
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Collider2D/List", fileName = "Collider2DList", order = CreateAssetMenuUtils.Order.LIST)]
|
||||
public class Collider2DList : ScriptableObjectList<Collider2D, Collider2DEvent> { }
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,4 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityAtoms
|
||||
{
|
||||
public abstract class Collider2DListAction : GameAction<Collider2DList> { }
|
||||
}
|
||||
}
|
||||
|
@ -3,4 +3,4 @@ using UnityEngine;
|
||||
namespace UnityAtoms
|
||||
{
|
||||
public abstract class Collider2DListGameObjectAction : GameAction<Collider2DList, GameObject> { }
|
||||
}
|
||||
}
|
||||
|
@ -11,4 +11,4 @@ namespace UnityAtoms
|
||||
Collider2DHook
|
||||
>
|
||||
{ }
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,6 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityAtoms.Utils;
|
||||
|
||||
namespace UnityAtoms
|
||||
{
|
||||
public class CreateCollider2DListOnAwake : CreateListOnAwake<Collider2D, Collider2DList, Collider2DEvent, Collider2DListener, Collider2DAction, Collider2DListAction, Collider2DListGameObjectAction, UnityCollider2DEvent> { }
|
||||
}
|
||||
}
|
||||
|
@ -6,4 +6,4 @@ namespace UnityAtoms
|
||||
{
|
||||
[Serializable]
|
||||
public class UnityCollider2DEvent : UnityEvent<Collider2D> { }
|
||||
}
|
||||
}
|
||||
|
@ -6,4 +6,4 @@ namespace UnityAtoms
|
||||
{
|
||||
[Serializable]
|
||||
public class UnityCollider2DGameObjectEvent : UnityEvent<Collider2D, GameObject> { }
|
||||
}
|
||||
}
|
||||
|
@ -3,4 +3,4 @@ using UnityEngine;
|
||||
namespace UnityAtoms
|
||||
{
|
||||
public abstract class ColorAction : GameAction<Color> { }
|
||||
}
|
||||
}
|
||||
|
@ -5,4 +5,4 @@ namespace UnityAtoms
|
||||
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Color/Event x 2", fileName = "ColorColorEvent", order = CreateAssetMenuUtils.Order.EVENTx2)]
|
||||
public class ColorColorEvent : GameEvent<Color, Color> { }
|
||||
}
|
||||
}
|
||||
|
@ -4,4 +4,4 @@ namespace UnityAtoms
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Color/Constant", fileName = "ColorConstant", order = CreateAssetMenuUtils.Order.CONSTANT)]
|
||||
public class ColorConstant : ScriptableObjectVariableBase<Color> { }
|
||||
}
|
||||
}
|
||||
|
@ -5,4 +5,4 @@ namespace UnityAtoms
|
||||
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Color/Event", fileName = "ColorEvent", order = CreateAssetMenuUtils.Order.EVENT)]
|
||||
public class ColorEvent : GameEvent<Color> { }
|
||||
}
|
||||
}
|
||||
|
@ -4,4 +4,4 @@ namespace UnityAtoms
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Color/List", fileName = "ColorList", order = CreateAssetMenuUtils.Order.LIST)]
|
||||
public class ColorList : ScriptableObjectList<Color, ColorEvent> { }
|
||||
}
|
||||
}
|
||||
|
@ -5,4 +5,4 @@ namespace UnityAtoms
|
||||
{
|
||||
[Serializable]
|
||||
public class ColorReference : ScriptableObjectReference<Color, ColorVariable, ColorEvent, ColorColorEvent> { }
|
||||
}
|
||||
}
|
||||
|
@ -10,4 +10,4 @@ namespace UnityAtoms
|
||||
return first.Equals(second);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,4 +4,4 @@ namespace UnityAtoms
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Color/Set Variable", fileName = "SetColorVariableValueAction", order = CreateAssetMenuUtils.Order.SET_VARIABLE)]
|
||||
public class SetColorVariableValue : SetVariableValue<Color, ColorVariable, ColorReference, ColorEvent, ColorColorEvent> { }
|
||||
}
|
||||
}
|
||||
|
@ -6,4 +6,4 @@ namespace UnityAtoms
|
||||
{
|
||||
[Serializable]
|
||||
public class UnityColorEvent : UnityEvent<Color> { }
|
||||
}
|
||||
}
|
||||
|
@ -45,4 +45,4 @@ namespace UnityAtoms
|
||||
|
||||
[CustomEditor(typeof(VoidEvent))]
|
||||
public class VoidEventEditor : GameEventEditor<Void, VoidEvent> { }
|
||||
}
|
||||
}
|
||||
|
@ -74,4 +74,4 @@ namespace UnityAtoms
|
||||
[CustomPropertyDrawer(typeof(Vector3Reference))]
|
||||
public class Vector3ReferenceDrawer : ReferenceDrawer { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,3 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityAtoms.Extensions
|
||||
@ -16,4 +14,4 @@ namespace UnityAtoms.Extensions
|
||||
return array[Random.Range(0, array.Length)];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,4 +14,4 @@ namespace UnityAtoms.Extensions
|
||||
return camera.GetOrthographicWorldScreenHeight() / Screen.height * Screen.width; ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,3 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityAtoms.Extensions
|
||||
@ -43,4 +42,4 @@ namespace UnityAtoms.Extensions
|
||||
return mb.gameObject.GetOrAddComponent<T>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,14 +1,13 @@
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace UnityAtoms.Extensions
|
||||
{
|
||||
public static class TransformExtensions
|
||||
{
|
||||
|
||||
/* Finds a child to this transform by name. Searches not only the first level in the
|
||||
* tree hierarchy of child objects, but all the children, grand children, and so on.
|
||||
/* Finds a child to this transform by name. Searches not only the first level in the
|
||||
* tree hierarchy of child objects, but all the children, grand children, and so on.
|
||||
*/
|
||||
public static Transform FindDeepChild(this Transform parent, string name)
|
||||
{
|
||||
|
@ -20,4 +20,4 @@ namespace UnityAtoms.Extensions
|
||||
return v2 + (distance.normalized * maxDistance);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,4 +25,4 @@ namespace UnityAtoms.Extensions
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace UnityAtoms
|
||||
{
|
||||
public abstract class FloatAction : GameAction<float> { }
|
||||
}
|
||||
}
|
||||
|
@ -4,4 +4,4 @@ namespace UnityAtoms
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Float/Constant", fileName = "FloatConstant", order = CreateAssetMenuUtils.Order.CONSTANT)]
|
||||
public class FloatConstant : ScriptableObjectVariableBase<float> { }
|
||||
}
|
||||
}
|
||||
|
@ -4,4 +4,4 @@ namespace UnityAtoms
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Float/Event", fileName = "FloatEvent", order = CreateAssetMenuUtils.Order.EVENT)]
|
||||
public class FloatEvent : GameEvent<float> { }
|
||||
}
|
||||
}
|
||||
|
@ -5,4 +5,4 @@ namespace UnityAtoms
|
||||
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Float/Event x 2", fileName = "FloatFloatEvent", order = CreateAssetMenuUtils.Order.EVENTx2)]
|
||||
public class FloatFloatEvent : GameEvent<float, float> { }
|
||||
}
|
||||
}
|
||||
|
@ -4,4 +4,4 @@ namespace UnityAtoms
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Float/List", fileName = "FloatList", order = CreateAssetMenuUtils.Order.LIST)]
|
||||
public class FloatList : ScriptableObjectList<float, FloatEvent> { }
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,7 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityAtoms
|
||||
{
|
||||
[Serializable]
|
||||
public class FloatReference : ScriptableObjectReference<float, FloatVariable, FloatEvent, FloatFloatEvent> { }
|
||||
}
|
||||
}
|
||||
|
@ -15,4 +15,4 @@ namespace UnityAtoms
|
||||
return SetValue(Value + amount.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,4 +4,4 @@ namespace UnityAtoms
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Float/Set Variable", fileName = "SetFloatVariableValueAction", order = CreateAssetMenuUtils.Order.SET_VARIABLE)]
|
||||
public class SetFloatVariableValue : SetVariableValue<float, FloatVariable, FloatReference, FloatEvent, FloatFloatEvent> { }
|
||||
}
|
||||
}
|
||||
|
@ -5,4 +5,4 @@ namespace UnityAtoms
|
||||
{
|
||||
[Serializable]
|
||||
public class UnityFloatEvent : UnityEvent<float> { }
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,4 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityAtoms
|
||||
{
|
||||
public abstract class BoolBoolFunction : GameFunction<bool, bool> { }
|
||||
}
|
||||
}
|
||||
|
@ -3,4 +3,4 @@ using UnityEngine;
|
||||
namespace UnityAtoms
|
||||
{
|
||||
public abstract class BoolColorFunction : GameFunction<bool, Color> { }
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,4 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityAtoms
|
||||
{
|
||||
public abstract class BoolFloatFunction : GameFunction<bool, float> { }
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,4 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityAtoms
|
||||
{
|
||||
public abstract class BoolFunction : GameFunction<bool> { }
|
||||
}
|
||||
}
|
||||
|
@ -3,4 +3,4 @@ using UnityEngine;
|
||||
namespace UnityAtoms
|
||||
{
|
||||
public abstract class BoolGameObjectFunction : GameFunction<bool, GameObject> { }
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,4 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityAtoms
|
||||
{
|
||||
public abstract class BoolIntFunction : GameFunction<bool, int> { }
|
||||
}
|
||||
}
|
||||
|
@ -3,4 +3,4 @@ using UnityEngine;
|
||||
namespace UnityAtoms
|
||||
{
|
||||
public abstract class BoolVector2Function : GameFunction<bool, Vector2> { }
|
||||
}
|
||||
}
|
||||
|
@ -3,4 +3,4 @@ using UnityEngine;
|
||||
namespace UnityAtoms
|
||||
{
|
||||
public abstract class BoolVector3Function : GameFunction<bool, Vector3> { }
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,4 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityAtoms
|
||||
{
|
||||
public abstract class BoolVoidFunction : GameFunction<bool, Void> { }
|
||||
}
|
||||
}
|
||||
|
@ -3,4 +3,4 @@ using UnityEngine;
|
||||
namespace UnityAtoms
|
||||
{
|
||||
public abstract class GameObjectFunction : GameFunction<GameObject> { }
|
||||
}
|
||||
}
|
||||
|
@ -3,4 +3,4 @@ using UnityEngine;
|
||||
namespace UnityAtoms
|
||||
{
|
||||
public abstract class GameObjectGameObjectFunction : GameFunction<GameObject, GameObject> { }
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityAtoms
|
||||
{
|
||||
public abstract class GameObjectVector3QuaternionFunction : GameFunction<GameObject, Vector3, Quaternion> { }
|
||||
}
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityAtoms
|
||||
{
|
||||
public abstract class GameObjectVector3QuaternionFunction : GameFunction<GameObject, Vector3, Quaternion> { }
|
||||
}
|
||||
|
@ -1,6 +1,4 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityAtoms
|
||||
{
|
||||
public abstract class IntFunction : GameFunction<int> { }
|
||||
}
|
||||
namespace UnityAtoms
|
||||
{
|
||||
public abstract class IntFunction : GameFunction<int> { }
|
||||
}
|
||||
|
@ -1,5 +1,3 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityAtoms
|
||||
@ -33,4 +31,4 @@ namespace UnityAtoms
|
||||
{
|
||||
public abstract R Call(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,4 +3,4 @@ using UnityEngine;
|
||||
namespace UnityAtoms
|
||||
{
|
||||
public abstract class GameObjectAction : GameAction<GameObject> { }
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,7 @@
|
||||
using UnityEngine;
|
||||
using UnityAtoms.Utils;
|
||||
|
||||
namespace UnityAtoms
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/GameObject/Event", fileName = "GameObjectEvent", order = CreateAssetMenuUtils.Order.EVENT)]
|
||||
public class GameObjectEvent : GameEvent<GameObject> { }
|
||||
}
|
||||
}
|
||||
|
@ -5,4 +5,4 @@ namespace UnityAtoms
|
||||
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/GameObject/Event x 2", fileName = "GameObjectGameObjectEvent", order = CreateAssetMenuUtils.Order.EVENTx2)]
|
||||
public class GameObjectGameObjectEvent : GameEvent<GameObject, GameObject> { }
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,7 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityAtoms
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/GameObject/List", fileName = "GameObjectList", order = CreateAssetMenuUtils.Order.LIST)]
|
||||
public class GameObjectList : ScriptableObjectList<GameObject, GameObjectEvent> { }
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace UnityAtoms
|
||||
{
|
||||
public abstract class GameObjectListAction : GameAction<GameObjectList> { }
|
||||
}
|
||||
}
|
||||
|
@ -5,4 +5,4 @@ namespace UnityAtoms
|
||||
{
|
||||
[Serializable]
|
||||
public class GameObjectReference : ScriptableObjectReference<GameObject, GameObjectVariable, GameObjectEvent, GameObjectGameObjectEvent> { }
|
||||
}
|
||||
}
|
||||
|
@ -10,4 +10,4 @@ namespace UnityAtoms
|
||||
return (first == null && second == null) || first != null && second != null && first.GetInstanceID() == second.GetInstanceID();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,4 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine;
|
||||
using UnityAtoms.Extensions;
|
||||
#if UNITY_EDITOR
|
||||
using UnityAtoms.Logger;
|
||||
|
@ -4,4 +4,4 @@ namespace UnityAtoms
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/GameObject/Set Variable", fileName = "SetGameObjectVariableValueAction", order = CreateAssetMenuUtils.Order.SET_VARIABLE)]
|
||||
public class SetGameObjectVariableValue : SetVariableValue<GameObject, GameObjectVariable, GameObjectReference, GameObjectEvent, GameObjectGameObjectEvent> { }
|
||||
}
|
||||
}
|
||||
|
@ -6,4 +6,4 @@ namespace UnityAtoms
|
||||
{
|
||||
[Serializable]
|
||||
public class UnityGameObjectEvent : UnityEvent<GameObject> { }
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace UnityAtoms
|
||||
{
|
||||
public abstract class IntAction : GameAction<int> { }
|
||||
}
|
||||
}
|
||||
|
@ -4,4 +4,4 @@ namespace UnityAtoms
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Int/Constant", fileName = "IntConstant", order = CreateAssetMenuUtils.Order.CONSTANT)]
|
||||
public class IntConstant : ScriptableObjectVariableBase<int> { }
|
||||
}
|
||||
}
|
||||
|
@ -4,4 +4,4 @@ namespace UnityAtoms
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Int/Event", fileName = "IntEvent", order = CreateAssetMenuUtils.Order.EVENT)]
|
||||
public class IntEvent : GameEvent<int> { }
|
||||
}
|
||||
}
|
||||
|
@ -5,4 +5,4 @@ namespace UnityAtoms
|
||||
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Int/Event x 2", fileName = "IntIntEvent", order = CreateAssetMenuUtils.Order.EVENTx2)]
|
||||
public class IntIntEvent : GameEvent<int, int> { }
|
||||
}
|
||||
}
|
||||
|
@ -4,4 +4,4 @@ namespace UnityAtoms
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Unity Atoms/Int/List", fileName = "IntList", order = CreateAssetMenuUtils.Order.LIST)]
|
||||
public class IntList : ScriptableObjectList<int, IntEvent> { }
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,7 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityAtoms
|
||||
{
|
||||
[Serializable]
|
||||
public class IntReference : ScriptableObjectReference<int, IntVariable, IntEvent, IntIntEvent> { }
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user