2019-04-07 10:03:16 -04:00
|
|
|
using UnityEngine;
|
2018-10-30 15:05:06 -04:00
|
|
|
|
|
|
|
namespace UnityAtoms
|
|
|
|
{
|
2019-10-15 16:34:08 -04:00
|
|
|
/// <summary>
|
2020-02-16 06:44:46 -05:00
|
|
|
/// Variable of type `Vector2`. Inherits from `EquatableAtomVariable<Vector2, Vector2Event, Vector2Vector2Event, Vector2Vector2Function>`.
|
2019-10-15 16:34:08 -04:00
|
|
|
/// </summary>
|
2019-10-14 10:51:54 -04:00
|
|
|
[EditorIcon("atom-icon-lush")]
|
2019-05-29 12:52:27 -04:00
|
|
|
[CreateAssetMenu(menuName = "Unity Atoms/Variables/Vector2", fileName = "Vector2Variable")]
|
2020-02-23 17:07:49 -05:00
|
|
|
public sealed class Vector2Variable : EquatableAtomVariable<Vector2, Vector2Event, Vector2Vector2Event, 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);
|
|
|
|
}
|
2019-04-07 05:10:09 -04:00
|
|
|
}
|