浏览代码

simplify state change

/main
Laurent 5 年前
当前提交
efa84743
共有 1 个文件被更改,包括 4 次插入17 次删除
  1. 21
      Runtime/LevelScripting/Actions/SetAnimatorParameterAction.cs

21
Runtime/LevelScripting/Actions/SetAnimatorParameterAction.cs


public Animator animator;
public string parameterName;
[OnValueChanged("OnParameterTypeChanged")]
public AnimatorParameterType parameterType;
public AnimatorParameterType parameterType = AnimatorParameterType.Bool;
bool showFloat;
bool showInt;

private void OnParameterTypeChanged()
{
showBool = false;
showFloat = false;
showInt = false;
switch (parameterType)
{
case AnimatorParameterType.Bool:
showBool = true;
break;
case AnimatorParameterType.Float:
showFloat = true;
break;
case AnimatorParameterType.Int:
showInt = true;
break;
}
showbool = (parameterType == AnimatorParameterType.Bool);
showFloat = (parameterType == AnimatorParameterType.Float);
showInt = (parameterType == AnimatorParameterType.Int);
}
}
}
正在加载...
取消
保存