Skip to content

Commit ccf29a6

Browse files
author
krzysztof biernat
committed
Craete event vars
1 parent 78bb40f commit ccf29a6

13 files changed

+190
-0
lines changed

Runtime/Variables/EventVars.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using UnityEngine;
2+
3+
namespace GTVariable
4+
{
5+
[CreateAssetMenu(menuName = "ScriptableVars/EventVars/Bool")]
6+
public class BoolEventVariable : BoolVariable
7+
{
8+
public GameEvent valueChaged;
9+
10+
public override void SetValue(bool value)
11+
{
12+
base.SetValue(value);
13+
if (valueChaged != null)
14+
{
15+
valueChaged.Raise();
16+
}
17+
}
18+
}
19+
}

Runtime/Variables/EventVars/BoolEventVariable.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using UnityEngine;
2+
3+
namespace GTVariable
4+
{
5+
[CreateAssetMenu(menuName = "ScriptableVars/EventVars/Color")]
6+
public class ColorEventVariable : ColorVariable
7+
{
8+
public GameEvent valueChaged;
9+
10+
public override void SetValue(Color value)
11+
{
12+
base.SetValue(value);
13+
if (valueChaged != null)
14+
{
15+
valueChaged.Raise();
16+
}
17+
}
18+
}
19+
}

Runtime/Variables/EventVars/ColorEventVariable.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System.Collections;
2+
using System.Collections.Generic;
3+
using UnityEngine;
4+
5+
namespace GTVariable
6+
{
7+
[CreateAssetMenu(menuName = "ScriptableVars/EventVars/Float")]
8+
public class FloatEventVariable : FloatVariable
9+
{
10+
public GameEvent valueChaged;
11+
12+
public override void SetValue(float value)
13+
{
14+
base.SetValue(value);
15+
if (valueChaged != null)
16+
{
17+
valueChaged.Raise();
18+
}
19+
}
20+
}
21+
}

Runtime/Variables/EventVars/FloatEventVariable.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using UnityEngine;
2+
3+
namespace GTVariable
4+
{
5+
[CreateAssetMenu(menuName = "ScriptableVars/EventVars/Gradient")]
6+
public class GradientEventVariable : GradientVariable
7+
{
8+
public GameEvent valueChaged;
9+
10+
public override void SetValue(UnityEngine.Gradient value)
11+
{
12+
base.SetValue(value);
13+
if (valueChaged != null)
14+
{
15+
valueChaged.Raise();
16+
}
17+
}
18+
}
19+
}

Runtime/Variables/EventVars/GradientEventVariable.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using UnityEngine;
2+
3+
namespace GTVariable
4+
{
5+
[CreateAssetMenu(menuName = "ScriptableVars/EventVars/Int")]
6+
public class IntEventVariable : IntVariable
7+
{
8+
public GameEvent valueChaged;
9+
10+
public override void SetValue(int value)
11+
{
12+
base.SetValue(value);
13+
if (valueChaged != null)
14+
{
15+
valueChaged.Raise();
16+
}
17+
}
18+
}
19+
}

0 commit comments

Comments
 (0)