-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from ashblue/develop
Release
- Loading branch information
Showing
244 changed files
with
14,898 additions
and
304 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!114 &11400000 | ||
MonoBehaviour: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 0} | ||
m_Enabled: 1 | ||
m_EditorHideFlags: 0 | ||
m_Script: {fileID: 11500000, guid: b812d3dc4a4444adae812adfa041ca88, type: 3} | ||
m_Name: CharacterA | ||
m_EditorClassIdentifier: | ||
collection: {fileID: 11400000, guid: 0cda059b3069840fe94a9480fa84c45c, type: 2} | ||
overrides: | ||
overrides: | ||
- definition: {fileID: 11400000, guid: 3cf3e661c93fb496ca382be87b943584, type: 2} | ||
value: | ||
_valueInt: | ||
value: 5 | ||
_valueIntCurve: | ||
value: | ||
serializedVersion: 2 | ||
m_Curve: [] | ||
m_PreInfinity: 2 | ||
m_PostInfinity: 2 | ||
m_RotationOrder: 4 | ||
_valueFloat: | ||
value: 0 | ||
_valueFloatCurve: | ||
value: | ||
serializedVersion: 2 | ||
m_Curve: [] | ||
m_PreInfinity: 2 | ||
m_PostInfinity: 2 | ||
m_RotationOrder: 4 | ||
type: 0 | ||
- definition: {fileID: 11400000, guid: 27355736af3274d11a63b95b6a5a14cf, type: 2} | ||
value: | ||
_valueInt: | ||
value: 20 | ||
_valueIntCurve: | ||
value: | ||
serializedVersion: 2 | ||
m_Curve: [] | ||
m_PreInfinity: 2 | ||
m_PostInfinity: 2 | ||
m_RotationOrder: 4 | ||
_valueFloat: | ||
value: 0 | ||
_valueFloatCurve: | ||
value: | ||
serializedVersion: 2 | ||
m_Curve: [] | ||
m_PreInfinity: 2 | ||
m_PostInfinity: 2 | ||
m_RotationOrder: 4 | ||
type: 0 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!114 &11400000 | ||
MonoBehaviour: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInternal: {fileID: 0} | ||
m_GameObject: {fileID: 0} | ||
m_Enabled: 1 | ||
m_EditorHideFlags: 0 | ||
m_Script: {fileID: 11500000, guid: b812d3dc4a4444adae812adfa041ca88, type: 3} | ||
m_Name: CharacterB | ||
m_EditorClassIdentifier: | ||
collection: {fileID: 11400000, guid: 0cda059b3069840fe94a9480fa84c45c, type: 2} | ||
overrides: | ||
overrides: | ||
- definition: {fileID: 11400000, guid: 3cf3e661c93fb496ca382be87b943584, type: 2} | ||
value: | ||
_valueInt: | ||
value: 5 | ||
_valueIntCurve: | ||
value: | ||
serializedVersion: 2 | ||
m_Curve: [] | ||
m_PreInfinity: 2 | ||
m_PostInfinity: 2 | ||
m_RotationOrder: 4 | ||
_valueFloat: | ||
value: 0 | ||
_valueFloatCurve: | ||
value: | ||
serializedVersion: 2 | ||
m_Curve: [] | ||
m_PreInfinity: 2 | ||
m_PostInfinity: 2 | ||
m_RotationOrder: 4 | ||
type: 0 | ||
- definition: {fileID: 11400000, guid: 27355736af3274d11a63b95b6a5a14cf, type: 2} | ||
value: | ||
_valueInt: | ||
value: 20 | ||
_valueIntCurve: | ||
value: | ||
serializedVersion: 2 | ||
m_Curve: [] | ||
m_PreInfinity: 2 | ||
m_PostInfinity: 2 | ||
m_RotationOrder: 4 | ||
_valueFloat: | ||
value: 0 | ||
_valueFloatCurve: | ||
value: | ||
serializedVersion: 2 | ||
m_Curve: [] | ||
m_PreInfinity: 2 | ||
m_PostInfinity: 2 | ||
m_RotationOrder: 4 | ||
type: 0 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
using CleverCrow.Fluid.StatsSystem.Editors; | ||
using CleverCrow.Fluid.StatsSystem.StatsContainers; | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
namespace CleverCrow.Fluid.StatsSystem { | ||
[RequireComponent(typeof(StatsContainerExample))] | ||
public class CharacterExample : MonoBehaviour { | ||
private StatsContainer stats; | ||
|
||
[SerializeField] | ||
private Slider healthBar; | ||
|
||
void Start () { | ||
stats = GetComponent<StatsContainerExample>().copy; | ||
|
||
var health = stats.GetStat("health"); | ||
healthBar.maxValue = health; | ||
healthBar.value = health; | ||
} | ||
|
||
void Update () { | ||
healthBar.maxValue = stats.GetStat("health"); | ||
} | ||
|
||
public void ReceiveDamage (int damage) { | ||
healthBar.value -= Mathf.Max(0, damage - stats.GetStat("armor")); | ||
|
||
if (healthBar.value < 1) { | ||
Destroy(gameObject); | ||
} | ||
} | ||
|
||
public void AttackTarget (CharacterExample target) { | ||
if (target == null) return; | ||
|
||
target.ReceiveDamage((int)stats.GetStat("attack")); | ||
} | ||
|
||
public void AddHealth (float amount) { | ||
var health = stats.GetModifier(OperatorType.Add, "health", "example"); | ||
stats.SetModifier(OperatorType.Add, "health", "example", health + amount); | ||
} | ||
|
||
public void RemoveHealth (float amount) { | ||
var health = stats.GetModifier(OperatorType.Subtract, "health", "example"); | ||
stats.SetModifier(OperatorType.Subtract, "health", "example", health + amount); | ||
} | ||
|
||
public void MultiplyHealth (float amount) { | ||
var health = stats.GetModifier(OperatorType.Multiply, "health", "example"); | ||
stats.SetModifier(OperatorType.Multiply, "health", "example", health + amount); | ||
} | ||
|
||
public void DivideHealth (float amount) { | ||
var health = stats.GetModifier(OperatorType.Divide, "health", "example"); | ||
stats.SetModifier(OperatorType.Divide, "health", "example", health + amount); | ||
} | ||
|
||
public void RefillHealth () { | ||
healthBar.value = healthBar.maxValue; | ||
} | ||
|
||
public void ClearAll () { | ||
stats.ClearAllModifiers(stats.GetRecord("health"), "example"); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.