zip压缩加载测试
This commit is contained in:
52
Assets/Main/Script/Runtime/kkController/fsm/KKFsmSystem.cs
Normal file
52
Assets/Main/Script/Runtime/kkController/fsm/KKFsmSystem.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using DG.Tweening;
|
||||
using Stary.Evo;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Main
|
||||
{
|
||||
public class KKFsmSystem : FsmSystem, IFsmSystem
|
||||
{
|
||||
public GameObject kk;
|
||||
|
||||
public Animator animator;
|
||||
public Image image;
|
||||
public Text text;
|
||||
public KKFsmSystem(GameObject kk)
|
||||
{
|
||||
this.kk = kk;
|
||||
this.animator = kk.GetComponentInChildren<Animator>();
|
||||
this.image = kk.GetComponentInChildren<Image>();
|
||||
this.image.color = new Color(1, 1, 1, 0);
|
||||
this.text = kk.GetComponentInChildren<Text>();
|
||||
this.text.color = new Color(1, 1, 1, 0);
|
||||
}
|
||||
|
||||
public void OpenImage()
|
||||
{
|
||||
this.image.DOFade(1, 1f);
|
||||
}
|
||||
|
||||
public void CloseImage()
|
||||
{
|
||||
this.image.DOFade(0, 1f);
|
||||
}
|
||||
|
||||
public void OpenText()
|
||||
{
|
||||
this.text.DOFade(1, 1f);
|
||||
}
|
||||
|
||||
public void CloseText()
|
||||
{
|
||||
this.text.DOFade(0, 1f);
|
||||
}
|
||||
|
||||
public float GetAnimationProgress(int layerIndex = 0)
|
||||
{
|
||||
if (animator == null) return 0;
|
||||
AnimatorStateInfo stateInfo = animator.GetCurrentAnimatorStateInfo(layerIndex);
|
||||
return stateInfo.normalizedTime % 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user