Use ResetValue in example scene

This commit is contained in:
AdamRamberg 2019-09-30 23:05:13 +02:00
parent e732dad66a
commit 8c8bc5fb81
4 changed files with 35 additions and 6 deletions

View File

@ -9,11 +9,8 @@ MonoBehaviour:
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 95d65c506b2924c1aa582cd252c7ed17, type: 3}
m_Script: {fileID: 11500000, guid: c46649faf19d34725b64762f8ad7e76c, type: 3}
m_Name: ResetHealth
m_EditorClassIdentifier:
_variable: {fileID: 11400000, guid: 30c71ebe6587c4fe8b18d5279710b4dc, type: 2}
_value:
UseConstant: 1
ConstantValue: 100
Variable: {fileID: 0}
_developerDescription:
_variable: {fileID: 0}

View File

@ -0,0 +1,17 @@
using UnityEngine;
using UnityEngine.Serialization;
namespace UnityAtoms.Examples
{
[CreateAssetMenu(menuName = "Unity Atoms/Examples/Intro/Reset Health", fileName = "ResetHealth")]
public class ResetHealth : VoidAction
{
[SerializeField]
private IntVariable _variable = null;
public override void Do()
{
_variable.ResetValue(true);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c46649faf19d34725b64762f8ad7e76c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -635,6 +635,10 @@
{
"AssetPath": "Packages/com.mambojambostudios.unity-atoms-src/Constants/GameObjectConstant.cs",
"IconPath": "Packages/com.mambojambostudios.unity-atoms-src/IconMap/atom-icon-teal.png"
},
{
"AssetPath": "Assets/Examples/Intro/UI/ResetHealthButton/ResetHealth.cs",
"IconPath": "Packages/com.mambojambostudios.unity-atoms-src/IconMap/atom-icon-purple.png"
}
]
}