少年修仙传客户端代码仓库
client_linchunjie
2018-10-25 c8d37bd5866c8ea4fba04fd2bb97ba260ef16dc2
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Snxxz.UI
{
    public class PlayerDetails
    {
        public static Vector2 targetPos;
        public static OpenType openType { get; private set; }
        public static event Action<DetailType> onClickFuncEvent;
 
        public static void ShowPlayerDetails(int _playerId, Action<DetailType> _func, OpenType _type = OpenType.Default)
        {
            openType = _type;
            onClickFuncEvent = _func;
            DTCB309_tagGCAnswerPlayerShortInfo.OnPlayerShortInfoEvent -= OnPlayerShortInfoEvent;
            DTCB309_tagGCAnswerPlayerShortInfo.OnPlayerShortInfoEvent += OnPlayerShortInfoEvent;
            CB306_tagCGViewPlayerShortInfo _pak = new CB306_tagCGViewPlayerShortInfo();
            _pak.PlayerID = (uint)_playerId;
            GameNetSystem.Instance.SendInfo(_pak);
            RectTransformUtility.ScreenPointToLocalPointInRectangle(WindowCenter.Instance.uiRoot.tipsCanvas, Input.mousePosition, WindowCenter.Instance.uiRoot.uicamera, out targetPos);
        }
 
        private static void OnPlayerShortInfoEvent(HB309_tagGCAnswerPlayerShortInfo _package)
        {
            PlayerID = (int)_package.PlayerID;
            LV = _package.LV;
            Job = _package.Job;
            OnlineType = _package.OnlineType;
            RealmLV = _package.RealmLV;
            PlayerName = _package.PlayerName;
            IsInTeam = _package.IsInTeam;
 
            if (!WindowCenter.Instance.IsOpen<PlayerDetailWin>())
            {
                WindowCenter.Instance.Open<PlayerDetailWin>();
            }
            DTCB309_tagGCAnswerPlayerShortInfo.OnPlayerShortInfoEvent -= OnPlayerShortInfoEvent;
        }
 
        public static void OnClickFunc(DetailType _type)
        {
            if (onClickFuncEvent != null)
            {
                onClickFuncEvent(_type);
            }
        }
 
        public enum DetailType
        {
            PrivateChat = 0,//私聊
            ViewEquip = 1,//查看装备
            AddFriend = 2,//加为好友
            DeleteFriend = 3,//删除好友
            AddBlack = 4,//加入黑名单
            AddTeam = 5,//加入队伍
            FairyLv = 6,//更改仙盟职权
            KickFairy = 7,//提出仙盟
            ApplyTeam = 8, //申请入队
            InviteTeam = 9, //邀请入队
            RemoveBlack = 10, //移出黑名单
            LookFight = 11,//查看战力
            InviteFairy = 12,//邀请入盟
        }
        public enum OpenType
        {
            Default,
            Fairy,
            Friend
        }
 
        public static int PlayerID = 0;
        public static string PlayerName = string.Empty;
        public static int Job = 1;
        public static int LV = 0;    //等级
        public static int RealmLV = 0;    //境界
        public static int OnlineType = 0;    //在线状态, 0 不在线 1在线
        public static int IsInTeam = 0;
    }
}