mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-22 08:08:51 -05:00
Re add accidently deleted stuff
This commit is contained in:
parent
88ae9f8b9b
commit
05d3549dce
@ -25,7 +25,7 @@ namespace UnityAtoms.BaseAtoms
|
|||||||
public bool Equals(Collider2DReference other) { return base.Equals(other); }
|
public bool Equals(Collider2DReference other) { return base.Equals(other); }
|
||||||
protected override bool ValueEquals(Collider2D other)
|
protected override bool ValueEquals(Collider2D other)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
return (this.Value == null && other == null) || this.Value != null && other != null && this.Value == other;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ namespace UnityAtoms.BaseAtoms
|
|||||||
public bool Equals(ColliderReference other) { return base.Equals(other); }
|
public bool Equals(ColliderReference other) { return base.Equals(other); }
|
||||||
protected override bool ValueEquals(Collider other)
|
protected override bool ValueEquals(Collider other)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
return (this.Value == null && other == null) || this.Value != null && other != null && this.Value == other;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ namespace UnityAtoms.BaseAtoms
|
|||||||
public bool Equals(GameObjectReference other) { return base.Equals(other); }
|
public bool Equals(GameObjectReference other) { return base.Equals(other); }
|
||||||
protected override bool ValueEquals(GameObject other)
|
protected override bool ValueEquals(GameObject other)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
return (this.Value == null && other == null) || this.Value != null && other != null && this.Value.GetInstanceID() == other.GetInstanceID();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ namespace UnityAtoms.BaseAtoms
|
|||||||
{
|
{
|
||||||
protected override bool ValueEquals(Collider2D other)
|
protected override bool ValueEquals(Collider2D other)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
return (_value == null && other == null) || _value != null && other != null && _value == other;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ namespace UnityAtoms.BaseAtoms
|
|||||||
{
|
{
|
||||||
protected override bool ValueEquals(Collider other)
|
protected override bool ValueEquals(Collider other)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
return (_value == null && other == null) || _value != null && other != null && _value == other;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,5 +7,18 @@ namespace UnityAtoms.BaseAtoms
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[EditorIcon("atom-icon-lush")]
|
[EditorIcon("atom-icon-lush")]
|
||||||
[CreateAssetMenu(menuName = "Unity Atoms/Variables/Color", fileName = "ColorVariable")]
|
[CreateAssetMenu(menuName = "Unity Atoms/Variables/Color", fileName = "ColorVariable")]
|
||||||
public sealed class ColorVariable : EquatableAtomVariable<Color, ColorPair, ColorEvent, ColorPairEvent, ColorColorFunction> { }
|
public sealed class ColorVariable : EquatableAtomVariable<Color, ColorPair, ColorEvent, ColorPairEvent, ColorColorFunction>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Set Alpha of Color by value.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value">New alpha value.</param>
|
||||||
|
public void SetAlpha(float value) => Value = new Color(Value.r, Value.g, Value.b, value);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set Alpha of Color by Variable value.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="variable">New alpha Variable value.</param>
|
||||||
|
public void SetAlpha(AtomBaseVariable<float> variable) => SetAlpha(variable.Value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,5 +7,54 @@ namespace UnityAtoms.BaseAtoms
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[EditorIcon("atom-icon-lush")]
|
[EditorIcon("atom-icon-lush")]
|
||||||
[CreateAssetMenu(menuName = "Unity Atoms/Variables/Float", fileName = "FloatVariable")]
|
[CreateAssetMenu(menuName = "Unity Atoms/Variables/Float", fileName = "FloatVariable")]
|
||||||
public sealed class FloatVariable : EquatableAtomVariable<float, FloatPair, FloatEvent, FloatPairEvent, FloatFloatFunction> { }
|
public sealed class FloatVariable : EquatableAtomVariable<float, FloatPair, FloatEvent, FloatPairEvent, FloatFloatFunction>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Add value to Variable.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value">Value to add.</param>
|
||||||
|
public void Add(float value) => Value += value;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Add variable value to Variable.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="variable">Variable with value to add.</param>
|
||||||
|
public void Add(AtomBaseVariable<float> variable) => Add(variable.Value);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Subtract value from Variable.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value">Value to subtract.</param>
|
||||||
|
public void Subtract(float value) => Value -= value;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Subtract variable value from Variable.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="variable">Variable with value to subtract.</param>
|
||||||
|
public void Subtract(AtomBaseVariable<float> variable) => Subtract(variable.Value);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Multiply variable by value.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value">Value to multiple by.</param>
|
||||||
|
public void MultiplyBy(float value) => Value *= value;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Multiply variable by Variable value.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="variable">Variable with value to multiple by.</param>
|
||||||
|
public void MultiplyBy(AtomBaseVariable<float> variable) => MultiplyBy(variable.Value);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Divide Variable by value.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value">Value to divide by.</param>
|
||||||
|
public void DivideBy(float value) => Value /= value;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Divide Variable by Variable value.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="variable">Variable value to divide by.</param>
|
||||||
|
public void DivideBy(AtomBaseVariable<float> variable) => DivideBy(variable.Value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ namespace UnityAtoms.BaseAtoms
|
|||||||
{
|
{
|
||||||
protected override bool ValueEquals(GameObject other)
|
protected override bool ValueEquals(GameObject other)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
return (_value == null && other == null) || _value != null && other != null && _value.GetInstanceID() == other.GetInstanceID();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,5 +7,54 @@ namespace UnityAtoms.BaseAtoms
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[EditorIcon("atom-icon-lush")]
|
[EditorIcon("atom-icon-lush")]
|
||||||
[CreateAssetMenu(menuName = "Unity Atoms/Variables/Int", fileName = "IntVariable")]
|
[CreateAssetMenu(menuName = "Unity Atoms/Variables/Int", fileName = "IntVariable")]
|
||||||
public sealed class IntVariable : EquatableAtomVariable<int, IntPair, IntEvent, IntPairEvent, IntIntFunction> { }
|
public sealed class IntVariable : EquatableAtomVariable<int, IntPair, IntEvent, IntPairEvent, IntIntFunction>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Add value to Variable.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value">Value to add.</param>
|
||||||
|
public void Add(int value) => Value += value;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Add variable value to Variable.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="variable">Variable with value to add.</param>
|
||||||
|
public void Add(AtomBaseVariable<int> variable) => Add(variable.Value);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Subtract value from Variable.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value">Value to subtract.</param>
|
||||||
|
public void Subtract(int value) => Value -= value;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Subtract variable value from Variable.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="variable">Variable with value to subtract.</param>
|
||||||
|
public void Subtract(AtomBaseVariable<int> variable) => Subtract(variable.Value);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Multiply variable by value.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value">Value to multiple by.</param>
|
||||||
|
public void MultiplyBy(int value) => Value *= value;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Multiply variable by Variable value.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="variable">Variable with value to multiple by.</param>
|
||||||
|
public void MultiplyBy(AtomBaseVariable<int> variable) => MultiplyBy(variable.Value);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Divide Variable by value.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value">Value to divide by.</param>
|
||||||
|
public void DivideBy(int value) => Value /= value;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Divide Variable by Variable value.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="variable">Variable value to divide by.</param>
|
||||||
|
public void DivideBy(AtomBaseVariable<int> variable) => DivideBy(variable.Value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,5 +7,30 @@ namespace UnityAtoms.BaseAtoms
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[EditorIcon("atom-icon-lush")]
|
[EditorIcon("atom-icon-lush")]
|
||||||
[CreateAssetMenu(menuName = "Unity Atoms/Variables/Vector2", fileName = "Vector2Variable")]
|
[CreateAssetMenu(menuName = "Unity Atoms/Variables/Vector2", fileName = "Vector2Variable")]
|
||||||
public sealed class Vector2Variable : EquatableAtomVariable<Vector2, Vector2Pair, Vector2Event, Vector2PairEvent, Vector2Vector2Function> { }
|
public sealed class Vector2Variable : EquatableAtomVariable<Vector2, Vector2Pair, Vector2Event, Vector2PairEvent, Vector2Vector2Function>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Multiply variable by value.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value">Value to multiple by.</param>
|
||||||
|
public void MultiplyBy(float value) => Value *= value;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Multiply variable by Variable value.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="variable">Variable with value to multiple by.</param>
|
||||||
|
public void MultiplyBy(AtomBaseVariable<float> variable) => MultiplyBy(variable.Value);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Divide Variable by value.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value">Value to divide by.</param>
|
||||||
|
public void DivideBy(float value) => Value /= value;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Divide Variable by Variable value.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="variable">Variable value to divide by.</param>
|
||||||
|
public void DivideBy(AtomBaseVariable<float> variable) => DivideBy(variable.Value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,5 +7,30 @@ namespace UnityAtoms.BaseAtoms
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[EditorIcon("atom-icon-lush")]
|
[EditorIcon("atom-icon-lush")]
|
||||||
[CreateAssetMenu(menuName = "Unity Atoms/Variables/Vector3", fileName = "Vector3Variable")]
|
[CreateAssetMenu(menuName = "Unity Atoms/Variables/Vector3", fileName = "Vector3Variable")]
|
||||||
public sealed class Vector3Variable : EquatableAtomVariable<Vector3, Vector3Pair, Vector3Event, Vector3PairEvent, Vector3Vector3Function> { }
|
public sealed class Vector3Variable : EquatableAtomVariable<Vector3, Vector3Pair, Vector3Event, Vector3PairEvent, Vector3Vector3Function>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Multiply variable by value.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value">Value to multiple by.</param>
|
||||||
|
public void MultiplyBy(float value) => Value *= value;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Multiply variable by Variable value.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="variable">Variable with value to multiple by.</param>
|
||||||
|
public void MultiplyBy(AtomBaseVariable<float> variable) => MultiplyBy(variable.Value);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Divide Variable by value.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value">Value to divide by.</param>
|
||||||
|
public void DivideBy(float value) => Value /= value;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Divide Variable by Variable value.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="variable">Variable value to divide by.</param>
|
||||||
|
public void DivideBy(AtomBaseVariable<float> variable) => DivideBy(variable.Value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user