blob: a7a9843b483379d7b3888d41133f3d9b9286d4c2 (
plain)
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
|
using UnityEngine;
namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator
{
[TaskCategory("Basic/Animator")]
[TaskDescription("Converts the state name to its corresponding hash code. Returns Success.")]
public class GetStringToHash : Action
{
[Tooltip("The name of the state to convert to a hash code")]
public SharedString stateName;
[Tooltip("The hash value")]
[RequiredField]
public SharedInt storeValue;
public override TaskStatus OnUpdate()
{
storeValue.Value = Animator.StringToHash(stateName.Value);
return TaskStatus.Success;
}
public override void OnReset()
{
stateName = "";
storeValue = 0;
}
}
}
|