(client) feat:添加临时动画组件,添加逃跑逻辑
This commit is contained in:
19
Client/Assets/Scripts/Prefab/TemporaryAnimatorImageUI.cs
Normal file
19
Client/Assets/Scripts/Prefab/TemporaryAnimatorImageUI.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Prefab
|
||||
{
|
||||
public class TemporaryAnimatorImageUI:TemporaryAnimator
|
||||
{
|
||||
public UIImageAnimator imageAnimator;
|
||||
|
||||
public void Init(Sprite[] sprite,float fps=3)
|
||||
{
|
||||
if (imageAnimator == null)
|
||||
imageAnimator = GetComponentInChildren<UIImageAnimator>();
|
||||
if (!imageAnimator) return;
|
||||
imageAnimator.SetSprites(sprite);
|
||||
imageAnimator.SetFPS(fps);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user