回到 Animator深入系列总目录

 

Animator的SetFloat接口可以设置阻尼,并且4种类型变量只有float是支持阻尼的。

public void SetFloat(int id, float value, float dampTime, float deltaTime);

 

 

当设置阻尼为0.2时

if (direction > 0) direction = 1;
else direction = 0;
Debug.Log("Direction: " + direction);
animator.SetFloat("Direction", direction, 0.2f, Time.deltaTime);

 

测试结果

Unity-Animato深入系列---FloatValue阻尼

 

 

当设置阻尼为0时

if (direction > 0) direction = 1;
else direction = 0;
Debug.Log("Direction: " + direction);
animator.SetFloat("Direction", direction, 0, Time.deltaTime);

 

Unity-Animato深入系列---FloatValue阻尼

相关文章:

  • 2021-08-11
  • 2022-12-23
  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
  • 2021-07-06
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案