少年修仙传客户端代码仓库
hch
2025-07-24 50e53441950268933694eeb5aad36147bbe1014d
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using UnityEngine;
 
public class Idle_0 : SMB_Base
{
    private float m_LastDanceTime;
 
    protected override void OnEnter(GActor owner, Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        base.OnEnter(owner, animator, stateInfo, layerIndex);
        m_LastDanceTime = Time.time;
    }
 
    protected override void OnUpdate(GActor owner, Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        base.OnUpdate(owner, animator, stateInfo, layerIndex);
 
        GA_Pet _pet = owner as GA_Pet;
        if (_pet != null)
        {
            if (Time.time - m_LastDanceTime > GeneralDefine.PetDanceInterval)
            {
                _pet.Play(GAStaticDefine.State_Dance);
                m_LastDanceTime = Time.time;
            }
        }
        else
        {
 
            GA_NpcFunc _funcNpc = owner as GA_NpcFunc;
            if (_funcNpc != null && _funcNpc.NpcConfig.NPCType == 0)
            {
                if (Time.time - m_LastDanceTime > GeneralDefine.FuncNpcDanceInterval)
                {
                    _funcNpc.Play(GAStaticDefine.State_Dance);
                    m_LastDanceTime = Time.time;
                }
            }
        }
    }
 
    protected override void OnExit(GActor owner, Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        base.OnExit(owner, animator, stateInfo, layerIndex);
    }
}