-
Notifications
You must be signed in to change notification settings - Fork 202
/
FloatVariable.cs
41 lines (35 loc) · 940 Bytes
/
FloatVariable.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// ----------------------------------------------------------------------------
// Unite 2017 - Game Architecture with Scriptable Objects
//
// Author: Ryan Hipple
// Date: 10/04/17
// ----------------------------------------------------------------------------
using UnityEngine;
namespace RoboRyanTron.Unite2017.Variables
{
[CreateAssetMenu]
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;
}
}
}