chenxin
2020-10-31 a1f0653ec48d7787e0d57cabef0600b2a07355eb
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Core.Utilities;
 
/**
 * 无尽模式boss控制器
 * @Author: chenxin
 * @Date: 2020-10-30 16:40:54
 */
namespace KTGMGemClient
{
    public class EndlessBossCtrl : Singleton<EndlessBossCtrl>
    {
        /// <summary>
        /// boss动作
        /// </summary>
        public Animator BossAnimator;
 
        /// <summary>
        /// 动作状态
        /// </summary>
        public EndlessBossActionState ActionState { get; set; }
 
        // Start is called before the first frame update
        private void Start()
        {
 
        }
 
        // Update is called once per frame
        private void Update()
        {
 
        }
 
        /// <summary>
        /// 帧事件
        /// </summary>
        /// <param name="frameName"></param>
        public void FireAnimationEvent(string frameName)
        {
            if (frameName == "summonEnd")
            {
                EventCenter.Ins.BroadCast((int)EventType.EndlessBossSummonEnd);
            }
        }
 
        /// <summary>
        /// 切换状态
        /// </summary>
        /// <param name="newState"></param>
        public void ChangeState(EndlessBossActionState newState)
        {
            if (newState == ActionState) return;
 
            ActionState = newState;
            BossAnimator.SetInteger("State", (int)newState);
        }
    }
}