Files
JJBB/Assets/Project/Script/GUI/Role/OtherRoleViewLogic.cs

376 lines
9.6 KiB
C#
Raw Normal View History

2024-08-23 15:49:34 +08:00
using System;
using System.Security.Cryptography.X509Certificates;
using Games.GlobeDefine;
using Games.Item;
using Games.LogicObj;
using GCGame.Table;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Module.Log;
using GCGame;
public class OtherRoleViewLogic : MonoBehaviour
{
// Use this for initialization
private static OtherRoleViewLogic m_Instance = null;
public static OtherRoleViewLogic Instance()
{
return m_Instance;
}
public enum CONTENT_TYPE
{
CONTENT_TYPE_INVALID = -1,
CONTENT_TYPE_ATTR = 0, // 属性
CONTENT_TYPE_GEM, // 宝石
}
public enum OPEN_TYPE
{
OPEN_TYPE_INVALID = -1,
OPEN_TYPE_FRIEND = 0, // 通过好友界面打开的
OPEN_TYPE_POPMENU = 1,
OPEN_TYPE_LASTSPEAKER = 2,
OPEN_TYPE_NUM, //
}
public GameObject m_AttrView;//属性视图
public GameObject m_GemView;//宝石视图
//public UISprite[] m_EquipSlotChooseSprite;
//public UISprite[] m_EquipSlotIcon;
//public UISprite[] m_EquipSlotQualityFrame;
private string m_strName = "";
public string Name
{
get { return m_strName; }
set { m_strName = value; }
}
private int m_nCombatValue = 0;
public int CombatValue
{
get { return m_nCombatValue; }
set { m_nCombatValue = value; }
}
private int m_nLevel = 0;
public int Level
{
get { return m_nLevel; }
set { m_nLevel = value; }
}
private int m_Profession = -1;
public int Profession
{
get { return m_Profession; }
set { m_Profession = value; }
}
private UInt64 m_RoleGUID = 0;
public System.UInt64 RoleGUID
{
get { return m_RoleGUID; }
set { m_RoleGUID = value; }
}
private int m_nCurHp = 0;
public int CurHp
{
get { return m_nCurHp; }
set { m_nCurHp = value; }
}
private int m_nMaxHP = 0;
public int MaxHP
{
get { return m_nMaxHP; }
set { m_nMaxHP = value; }
}
private int m_nCurMp = 0;
public int CurMp
{
get { return m_nCurMp; }
set { m_nCurMp = value; }
}
private int m_nMaxMp = 0;
public int MaxMp
{
get { return m_nMaxMp; }
set { m_nMaxMp = value; }
}
private long m_nCurExp = 0;
public long CurExp
{
get { return m_nCurExp; }
set { m_nCurExp = value; }
}
private long m_nMaxExp = 0;
public long MaxExp
{
get { return m_nMaxExp; }
set { m_nMaxExp = value; }
}
private int m_nPAttck = 0;//物攻
public int PAttck
{
get { return m_nPAttck; }
set { m_nPAttck = value; }
}
private int m_nMAttack = 0;//法功
public int MAttack
{
get { return m_nMAttack; }
set { m_nMAttack = value; }
}
private int m_nHit = 0;
public int Hit
{
get { return m_nHit; }
set { m_nHit = value; }
}
private int m_nCritical = 0;//暴击
public int Critical
{
get { return m_nCritical; }
set { m_nCritical = value; }
}
private int m_nPDefense = 0;//物防
public int PDefense
{
get { return m_nPDefense; }
set { m_nPDefense = value; }
}
private int m_MDefense = 0;//法防
public int MDefense
{
get { return m_MDefense; }
set { m_MDefense = value; }
}
private int m_DeCritical = 0;//暴击抗性
public int DeCritical
{
get { return m_DeCritical; }
set { m_DeCritical = value; }
}
private int m_nDoge = 0;//闪避
public int Doge
{
get { return m_nDoge; }
set { m_nDoge = value; }
}
private int m_nStrike = 0;//穿透
public int Strike
{
get { return m_nStrike; }
set { m_nStrike = value; }
}
private int m_nCriticalAdd = 0;//暴击加成
public int CriticalAdd
{
get { return m_nCriticalAdd; }
set { m_nCriticalAdd = value; }
}
private int m_nDuctical = 0;//韧性
public int Ductical
{
get { return m_nDuctical; }
set { m_nDuctical = value; }
}
private int m_nCriticalMis = 0;//暴击减免
public int CriticalMis
{
get { return m_nCriticalMis; }
set { m_nCriticalMis = value; }
}
private string m_strGuildName = ""; // 帮会名称
public string GuildName
{
get { return m_strGuildName; }
set { m_strGuildName = value; }
}
private int m_nVipLvl = 0; // Vip等级
public int VipLvl
{
get { return m_nVipLvl; }
set { m_nVipLvl = value; }
}
public GameObject m_LeftAttrView_01;
public GameObject m_LeftAttrView_02;
public GameObject m_LeftAttrView_03;
public GameObject m_ShowMoreInfoBt;
public GameObject m_CancelShowInfoBt;
public GameObject m_EquipPackGrid;
public GameObject m_FakeObjTopLeft;
public GameObject m_FakeObjBottomRight;
//private int m_PlayerFakeObjID = GlobeVar.INVALID_ID;
private GameObject m_FakeObjGameObject = null;
private static OPEN_TYPE m_oPenType = OPEN_TYPE.OPEN_TYPE_INVALID;
void Awake()
{
m_Instance = this;
}
void OnEnable()
{
}
void OnDisable()
{
}
void OnDestroy()
{
DestroyPartnerFakeObj();
m_Instance = null;
}
public static void OnShowOtherRoleVirew(bool bSuccess, object param)
{
if (!bSuccess)
{
LogModule.ErrorLog("load OtherRoleViewLogic error");
return;
}
if (null != OtherRoleViewLogic.Instance())
OtherRoleViewLogic.Instance().ShowOtherRoleView();
}
public void ShowOtherRoleView()
{
//GameManager.gameManager.ActiveScene.InitFakeObjRoot(m_FakeObjTopLeft, m_FakeObjBottomRight);
Name = GameManager.gameManager.OtherPlayerData.Name;
CombatValue = GameManager.gameManager.OtherPlayerData.CombatValue;
Level = GameManager.gameManager.OtherPlayerData.Level;
Profession = GameManager.gameManager.OtherPlayerData.Profession;
RoleGUID = GameManager.gameManager.OtherPlayerData.RoleGUID;
CurHp = GameManager.gameManager.OtherPlayerData.CurHp;
MaxHP = GameManager.gameManager.OtherPlayerData.MaxHP;
CurMp = GameManager.gameManager.OtherPlayerData.CurMp;
MaxMp = GameManager.gameManager.OtherPlayerData.MaxMp;
CurExp = GameManager.gameManager.OtherPlayerData.CurExp;
MaxExp = GameManager.gameManager.OtherPlayerData.MaxExp;
PAttck = GameManager.gameManager.OtherPlayerData.PAttck;
MAttack = GameManager.gameManager.OtherPlayerData.MAttack;
Hit = GameManager.gameManager.OtherPlayerData.Hit;
Critical = GameManager.gameManager.OtherPlayerData.Critical;
PDefense = GameManager.gameManager.OtherPlayerData.PDefense;
MDefense = GameManager.gameManager.OtherPlayerData.MDefense;
DeCritical = GameManager.gameManager.OtherPlayerData.DeCritical;
Doge = GameManager.gameManager.OtherPlayerData.Doge;
Strike = GameManager.gameManager.OtherPlayerData.Strike;
CriticalAdd = GameManager.gameManager.OtherPlayerData.CriticalAdd;
Ductical = GameManager.gameManager.OtherPlayerData.Ductical;
CriticalMis = GameManager.gameManager.OtherPlayerData.CriticalMis;
GuildName = GameManager.gameManager.OtherPlayerData.GuildName;
VipLvl = GameManager.gameManager.OtherPlayerData.VipLvl;
if (m_EquipPackGrid != null)
{
}
m_LeftAttrView_01.SetActive(true);
m_LeftAttrView_02.SetActive(false);
m_LeftAttrView_03.SetActive(false);
m_ShowMoreInfoBt.SetActive(true);
m_CancelShowInfoBt.SetActive(false);
AttrBtClick();
}
/// <summary>
///
/// </summary>
public static void SetOpenType(OPEN_TYPE opentype)
{
m_oPenType = opentype;
}
/// <summary>
/// 点击属性按钮
/// </summary>
public void AttrBtClick()
{
if (m_AttrView != null)
{
m_AttrView.SetActive(true);
}
if (m_GemView != null)
{
m_GemView.SetActive(false);
}
UpdateAttrView();
if (m_LeftAttrView_02.activeInHierarchy)
{
m_CancelShowInfoBt.SetActive(true);
m_ShowMoreInfoBt.SetActive(false);
//隐藏预览模型
}
}
/// <summary>
/// 更新属性页面
/// </summary>
public void UpdateAttrView()
{
//更新预览模型
CreatePartnerFakeObj();
}
/// <summary>
/// 销毁FakeObj
/// </summary>
private void DestroyPartnerFakeObj()
{
}
/// <summary>
/// 创建FakeObj
/// </summary>
/// <param name="pro"></param>
private void CreatePartnerFakeObj()
{
CharacterDefine.PROFESSION profession = (CharacterDefine.PROFESSION)m_Profession;
//对应FakeObject.txt配置
int fakeObjId = -1;
switch (profession)
{
case CharacterDefine.PROFESSION.TIANJI:
fakeObjId = 7;
break;
case CharacterDefine.PROFESSION.LIUSHAN:
fakeObjId = 8;
break;
case CharacterDefine.PROFESSION.SHUSHAN:
fakeObjId = 10;
break;
case CharacterDefine.PROFESSION.XUANNV:
fakeObjId = 9;
break;
default:
fakeObjId = 7;
break;
}
}
}