少年修仙传客户端代码仓库
lcy
3 天以前 6d8908e1fcfb62e174d1fa60eb6aa31f65dff3e1
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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
 
public class DebugHeroTarget : MonoBehaviour
{
    [SerializeField] Text m_Content;
    float timer = 0.5f;
 
    private void LateUpdate()
    {
        timer += Time.deltaTime;
        if (timer > 0.5f)
        {
            timer = 0f;
            if (PlayerDatas.Instance.hero != null && PlayerDatas.Instance.hero.SelectTarget != null)
            {
                var target = PlayerDatas.Instance.hero.SelectTarget;
                int _npcID = 0;
                if (target is GActorNpcFight)
                {
                    _npcID = (target as GActorNpcFight).NpcConfig.NPCID;
                }
                else if (target is GActorNpcNoFight)
                {
                    _npcID = (target as GActorNpcNoFight).NpcConfig.NPCID;
                }
                uint _sid = target.ServerInstID;
                if (PersonalEnemy.m_CBinSdDict.ContainsKey(_sid))
                {
                    _sid = PersonalEnemy.m_CBinSdDict[_sid];
                }
                m_Content.text = StringUtility.Contact("O:", _sid, "---", "N:", _npcID);
            }
            else
            {
                m_Content.text = "";
            }
        }
    }
}