Assets
BuiltinAssets
CSAssets
Editor
Gizmos
Plugins
Project
GameRes
PacketRes
Script
AssetManagement
Common
GUI
GameLogic
GameTables
LuaScripts
Obj
Object
Player
AI
Animation
AutoSearch
BaseAttr
BlackMarket
Chat
Community
ConsignSale
Controller
DailyLuckyDraw
Fellow
Guide
Guild
Impact
Item
Login
Market
Master
Mission
MoneyTree
MonthMultiple
RedPacket
Relation
Skill
SwornBrother
Team
TitleInvestitive
GameTitleInvestitive.cs
GameTitleInvestitive.cs.meta
UserData
AI.meta
Animation.meta
AutoSearch.meta
BaseAttr.meta
BlackMarket.meta
Chat.meta
CombatValue.cs
CombatValue.cs.meta
Community.meta
ConsignSale.meta
Controller.meta
DailyLuckyDraw.meta
Fellow.meta
Guide.meta
Guild.meta
Impact.meta
Item.meta
Login.meta
Market.meta
Master.meta
Mission.meta
MoneyTree.meta
MonthMultiple.meta
RedPacket.meta
Relation.meta
Skill.meta
SwornBrother.meta
Team.meta
TitleInvestitive.meta
UserData.meta
Plugin
ResNetwork
SDK
Scene
SceneMovie
Shader
T4M
TeXiao
Tools
AddChildAsset.cs
AddChildAsset.cs.meta
AnimatorFrameEvent.cs
AnimatorFrameEvent.cs.meta
AssetManagement.meta
BlindEffect.cs
BlindEffect.cs.meta
ButtonPlaySound.cs
ButtonPlaySound.cs.meta
CameraDepthEnable.cs
CameraDepthEnable.cs.meta
ChildDelayShowControl.cs
ChildDelayShowControl.cs.meta
Common.meta
DisableGameObj.cs
DisableGameObj.cs.meta
EffectAddPoint.cs
EffectAddPoint.cs.meta
EventTriggerListener.cs
EventTriggerListener.cs.meta
GUI.meta
GameLogic.meta
GameTables.meta
InputFieldLimit.cs
InputFieldLimit.cs.meta
InputOutView.cs
InputOutView.cs.meta
LuaScripts.meta
Obj.meta
Obj_MainPlayer_Attack.cs
Obj_MainPlayer_Attack.cs.meta
Object.meta
ObjectTween.cs
ObjectTween.cs.meta
Player.meta
Plugin.meta
RawImageAlpha.cs
RawImageAlpha.cs.meta
RedTipPoint.cs
RedTipPoint.cs.meta
RenderLine.cs
RenderLine.cs.meta
RenderLinePoint.cs
RenderLinePoint.cs.meta
RenderLineScaler.cs
RenderLineScaler.cs.meta
ResNetwork.meta
SDK.meta
Scene.meta
SceneMovie.meta
Shader.meta
SkillCircleProjector.cs
SkillCircleProjector.cs.meta
T4M.meta
TeXiao.meta
TextFontScale.cs
TextFontScale.cs.meta
TimeDownText.cs
TimeDownText.cs.meta
TimeScale.cs
TimeScale.cs.meta
Tools.meta
UIParticleSystem.cs
UIParticleSystem.cs.meta
UiMaskListener.cs
UiMaskListener.cs.meta
WeaponAddPoint.cs
WeaponAddPoint.cs.meta
WindowSign.cs
WindowSign.cs.meta
ZYButton.cs
ZYButton.cs.meta
Shader
GameRes.meta
PacketRes.meta
Script.meta
Shader.meta
Project3D
Res_newMS
StreamingAssets
T4M
T4MOBJ
UnusedAssets
XLua
BuiltinAssets.meta
CSAssets.meta
Editor.meta
Gizmos.meta
Plugins.meta
Project.meta
Project3D.meta
Res_newMS.meta
StreamingAssets.meta
T4M.meta
T4MOBJ.meta
UnusedAssets.meta
XLua.meta
ChannelConfig
ExcelC#
ExcelExport
ExcelTexts
JjbbDll
ProjectSettings
Sdk
UnityPackageManager
UnusedAssets
.gitignore
README.md
280 lines
7.8 KiB
C#
280 lines
7.8 KiB
C#
|
//********************************************************************
|
|||
|
// 文件名: GameTitleInvestitive.cs
|
|||
|
// 描述: 称号结构
|
|||
|
// 作者: WangZhe
|
|||
|
// Modify Log:
|
|||
|
// 2014-5-28 Lijia: 客户端效率优化,把GameSystemTitleInvestitive从class改为struct
|
|||
|
// 2014-5-28 Lijia: 客户端效率优化,把GameUserDefTitleInvestitive从class改为struct
|
|||
|
//********************************************************************
|
|||
|
|
|||
|
using UnityEngine;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System;
|
|||
|
using GCGame.Table;
|
|||
|
using GCGame;
|
|||
|
using Games.GlobeDefine;
|
|||
|
|
|||
|
namespace Games.TitleInvestitive
|
|||
|
{
|
|||
|
enum TITLE_SIZE
|
|||
|
{
|
|||
|
TITLE_NAME = 22,
|
|||
|
SYSTEMTITLE_NUM = 128,//系统程序支持存储的32个
|
|||
|
USERDEF_NUM = 8, //定义称号支持存储8个
|
|||
|
USERDEF_START = SYSTEMTITLE_NUM,
|
|||
|
TITLE_TOTAL = USERDEF_START + USERDEF_NUM,
|
|||
|
};
|
|||
|
|
|||
|
enum TITLE_TYPE
|
|||
|
{
|
|||
|
TYPE_NONE = -1,
|
|||
|
TYPE_SYSTITLE,
|
|||
|
TYPE_DEFTITE,
|
|||
|
TYPE_ALL,
|
|||
|
};
|
|||
|
|
|||
|
public enum OptionType
|
|||
|
{
|
|||
|
Adorn_Title = 1, //佩戴称号
|
|||
|
Activite_Title = 2, // 激活称号
|
|||
|
Del_Title = 3, //删除称号
|
|||
|
Req_TitleList = 4, //请求称号列表
|
|||
|
Add_Title = 5, //添加称号
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 物品品质
|
|||
|
/// </summary>
|
|||
|
public enum TITLE_COLORLEVEL
|
|||
|
{
|
|||
|
COLOR_INVALID = 0,
|
|||
|
COLOR_WHITE, //白
|
|||
|
COLOR_GREEN, //绿
|
|||
|
COLOR_BLUE, //蓝
|
|||
|
COLOR_PURPLE, //紫
|
|||
|
COLOR_ORANGE, //橙
|
|||
|
COLOR_GOLD, //金
|
|||
|
}
|
|||
|
|
|||
|
// 系统称号
|
|||
|
public struct GameSystemTitleInvestitive
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// 称号ID
|
|||
|
/// </summary>
|
|||
|
private int m_TitleID;
|
|||
|
public int TitleID
|
|||
|
{
|
|||
|
get { return m_TitleID; }
|
|||
|
set { m_TitleID = value; }
|
|||
|
}
|
|||
|
|
|||
|
//CD时间 (-1是没有CD)
|
|||
|
private int m_ValidTime;
|
|||
|
public int ValidTime
|
|||
|
{
|
|||
|
set { m_ValidTime = value; }
|
|||
|
get { return m_ValidTime; }
|
|||
|
}
|
|||
|
|
|||
|
public GameSystemTitleInvestitive(int nTitle, int nValitTime)
|
|||
|
{
|
|||
|
m_TitleID = nTitle;
|
|||
|
m_ValidTime = nValitTime;
|
|||
|
}
|
|||
|
|
|||
|
public void Clear()
|
|||
|
{
|
|||
|
m_TitleID = -1;
|
|||
|
m_ValidTime = -1;
|
|||
|
}
|
|||
|
|
|||
|
public int GetTitleType()
|
|||
|
{
|
|||
|
Tab_TitleData title = TableManager.GetTitleDataByID(m_TitleID, 0);
|
|||
|
if (title != null)
|
|||
|
{
|
|||
|
return title.Type;
|
|||
|
}
|
|||
|
return GlobeVar.INVALID_ID;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public class GameTitleInvestitive
|
|||
|
{
|
|||
|
private List<GameSystemTitleInvestitive> m_AllTitleList = new List<GameSystemTitleInvestitive>();
|
|||
|
public List<GameSystemTitleInvestitive> AllTitleList //拥有即激活
|
|||
|
{
|
|||
|
get { return m_AllTitleList; }
|
|||
|
}
|
|||
|
|
|||
|
private string m_CurTitleName; //当前称号文字内容
|
|||
|
public string CurTitleName
|
|||
|
{
|
|||
|
set { m_CurTitleName = value; }
|
|||
|
get { return m_CurTitleName; }
|
|||
|
}
|
|||
|
|
|||
|
private int m_AdornTitldId; //当前佩戴的称号ID
|
|||
|
public int AdornTitleId
|
|||
|
{
|
|||
|
set { m_AdornTitldId = value; }
|
|||
|
get { return m_AdornTitldId; }
|
|||
|
}
|
|||
|
|
|||
|
public GameTitleInvestitive()
|
|||
|
{
|
|||
|
m_CurTitleName = "";
|
|||
|
m_AdornTitldId = -1;
|
|||
|
}
|
|||
|
|
|||
|
public GameTitleInvestitive(int id, string name)
|
|||
|
{
|
|||
|
m_CurTitleName = name;
|
|||
|
}
|
|||
|
|
|||
|
public void ReadAllTitleInvestitive(GC_UPDATE_ALL_TITLEINVESTITIVE rData) //存储拥有的称号列表
|
|||
|
{
|
|||
|
for (int index = 0; index < rData.TitleInfoCount; index++)
|
|||
|
{
|
|||
|
GameSystemTitleInvestitive title = new GameSystemTitleInvestitive(rData.GetTitleInfo(index).TitleID, rData.GetTitleInfo(index).ValidTime);
|
|||
|
for (int _Index = 0; _Index < m_AllTitleList.Count; _Index++)
|
|||
|
{
|
|||
|
if(m_AllTitleList[_Index].TitleID == title.TitleID)
|
|||
|
{
|
|||
|
m_AllTitleList.RemoveAt(_Index);
|
|||
|
}
|
|||
|
}
|
|||
|
m_AllTitleList.Add(title);
|
|||
|
}
|
|||
|
|
|||
|
RefreshTitleViewState();
|
|||
|
}
|
|||
|
|
|||
|
public void RefreshTitleViewState()
|
|||
|
{
|
|||
|
if (TitleNameViewCtr.Instace)
|
|||
|
{
|
|||
|
TitleNameViewCtr.Instace.GetAllTitleNameList();
|
|||
|
}
|
|||
|
if(TitlePropPanelCtr.Instance)
|
|||
|
{
|
|||
|
TitlePropPanelCtr.Instance.RefreshTitlePropView();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public void DeleteTitle(int titltId)
|
|||
|
{
|
|||
|
for(int index = 0; index < m_AllTitleList.Count; index++)
|
|||
|
{
|
|||
|
if(m_AllTitleList[index].TitleID == titltId)
|
|||
|
{
|
|||
|
m_AllTitleList.RemoveAt(index);
|
|||
|
break;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public int GetCurrentTitleID()
|
|||
|
{
|
|||
|
return AdornTitleId; //当前佩戴的称号ID
|
|||
|
}
|
|||
|
|
|||
|
public bool IsTitleActived(int titleId)
|
|||
|
{
|
|||
|
for(int index = 0; index < m_AllTitleList.Count; index++)
|
|||
|
{
|
|||
|
if (m_AllTitleList[index].TitleID == titleId)
|
|||
|
return true;
|
|||
|
}
|
|||
|
|
|||
|
return false;
|
|||
|
}
|
|||
|
|
|||
|
public bool IsGainTitle(int titleId)
|
|||
|
{
|
|||
|
for (int index = 0; index < m_AllTitleList.Count; index++)
|
|||
|
{
|
|||
|
if (m_AllTitleList[index].TitleID == titleId)
|
|||
|
{
|
|||
|
return true;
|
|||
|
}
|
|||
|
}
|
|||
|
return false;
|
|||
|
}
|
|||
|
|
|||
|
public void SetTitleName(string name)
|
|||
|
{
|
|||
|
m_CurTitleName = name;
|
|||
|
}
|
|||
|
|
|||
|
public string GetCurrentTitle()
|
|||
|
{
|
|||
|
return m_CurTitleName; //当前佩戴的称号文字内容
|
|||
|
}
|
|||
|
|
|||
|
public void AddTitle(int titleId, int validTime) //添加称号
|
|||
|
{
|
|||
|
for(int index = 0; index < m_AllTitleList.Count; index++)
|
|||
|
{
|
|||
|
if(m_AllTitleList[index].TitleID == titleId)
|
|||
|
{
|
|||
|
break;
|
|||
|
}
|
|||
|
}
|
|||
|
GameSystemTitleInvestitive title = new GameSystemTitleInvestitive(titleId, validTime);
|
|||
|
m_AllTitleList.Add(title);
|
|||
|
}
|
|||
|
|
|||
|
public bool ChangeTitle(int nNewIndex)
|
|||
|
{
|
|||
|
//m_ActiveTitleId = nNewIndex; //更换当前的
|
|||
|
return false;
|
|||
|
}
|
|||
|
|
|||
|
//同步当前佩戴称号 激活称号 佩戴的称号名字
|
|||
|
public void HandleGainTitle(int nTitleID, string strUserDef, int nActiveTitleId)
|
|||
|
{
|
|||
|
AdornTitleId = nTitleID; //当前佩戴的称号ID
|
|||
|
CurTitleName = strUserDef; //当前佩戴的称号的文字内容
|
|||
|
|
|||
|
//刷新面板Mark标记
|
|||
|
if(TitleNameViewCtr.Instace)
|
|||
|
{
|
|||
|
TitleNameViewCtr.Instace.ShowMarkIcon();
|
|||
|
}
|
|||
|
}
|
|||
|
public void HandleUpdateDefTitle(int nTitleID, string strUserDef) //无用
|
|||
|
{
|
|||
|
//for (int nIndex = (int)TITLE_SIZE.USERDEF_START; nIndex < (int)TITLE_SIZE.TITLE_TOTAL; nIndex++)
|
|||
|
//{
|
|||
|
// if (nTitleID == m_UserDefTitle[nIndex - (int)TITLE_SIZE.USERDEF_START].TitleID)
|
|||
|
// {
|
|||
|
// m_UserDefTitle[nIndex - (int)TITLE_SIZE.USERDEF_START].StrFullTitleName = strUserDef;
|
|||
|
// }
|
|||
|
//}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
|
|||
|
public void ClearData()
|
|||
|
{
|
|||
|
m_AllTitleList.Clear();
|
|||
|
m_CurTitleName = "";
|
|||
|
m_AdornTitldId = -1;
|
|||
|
}
|
|||
|
|
|||
|
public bool IsHaveType(int type)
|
|||
|
{
|
|||
|
for (int index = 0; index < m_AllTitleList.Count; index++)
|
|||
|
{
|
|||
|
if (m_AllTitleList[index].GetTitleType() == type)
|
|||
|
{
|
|||
|
return true;
|
|||
|
}
|
|||
|
}
|
|||
|
return false;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|