Merge branch 'master' into leonard
# Conflicts:
# System/OpenServerActivity/WishingPoolModel.cs
| | |
| | | Register(typeof(HA3C1_tagMCDogzHelpbattleState), typeof(DTCA3C1_tagMCDogzHelpbattleState));
|
| | | #endregion
|
| | | Register(typeof(HA324_tagMCBindJadeWheelResult),typeof(DTCA324_tagMCBindJadeWheelResult));
|
| | |
|
| | | Register(typeof(HAA19_tagMCActWishingWellInfo), typeof(DTCAA19_tagMCActWishingWellInfo));
|
| | | Register(typeof(HAA1A_tagMCActWishingWellPlayerInfo), typeof(DTCAA1A_tagMCActWishingWellPlayerInfo));
|
| | | }
|
| | |
|
| | | private static void Register(Type _pack, Type _business)
|
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Wednesday, June 20, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using UnityEngine; |
| | | using System; |
| | | |
| | | namespace TableConfig { |
| | | |
| | | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Monday, October 22, 2018
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using UnityEngine;
|
| | | using System;
|
| | |
|
| | | namespace TableConfig {
|
| | |
|
| | | |
| | | public partial class JobSetupConfig : ConfigBase {
|
| | |
|
| | | public int Job { get ; private set ; }
|
| | |
| | | public int MaxSwitchTargetDist { get ; private set ; }
|
| | | public int[] HangupSkillList;
|
| | | public string DungeonSkillList { get ; private set; }
|
| | | public string OffLineSkillList { get ; private set; } |
| | | public int HpPerUseSkill { get ; private set ; }
|
| | | public int[] HpSkillList;
|
| | | public int[] GainSkillList;
|
| | | public int MoveLimitDist { get ; private set ; }
|
| | | |
| | |
|
| | | public override string getKey()
|
| | | {
|
| | | return Job.ToString();
|
| | | } |
| | | |
| | | public override void Parse() { |
| | | }
|
| | |
|
| | | public override void Parse() {
|
| | | try
|
| | | {
|
| | | Job=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0;
|
| | |
| | |
|
| | | DungeonSkillList = rawContents[17].Trim();
|
| | |
|
| | | HpPerUseSkill=IsNumeric(rawContents[18]) ? int.Parse(rawContents[18]):0; |
| | | OffLineSkillList = rawContents[18].Trim();
|
| | |
|
| | | string[] HpSkillListStringArray = rawContents[19].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | HpPerUseSkill=IsNumeric(rawContents[19]) ? int.Parse(rawContents[19]):0; |
| | | |
| | | string[] HpSkillListStringArray = rawContents[20].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | HpSkillList = new int[HpSkillListStringArray.Length]; |
| | | for (int i=0;i<HpSkillListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(HpSkillListStringArray[i],out HpSkillList[i]); |
| | | }
|
| | |
|
| | | string[] GainSkillListStringArray = rawContents[20].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | string[] GainSkillListStringArray = rawContents[21].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | GainSkillList = new int[GainSkillListStringArray.Length]; |
| | | for (int i=0;i<GainSkillListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(GainSkillListStringArray[i],out GainSkillList[i]); |
| | | }
|
| | |
|
| | | MoveLimitDist=IsNumeric(rawContents[21]) ? int.Parse(rawContents[21]):0; |
| | | MoveLimitDist=IsNumeric(rawContents[22]) ? int.Parse(rawContents[22]):0; |
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | DebugEx.Log(ex);
|
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | }
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
| | | fileFormatVersion: 2 |
| | | guid: 027514b321a62b343897e7bda10272ee |
| | | timeCreated: 1529458253 |
| | | licenseType: Pro |
| | | timeCreated: 1540189086 |
| | | licenseType: Free |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | |
| | |
|
| | | public IEnumerator Co_LoadConfigs()
|
| | | {
|
| | | AddAsyncTask<LoginSeverListConfig>();
|
| | | StartSyncTask<LoginSeverListConfig>(AssetSource.refdataFromEditor ? AssetPath.ResourceOut : AssetPath.External);
|
| | | AddAsyncTask<IconConfig>();
|
| | | AddAsyncTask<ItemConfig>();
|
| | | AddAsyncTask<SkillConfig>();
|
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // AA 06 许愿池活动许愿 #tagCMActWishing
|
| | |
|
| | | public class CAA06_tagCMActWishing : GameNetPackBasic {
|
| | | public byte SrcWellType; // 来源库 0-可选库 1-结果库
|
| | | public byte SrcIndex; // 来源索引
|
| | | public byte DesWellType; // 目标库 0-可选库 1-结果库
|
| | | public byte DesIndex; // 目标索引
|
| | |
|
| | | public CAA06_tagCMActWishing () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xAA06;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (SrcWellType, NetDataType.BYTE);
|
| | | WriteBytes (SrcIndex, NetDataType.BYTE);
|
| | | WriteBytes (DesWellType, NetDataType.BYTE);
|
| | | WriteBytes (DesIndex, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: a0799e6815403574f8e0804fc8f3489a |
| | | timeCreated: 1540173914 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // AA 07 许愿池活动刷新奖池 #tagCMActWishingRefresh
|
| | |
|
| | | public class CAA07_tagCMActWishingRefresh : GameNetPackBasic {
|
| | | public byte IsFree; // 是否免费刷新
|
| | |
|
| | | public CAA07_tagCMActWishingRefresh () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xAA07;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (IsFree, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: b503cda0c98dd19448d4dc0e2093d333 |
| | | timeCreated: 1540173914 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | if (ride) |
| | | { |
| | | MapConfig _map = Config.Instance.Get<MapConfig>(PlayerDatas.Instance.baseData.MapID); |
| | | if (_map == null || _map.CanRide == 0 || _map.MapFBType != 0) |
| | | if (_map == null || _map.CanRide == 0) |
| | | { |
| | | return; |
| | | } |
| | |
| | | |
| | | if (_mapConfig.MapFBType != 0) |
| | | { |
| | | DungeonModel _model = ModelCenter.Instance.GetModel<DungeonModel>();
|
| | | DungeonModel _model = ModelCenter.Instance.GetModel<DungeonModel>(); |
| | | _realMapDataID = _model.GetDataMapIdByMapId(_realMapDataID); |
| | | |
| | | if (package.MapID != 52020 && package.MapID != 52010)
|
| | | {
|
| | | if (package.MapID != 52020 && package.MapID != 52010) |
| | | { |
| | | DTCA127_tagMCStartChangeMap.LineID = package.FuncLineID; |
| | | } |
| | | }
|
| | |
|
| | | var _mapResConfig = DTCA127_tagMCStartChangeMap.GetMapResourcesConfig(_realMapDataID, DTCA127_tagMCStartChangeMap.LineID);
|
| | |
|
| | | if (_mapResConfig == null)
|
| | | {
|
| | | DTCA127_tagMCStartChangeMap.LineID = 0;
|
| | | _mapResConfig = DTCA127_tagMCStartChangeMap.GetMapResourcesConfig(_realMapDataID, DTCA127_tagMCStartChangeMap.LineID);
|
| | | } |
| | | |
| | | var _mapResConfig = DTCA127_tagMCStartChangeMap.GetMapResourcesConfig(_realMapDataID, DTCA127_tagMCStartChangeMap.LineID); |
| | | |
| | | if (_mapResConfig == null) |
| | | { |
| | | DTCA127_tagMCStartChangeMap.LineID = 0; |
| | | _mapResConfig = DTCA127_tagMCStartChangeMap.GetMapResourcesConfig(_realMapDataID, DTCA127_tagMCStartChangeMap.LineID); |
| | | } |
| | | |
| | | if (!WindowCenter.Instance.IsOpen<LoadingWin>()) |
| | |
| | | return; |
| | | } |
| | | |
| | | if(_mapConfig.CanRide == 0) |
| | | { |
| | | _hero.SwitchHorse(0); |
| | | DTC0428_tagPlayerRideHorse.Send_tagPlayerRideHorse(false); |
| | | } |
| | | _hero.ClearPathFindTarget(); |
| | | _hero.OnPathFindStop -= MapTransferUtility.Instance.OnHeroStopPathFind; |
| | | _hero.StopAll(); |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | | using Snxxz.UI;
|
| | | // AA 19 许愿池活动信息 #tagMCActWishingWellInfo
|
| | |
|
| | | public class DTCAA19_tagMCActWishingWellInfo : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HAA19_tagMCActWishingWellInfo vNetData = vNetPack as HAA19_tagMCActWishingWellInfo;
OperationTimeHepler.Instance.UpdateWishingWellInfo(vNetData);
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 0f5809b019a6bd3458b831c341567252 |
| | | timeCreated: 1540173914 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | | using Snxxz.UI;
|
| | |
|
| | | // AA 1A 许愿池活动玩家信息 #tagMCActWishingWellPlayerInfo
|
| | |
|
| | |
|
| | |
|
| | | public class DTCAA1A_tagMCActWishingWellPlayerInfo : DtcBasic {
|
| | |
|
| | | WishingPoolModel wishModel { get { return ModelCenter.Instance.GetModel<WishingPoolModel>(); } }
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HAA1A_tagMCActWishingWellPlayerInfo vNetData = vNetPack as HAA1A_tagMCActWishingWellPlayerInfo;
wishModel.SetWishingWellPlayerInfo(vNetData);
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f3b0342d3d2578d41a07f145e65fca6f |
| | | timeCreated: 1540173914 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | {
|
| | | if (vNetData.TeamMemFuncType == 0)
|
| | | {
|
| | | main.IsSend = true;
|
| | | main.LayerNumber = 7;
|
| | | for (int i = 0; i < vNetData.MemCount; i++)
|
| | | {
|
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // AA 19 许愿池活动信息 #tagMCActWishingWellInfo
|
| | |
|
| | | public class HAA19_tagMCActWishingWellInfo : GameNetPackBasic {
|
| | | public string StartDate; // 开始日期 y-m-d
|
| | | public string EndtDate; // 结束日期 y-m-d
|
| | | public byte IsDayReset; //是否每天重置
|
| | | public byte ResetType; // 重置类型,0-0点重置;1-5点重置
|
| | | public ushort LimitLV; // 限制等级
|
| | | public ushort Count; // 物品数
|
| | | public tagMCWishingWellItem[] WellItemInfo; // 随机库物品信息
|
| | |
|
| | | public HAA19_tagMCActWishingWellInfo () {
|
| | | _cmd = (ushort)0xAA19;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out StartDate, vBytes, NetDataType.Chars, 10);
|
| | | TransBytes (out EndtDate, vBytes, NetDataType.Chars, 10);
|
| | | TransBytes (out IsDayReset, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ResetType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out LimitLV, vBytes, NetDataType.WORD);
|
| | | TransBytes (out Count, vBytes, NetDataType.WORD);
|
| | | WellItemInfo = new tagMCWishingWellItem[Count];
|
| | | for (int i = 0; i < Count; i ++) {
|
| | | WellItemInfo[i] = new tagMCWishingWellItem();
|
| | | TransBytes (out WellItemInfo[i].ItemID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out WellItemInfo[i].ItemCnt, vBytes, NetDataType.WORD);
|
| | | TransBytes (out WellItemInfo[i].IsBind, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out WellItemInfo[i].Mark, vBytes, NetDataType.DWORD);
|
| | | }
|
| | | }
|
| | |
|
| | | public struct tagMCWishingWellItem {
|
| | | public uint ItemID; // 物品ID
|
| | | public ushort ItemCnt; // 物品数量
|
| | | public byte IsBind; // 是否绑定
|
| | | public uint Mark; // 排序标识
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 9e29f30207d395349a95715863102f47 |
| | | timeCreated: 1540173914 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // AA 1A 许愿池活动玩家信息 #tagMCActWishingWellPlayerInfo
|
| | |
|
| | |
|
| | |
|
| | | public class HAA1A_tagMCActWishingWellPlayerInfo : GameNetPackBasic {
|
| | |
|
| | | public uint FreeStartTime; // 免费开始倒计时时间
|
| | |
|
| | | public uint WishCnt; // 许愿付费刷新次数
|
| | |
|
| | | public byte WellItemCnt; //许愿池物品数量
|
| | |
|
| | | public tagMCPlayerWishingWellItem[] WellItemInfo; // 随机库物品信息
|
| | |
|
| | | public byte CurAwardCnt; // 当前奖励物品数量
|
| | |
|
| | | public tagMCPlayerWishingWellItem[] CurAwardItemInfo; // 当前奖励物品
|
| | |
|
| | | public byte LastAwardCnt; // 可领取奖励物品数量
|
| | |
|
| | | public tagMCPlayerWishingWellItem[] LastAwardItemInfo; // 可领取奖励物品
|
| | |
|
| | |
|
| | |
|
| | | public HAA1A_tagMCActWishingWellPlayerInfo () {
|
| | |
|
| | | _cmd = (ushort)0xAA1A;
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | |
|
| | | TransBytes (out FreeStartTime, vBytes, NetDataType.DWORD);
|
| | |
|
| | | TransBytes (out WishCnt, vBytes, NetDataType.DWORD);
|
| | |
|
| | | TransBytes (out WellItemCnt, vBytes, NetDataType.BYTE);
|
| | |
|
| | | WellItemInfo = new tagMCPlayerWishingWellItem[WellItemCnt];
|
| | |
|
| | | for (int i = 0; i < WellItemCnt; i ++) {
|
| | |
|
| | | WellItemInfo[i] = new tagMCPlayerWishingWellItem();
|
| | |
|
| | | TransBytes (out WellItemInfo[i].ItemID, vBytes, NetDataType.DWORD);
|
| | |
|
| | | TransBytes (out WellItemInfo[i].ItemCnt, vBytes, NetDataType.WORD);
|
| | |
|
| | | TransBytes (out WellItemInfo[i].IsBind, vBytes, NetDataType.BYTE);
|
| | |
|
| | | }
|
| | |
|
| | | TransBytes (out CurAwardCnt, vBytes, NetDataType.BYTE);
|
| | |
|
| | | CurAwardItemInfo = new tagMCPlayerWishingWellItem[CurAwardCnt];
|
| | |
|
| | | for (int i = 0; i < CurAwardCnt; i ++) {
|
| | |
|
| | | CurAwardItemInfo[i] = new tagMCPlayerWishingWellItem();
|
| | |
|
| | | TransBytes (out CurAwardItemInfo[i].ItemID, vBytes, NetDataType.DWORD);
|
| | |
|
| | | TransBytes (out CurAwardItemInfo[i].ItemCnt, vBytes, NetDataType.WORD);
|
| | |
|
| | | TransBytes (out CurAwardItemInfo[i].IsBind, vBytes, NetDataType.BYTE);
|
| | |
|
| | | }
|
| | |
|
| | | TransBytes (out LastAwardCnt, vBytes, NetDataType.BYTE);
|
| | |
|
| | | LastAwardItemInfo = new tagMCPlayerWishingWellItem[LastAwardCnt];
|
| | |
|
| | | for (int i = 0; i < LastAwardCnt; i ++) {
|
| | |
|
| | | LastAwardItemInfo[i] = new tagMCPlayerWishingWellItem();
|
| | |
|
| | | TransBytes (out LastAwardItemInfo[i].ItemID, vBytes, NetDataType.DWORD);
|
| | |
|
| | | TransBytes (out LastAwardItemInfo[i].ItemCnt, vBytes, NetDataType.WORD);
|
| | |
|
| | | TransBytes (out LastAwardItemInfo[i].IsBind, vBytes, NetDataType.BYTE);
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | public struct tagMCPlayerWishingWellItem {
|
| | |
|
| | | public uint ItemID; // 物品ID
|
| | |
|
| | | public ushort ItemCnt; // 物品数量
|
| | |
|
| | | public byte IsBind; // 是否绑定
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | }
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6456db1385cb210498985c967a4a075b |
| | | timeCreated: 1540173914 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | Js = 4,// 极速
|
| | | }
|
| | |
|
| | | public E_ChannelPlatform ChannelPlatform { get; private set; }
|
| | | public E_ChannelPlatform ChannelPlatform { get; set; }
|
| | |
|
| | | /// <summary>
|
| | | /// sdk初始化是否完成标识
|
| | |
| | | return false; |
| | | } |
| | | |
| | | PlayEffect(); |
| | | |
| | | #if UNITY_EDITOR |
| | | SnxxzGame.Instance.AddOnDrawGizmosAction(OnDrawGizmos); |
| | | #endif |
| | | |
| | | return true; |
| | | } |
| | | |
| | | protected virtual void PlayEffect() |
| | | { |
| | | m_Ammo = SFXPlayUtility.Instance.Play(m_Config.ammoEffectId, m_Position, m_Direction); |
| | | if (m_Ammo) |
| | | { |
| | |
| | | m_Ammo.transform.forward = m_Direction; |
| | | } |
| | | } |
| | | |
| | | #if UNITY_EDITOR |
| | | SnxxzGame.Instance.AddOnDrawGizmosAction(OnDrawGizmos); |
| | | #endif |
| | | |
| | | return true; |
| | | } |
| | | |
| | | protected virtual void MovingHitted() |
| | |
| | | return _result; |
| | | } |
| | | |
| | | protected sealed override void PlayEffect() { } |
| | | |
| | | protected sealed override void OnUpdate() |
| | | { |
| | | if (IsOver()) |
| | |
| | | _controller.enabled = true; |
| | | _sfx.m_OnFinished += OnSFXDisable; |
| | | |
| | | if (_start) |
| | | { |
| | | _sfx.transform.position = _start.position; |
| | | } |
| | | if (_end) |
| | | { |
| | | _sfx.transform.LookAt(_end.position); |
| | | } |
| | | if (_start && _end) |
| | | { |
| | | _sfx.transform.localScale = new Vector3(1, 1, Vector3.Distance(_end.position, _start.position)); |
| | | } |
| | | |
| | | m_CacheAllEffect.Add(_sfx); |
| | | } |
| | | //Debug.LogFormat("播放特效: 开始: {0}, 结束: {1}", _start, _end); |
| | | //Debug.LogFormat("播放特效 {2} : 开始: {0}, 结束: {1}", _start, _end, m_FoTransMit.ammoEffectId); |
| | | } |
| | | } |
| | | |
| | |
| | | public sealed override bool IsOver() |
| | | { |
| | | return m_HurtClientList == null |
| | | || m_Index > m_HurtClientList.Count - 1; |
| | | || m_Index > m_HurtClientList.Count - 1 |
| | | || GA_Hero.s_MapSwitching; |
| | | } |
| | | |
| | | private void RecycleAllEffect() |
| | |
| | | return false; |
| | | } |
| | | |
| | | if(_hero.ServerInstID == sid) |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | // 选中英雄必显示 |
| | | if (_hero.SelectTarget != null) |
| | | { |
| | |
| | |
|
| | | public static UnityAction<uint, bool> s_OnSelected;
|
| | | public static UnityAction<uint, ulong, ulong> s_OnRefreshLife;
|
| | |
|
| | | private static Dictionary<int, Dictionary<int, List<int>>> m_StaticOffLineSkllList = new Dictionary<int, Dictionary<int, List<int>>>();
|
| | | private int[] m_OffLineSkillList;
|
| | | protected H0434_tagAreaPlayerAppearEx m_H0434;
|
| | |
|
| | | private CmdManager m_CmdManager;
|
| | |
| | | RequestName();
|
| | |
|
| | | m_CmdManager = new CmdManager();
|
| | |
|
| | | if (m_H0434.State == 1)
|
| | | {
|
| | | if (!m_StaticOffLineSkllList.ContainsKey(m_H0434.Job))
|
| | | {
|
| | | m_StaticOffLineSkllList.Add(m_H0434.Job, new Dictionary<int, List<int>>());
|
| | |
|
| | | var _json = LitJson.JsonMapper.ToObject(JobSetup.OffLineSkillList);
|
| | | foreach (var _level in _json.Keys)
|
| | | {
|
| | | var _list = new List<int>();
|
| | | for (int i = 0; i < _json[_level].Count; ++i)
|
| | | {
|
| | | _list.Add((int)_json[_level][i]);
|
| | | }
|
| | | m_StaticOffLineSkllList[m_H0434.Job].Add(int.Parse(_level), _list);
|
| | | }
|
| | | }
|
| | |
|
| | | foreach (var _level in m_StaticOffLineSkllList[m_H0434.Job].Keys)
|
| | | {
|
| | | if (m_H0434.LV < _level)
|
| | | {
|
| | | m_OffLineSkillList = m_StaticOffLineSkllList[m_H0434.Job][_level].ToArray();
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | protected sealed override void OnUnit()
|
| | |
| | |
|
| | | m_CmdManager = null;
|
| | | m_H0434 = null;
|
| | | m_OffLineSkillList = null;
|
| | |
|
| | | base.OnUnit();
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | Skill _castSkill = null;
|
| | | int _skillIndex = UnityEngine.Random.Range(0, JobSetup.HangupSkillList.Length);
|
| | | if (SkillMgr.Get(JobSetup.HangupSkillList[_skillIndex]).IsValid())
|
| | |
|
| | | int _skillIndex = UnityEngine.Random.Range(0, m_OffLineSkillList.Length);
|
| | | if (SkillMgr.Get(m_OffLineSkillList[_skillIndex]).IsValid())
|
| | | {
|
| | | _castSkill = SkillMgr.Get(JobSetup.HangupSkillList[_skillIndex]);
|
| | | _castSkill = SkillMgr.Get(m_OffLineSkillList[_skillIndex]);
|
| | | }
|
| | |
|
| | | if (_castSkill == null)
|
| | |
| | | public static void CheckPickupItem(Vector3 checkPosition)
|
| | | {
|
| | | // 挂机状态下
|
| | | if (SettingEffectMgr.Instance.GetSettingEffect())
|
| | | if (SettingEffectMgr.Instance.GetSettingEffect() && !UserInputHandler.isTouched)
|
| | | {
|
| | | // 不自动拾取则直接返回
|
| | | if (HangUpSetModel.Instance.GetBool(HangUpAutoBoolType.isAutoDrop) == false)
|
| | |
| | | continue;
|
| | | }
|
| | |
|
| | | if (!CheckCanPickUp(m_MapItemDict[m_MapItemIdList[i]]))
|
| | | if (!CheckCanPickUp(m_MapItemDict[m_MapItemIdList[i]]) && !UserInputHandler.isTouched)
|
| | | {
|
| | | continue;
|
| | | }
|
| | |
| | | public event Action<float> loadingProgressEvent;
|
| | |
|
| | | bool m_IsServerPreparing = false;
|
| | | public bool isServerPreparing {
|
| | | public bool isServerPreparing
|
| | | {
|
| | | get { return m_IsServerPreparing; }
|
| | | set { m_IsServerPreparing = value; }
|
| | | }
|
| | |
|
| | | public Stage.E_StageType StageType {
|
| | | get {
|
| | | public Stage.E_StageType StageType
|
| | | {
|
| | | get
|
| | | {
|
| | | return m_StageType;
|
| | | }
|
| | | }
|
| | |
|
| | | public Stage CurrentStage {
|
| | | get {
|
| | | public Stage CurrentStage
|
| | | {
|
| | | get
|
| | | {
|
| | | return m_CurrentStage;
|
| | | }
|
| | | }
|
| | |
|
| | | int m_CurrentMapId;
|
| | | public int currentMapId {
|
| | | public int currentMapId
|
| | | {
|
| | | get { return m_CurrentMapId; }
|
| | | private set { m_CurrentMapId = value; }
|
| | | }
|
| | |
|
| | | int m_CurrentMapResID;
|
| | | public int currentMapResId {
|
| | | get {
|
| | | public int currentMapResId
|
| | | {
|
| | | get
|
| | | {
|
| | | return m_CurrentMapResID;
|
| | | }
|
| | | private set { m_CurrentMapResID = value; }
|
| | |
| | |
|
| | |
|
| | | float m_LoadingProgress = 0f;
|
| | | float loadingProgress {
|
| | | float loadingProgress
|
| | | {
|
| | | get { return m_LoadingProgress; }
|
| | | set {
|
| | | set
|
| | | {
|
| | | m_LoadingProgress = value;
|
| | | if (loadingProgressEvent != null)
|
| | | {
|
| | |
| | | _hero.SwitchWing((uint)_itemModel.itemInfo.ItemID);
|
| | | }
|
| | |
|
| | | _itemModel = _equipModel.GetItemModelByIndex((int)RoleEquipType.mount);
|
| | |
|
| | | if (_itemModel != null)
|
| | | var _mapConfig = Config.Instance.Get<MapConfig>(PlayerDatas.Instance.baseData.MapID);
|
| | | if (_mapConfig.CanRide == 1)
|
| | | {
|
| | | PlayerMountDatas _mountModel = ModelCenter.Instance.GetModel<PlayerMountDatas>();
|
| | | if (_mountModel.HorseRidingBool)
|
| | | _itemModel = _equipModel.GetItemModelByIndex((int)RoleEquipType.mount);
|
| | |
|
| | | if (_itemModel != null)
|
| | | {
|
| | | _hero.OnHorse(1);
|
| | | PlayerMountDatas _mountModel = ModelCenter.Instance.GetModel<PlayerMountDatas>();
|
| | | if (_mountModel.HorseRidingBool)
|
| | | {
|
| | | _hero.OnHorse(1);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | switch (type)
|
| | | {
|
| | | case ChatInfoType.World:
|
| | | case ChatInfoType.Fairy:
|
| | | if (IsAssitChat(msg) != 0)
|
| | | {
|
| | | teamModel.RequestAssistAutoMatch();
|
| | | }
|
| | | break;
|
| | | }
|
| | |
|
| | | switch (type)
|
| | | {
|
| | | case ChatInfoType.World:
|
| | | {
|
| | | C0201_tagCTalkGong chatPack = new C0201_tagCTalkGong();
|
| | | chatPack.Len = (ushort)GetUTF8InfoLen(msg);
|
| | | chatPack.Content = msg;
|
| | | GameNetSystem.Instance.SendInfo(chatPack);
|
| | |
|
| | | CheckSendAssitChat(msg);
|
| | | }
|
| | | break;
|
| | | case ChatInfoType.Area:
|
| | |
| | | chatPack.Len = (ushort)GetUTF8InfoLen(msg);
|
| | | chatPack.Content = msg;
|
| | | GameNetSystem.Instance.SendInfo(chatPack);
|
| | |
|
| | | CheckSendAssitChat(msg);
|
| | | }
|
| | | break;
|
| | | case ChatInfoType.Trumpet:
|
| | |
| | | public void RevChatInfo(H0201_tagTalkGong vNetData)
|
| | | {
|
| | | ChatData chatData = null;
|
| | | var content = vNetData.Content;
|
| | | if (IsInviteChat(vNetData.Content))
|
| | | {
|
| | | string content = InviteRegex.Replace(vNetData.Content, "");
|
| | | content = InviteRegex.Replace(vNetData.Content, "");
|
| | | if (teamModel.myTeam.GetIndexOfMember((int)vNetData.PlayerID) != -1)
|
| | | {
|
| | | content = StringUtility.Contact("<color=#f8983b>", vNetData.Name, "</color>", ":", content);
|
| | |
| | | KeepChatInfo(chatData);
|
| | | return;
|
| | | }
|
| | | chatData = new ChatWorldData(vNetData.Content, (int)vNetData.PlayerID, vNetData.Name, vNetData.Extras);
|
| | | if (IsAssitChat(content, true) == 2 && vNetData.PlayerID != PlayerDatas.Instance.baseData.PlayerID)
|
| | | {
|
| | | content = StringUtility.Contact(content, Language.Get("InviteTeam", vNetData.PlayerID));
|
| | | }
|
| | | chatData = new ChatWorldData(content, (int)vNetData.PlayerID, vNetData.Name, vNetData.Extras);
|
| | | KeepChatInfo(chatData);
|
| | | }
|
| | | /// <summary>
|
| | |
| | | /// <param name="vNetData"></param>
|
| | | public void RevChatInfo(H0203_tagTalkBang vNetData)
|
| | | {
|
| | | ChatData chatData = new ChatFamilyData(vNetData.Content, (int)vNetData.PlayerID, vNetData.Name, vNetData.Extras);
|
| | | var content = vNetData.Content;
|
| | | if (IsAssitChat(content, true) == 1 && vNetData.PlayerID != PlayerDatas.Instance.baseData.PlayerID)
|
| | | {
|
| | | content = StringUtility.Contact(content, Language.Get("InviteTeam", vNetData.PlayerID));
|
| | | }
|
| | | ChatData chatData = new ChatFamilyData(content, (int)vNetData.PlayerID, vNetData.Name, vNetData.Extras);
|
| | | KeepChatInfo(chatData);
|
| | | ReceiveNewChat(ChatInfoType.Fairy);
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | public bool needCheckAssitChat { get; set; }
|
| | | void CheckSendAssitChat(string message)
|
| | | int IsAssitChat(string message, bool force = false)
|
| | | {
|
| | | if (needCheckAssitChat)
|
| | | int assitChat = 0;
|
| | | if (needCheckAssitChat || force)
|
| | | {
|
| | | bool requestTeam = false;
|
| | | for (int i = 0; i < 2; i++)
|
| | | {
|
| | | if (message.Equals(Language.Get(realmRandomChats[i])))
|
| | | {
|
| | | requestTeam = true;
|
| | | assitChat = 1;
|
| | | break;
|
| | | }
|
| | |
|
| | | var content = message;
|
| | | if (i == 1)
|
| | | if (message.Equals(Language.Get(dungeonRandomChats[i])))
|
| | | {
|
| | | content = Regex.Replace(content, "[0-9]+", "{0}");
|
| | | }
|
| | |
|
| | | if (content.Equals(Language.Get(dungeonRandomChats[i])))
|
| | | {
|
| | | requestTeam = true;
|
| | | assitChat = 2;
|
| | | break;
|
| | | }
|
| | | }
|
| | | if (requestTeam)
|
| | | {
|
| | | teamModel.RequestAssistAutoMatch();
|
| | | }
|
| | | }
|
| | | return assitChat;
|
| | | }
|
| | | #endregion
|
| | |
|
| | |
| | | using System.Text.RegularExpressions;
|
| | | using UnityEngine;
|
| | | using Snxxz.UI;
|
| | | using System;
|
| | |
|
| | | public class ChatData
|
| | | {
|
| | |
| | | }
|
| | | richText = new StringBuilder();
|
| | | richText.Length = 0;
|
| | | createTime = DateTime.Now;
|
| | | }
|
| | |
|
| | | private string _content = string.Empty;
|
| | |
| | |
|
| | | public ChatInfoType type { get; protected set; }
|
| | |
|
| | | public DateTime createTime { get; private set; }
|
| | |
|
| | | private ChatInfoType m_DetailType = ChatInfoType.World;
|
| | | public ChatInfoType detailType
|
| | | {
|
| | |
| | | [SerializeField] Image m_ChatBubble;
|
| | | [SerializeField] Text vipText;
|
| | | [SerializeField] Text playerNameText;
|
| | | [SerializeField] Text m_ChatTime;
|
| | | [SerializeField] Image m_ChatIcon;
|
| | | [SerializeField] ImageFitterText m_Fitter;
|
| | |
|
| | |
| | |
|
| | | m_ChatIcon.SetSprite(GeneralDefine.GetJobHeadPortrait(_data.job, 0));
|
| | | playerNameText.text = _data.name;
|
| | | m_ChatTime.text = _data.createTime.ToString("yyyy-MM-dd HH:mm"); |
| | | if (_data.vipLv > 0)
|
| | | {
|
| | | vipText.text = string.Format("V{0}", _data.vipLv);
|
| | |
| | | [SerializeField] Image m_ChatBubble;
|
| | | [SerializeField] Text vipText;
|
| | | [SerializeField] Text playerNameText;
|
| | | [SerializeField] Text m_ChatTime;
|
| | | [SerializeField] Image m_ChatIcon;
|
| | | [SerializeField] ImageFitterText m_Fitter;
|
| | | [SerializeField] Button m_ViewPlayer;
|
| | |
| | | m_Fitter.gameObject.SetActive(!string.IsNullOrEmpty(_data.content));
|
| | | m_ChatIcon.SetSprite(GeneralDefine.GetJobHeadPortrait(_data.job, 0));
|
| | | playerNameText.text = _data.name;
|
| | | m_ChatTime.text = _data.createTime.ToString("yyyy-MM-dd HH:mm");
|
| | | if (_data.vipLv > 0)
|
| | | {
|
| | | vipText.text = string.Format("V{0}", _data.vipLv);
|
| | |
| | | { |
| | | public class ChatPlayerMineCell : ScrollerUI |
| | | { |
| | | [SerializeField] Image chatIcon; |
| | | [SerializeField] Text vipText; |
| | | [SerializeField] Text playerNameText; |
| | | [SerializeField] RichText chatText; |
| | | [SerializeField] Image m_ChatIcon; |
| | | [SerializeField] Text m_VipLv; |
| | | [SerializeField] Text m_PlayerName; |
| | | [SerializeField] Text m_ChatTime; |
| | | [SerializeField] RichText m_Chat; |
| | | [SerializeField] ImageFitterText m_Fitter; |
| | | [SerializeField] Button m_Func; |
| | | |
| | | ChatCenter m_ChatCenter; |
| | | ChatCenter chatCenter |
| | |
| | | } |
| | | public override void Refresh(CellView cell) |
| | | { |
| | | ChatData _data = chatCenter.GetChatData(ChatCtrl.Inst.presentChatType, cell.index); |
| | | if (_data == null) |
| | | ChatData data = chatCenter.GetChatData(ChatCtrl.Inst.presentChatType, cell.index); |
| | | if (data == null) |
| | | { |
| | | return; |
| | | } |
| | | }
|
| | | var chatUserData = data as ChatUeseData; |
| | | |
| | | #region 更新高度 |
| | | chatText.AutoNewLine = false; |
| | | chatText.text = _data.content; |
| | | m_Chat.AutoNewLine = false; |
| | | m_Chat.text = data.content; |
| | | if (type == ScrollerDataType.Header) |
| | | { |
| | | if (chatText.preferredWidth > chatText.rectTransform.rect.width) |
| | | if (m_Chat.preferredWidth > m_Chat.rectTransform.rect.width) |
| | | { |
| | | chatText.alignment = TextAnchor.UpperLeft; |
| | | m_Chat.alignment = TextAnchor.UpperLeft; |
| | | } |
| | | else |
| | | { |
| | | chatText.alignment = TextAnchor.UpperRight; |
| | | m_Chat.alignment = TextAnchor.UpperRight; |
| | | } |
| | | m_Fitter.FiterRealTxtWidth = chatText.alignment == TextAnchor.UpperRight; |
| | | m_Fitter.FiterRealTxtWidth = m_Chat.alignment == TextAnchor.UpperRight; |
| | | } |
| | | chatText.AutoNewLine = true; |
| | | chatIcon.SetSprite(GeneralDefine.GetJobHeadPortrait((_data as ChatUeseData).job, 0)); |
| | | m_Chat.AutoNewLine = true; |
| | | m_ChatIcon.SetSprite(GeneralDefine.GetJobHeadPortrait(chatUserData.job, 0)); |
| | | #endregion |
| | | Button headBtn = chatIcon.GetComponent<Button>(); |
| | | headBtn.onClick.RemoveAllListeners(); |
| | | headBtn.onClick.AddListener(() => |
| | | |
| | | m_Func.onClick.RemoveAllListeners(); |
| | | m_Func.onClick.AddListener(() => |
| | | { |
| | | OnHeadIconClick(cell); |
| | | OnFunc(cell); |
| | | }); |
| | | playerNameText.text = (_data as ChatUeseData).name; |
| | | if ((_data as ChatUeseData).vipLv > 0) |
| | | m_PlayerName.text = chatUserData.name;
|
| | | m_ChatTime.text = data.createTime.ToString("yyyy-MM-dd HH:mm"); |
| | | if (chatUserData.vipLv > 0) |
| | | { |
| | | vipText.text = string.Format("V{0}", (_data as ChatUeseData).vipLv); |
| | | m_VipLv.text = string.Format("V{0}", chatUserData.vipLv); |
| | | } |
| | | else |
| | | { |
| | | vipText.text = string.Empty; |
| | | m_VipLv.text = string.Empty; |
| | | } |
| | | } |
| | | |
| | | private void OnHeadIconClick(CellView cell) |
| | | private void OnFunc(CellView cell) |
| | | { |
| | | int index = cell.index; |
| | | ChatData _data = chatCenter.GetChatData(ChatCtrl.Inst.presentChatType, index); |
| | |
| | | return; |
| | | } |
| | | ChatUeseData user = _data as ChatUeseData; |
| | | if (user.player == PlayerDatas.Instance.baseData.PlayerID) return; |
| | | if (user.player == PlayerDatas.Instance.baseData.PlayerID)
|
| | | {
|
| | | return;
|
| | | } |
| | | HrefAnalysis.Inst.ExcuteHrefEvent(string.Format("showplayer={0}", user.player)); |
| | | } |
| | | } |
| | |
| | | |
| | | public class ChatPlayerOtherCell : ScrollerUI |
| | | { |
| | | [SerializeField] Image chatIcon; |
| | | [SerializeField] Text vipText; |
| | | [SerializeField] Text playerNameText; |
| | | [SerializeField] RectTransform bubbleRt; |
| | | [SerializeField] RichText chatText; |
| | | [SerializeField] Image m_ChatIcon; |
| | | [SerializeField] Text m_VipLv; |
| | | [SerializeField] Text m_PlayerName; |
| | | [SerializeField] Text m_ChatTime; |
| | | [SerializeField] RectTransform m_Bottom; |
| | | [SerializeField] RichText m_Chat; |
| | | [SerializeField] Button m_Func; |
| | | |
| | | ChatCenter m_ChatCenter; |
| | | ChatCenter chatCenter |
| | |
| | | } |
| | | public override void Refresh(CellView cell) |
| | | { |
| | | ChatData _data = chatCenter.GetChatData(ChatCtrl.Inst.presentChatType, cell.index); |
| | | if (_data == null) |
| | | var data = chatCenter.GetChatData(ChatCtrl.Inst.presentChatType, cell.index); |
| | | if (data == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | #region 更新高度 |
| | | if (type == ScrollerDataType.Header) |
| | | { |
| | | if (chatText.preferredWidth > chatText.rectTransform.rect.width) |
| | | if (m_Chat.preferredWidth > m_Chat.rectTransform.rect.width) |
| | | { |
| | | chatText.alignment = TextAnchor.UpperLeft; |
| | | m_Chat.alignment = TextAnchor.UpperLeft; |
| | | } |
| | | else |
| | | { |
| | | chatText.alignment = TextAnchor.UpperRight; |
| | | m_Chat.alignment = TextAnchor.UpperRight; |
| | | } |
| | | } |
| | | #endregion |
| | | Button headBtn = chatIcon.GetComponent<Button>(); |
| | | headBtn.onClick.RemoveAllListeners(); |
| | | headBtn.onClick.AddListener(() => |
| | | |
| | | var chatUserData = data as ChatUeseData; |
| | | m_Func.onClick.RemoveAllListeners(); |
| | | m_Func.onClick.AddListener(() => |
| | | { |
| | | OnHeadIconClick(cell); |
| | | OnFunc(cell); |
| | | }); |
| | | chatIcon.SetSprite(GeneralDefine.GetJobHeadPortrait((_data as ChatUeseData).job, 0)); |
| | | playerNameText.text = (_data as ChatUeseData).name; |
| | | if ((_data as ChatUeseData).vipLv > 0) |
| | | m_ChatIcon.SetSprite(GeneralDefine.GetJobHeadPortrait(chatUserData.job, 0)); |
| | | m_PlayerName.text = chatUserData.name; |
| | | m_ChatTime.text = data.createTime.ToString("yyyy-MM-dd HH:mm"); |
| | | if (chatUserData.vipLv > 0) |
| | | { |
| | | vipText.text = string.Format("V{0}", (_data as ChatUeseData).vipLv); |
| | | m_VipLv.text = string.Format("V{0}", chatUserData.vipLv); |
| | | } |
| | | else |
| | | { |
| | | vipText.text = string.Empty; |
| | | m_VipLv.text = string.Empty; |
| | | } |
| | | chatText.AutoNewLine = true; |
| | | chatText.text = _data.content; |
| | | m_Chat.AutoNewLine = true; |
| | | m_Chat.text = data.content; |
| | | } |
| | | |
| | | private void OnHeadIconClick(CellView cell) |
| | | private void OnFunc(CellView cell) |
| | | { |
| | | int index = cell.index; |
| | | ChatData _data = chatCenter.GetChatData(ChatCtrl.Inst.presentChatType, index); |
| | |
| | | return; |
| | | } |
| | | ChatUeseData user = _data as ChatUeseData; |
| | | if (user.player == PlayerDatas.Instance.baseData.PlayerID) return; |
| | | if (user.player == PlayerDatas.Instance.baseData.PlayerID)
|
| | | {
|
| | | return;
|
| | | } |
| | | HrefAnalysis.Inst.ExcuteHrefEvent(string.Format("showplayer={0}", user.player)); |
| | | } |
| | | } |
| | |
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using System.Text;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | | public class ChatTip : MonoBehaviour
|
| | |
| | |
|
| | | private List<GameObject> chatItems = new List<GameObject>(ChatCtrl.CHAT_TIP_CNT);
|
| | |
|
| | | static StringBuilder sb = new StringBuilder();
|
| | |
|
| | | void InitCom()
|
| | | {
|
| | | chatBg = this.GetComponent<Image>("Image");
|
| | |
| | | private bool OnGetDynamicSize(ScrollerDataType type, int index, out float height)
|
| | | {
|
| | | destText.SetExtenalData(chatUpDataList[index].infoList);
|
| | | destText.text = SetChatExtraInfo(chatUpDataList[index]) + chatUpDataList[index].content;
|
| | | destText.text = StringUtility.Contact(SetChatExtraInfo(chatUpDataList[index]),
|
| | | chatUpDataList[index].content);
|
| | | height = destText.preferredHeight;
|
| | | return true;
|
| | | }
|
| | |
| | | {
|
| | | text.SetExtenalData(chatUpDataList[index].infoList);
|
| | | }
|
| | | text.text = SetChatExtraInfo(chatUpDataList[index]) + chatUpDataList[index].content;
|
| | | text.text = StringUtility.Contact(SetChatExtraInfo(chatUpDataList[index]),
|
| | | chatUpDataList[index].content);
|
| | | text.OnClick = () =>
|
| | | {
|
| | | OnChatDataClick(data);
|
| | |
| | |
|
| | | string SetChatExtraInfo(ChatData data)
|
| | | {
|
| | | sb.Length = 0;
|
| | | string vipLv = string.Empty;
|
| | | string chatIcon = string.Empty;
|
| | | string chatName = string.Empty;
|
| | | var chatUserData = (data as ChatUeseData);
|
| | | switch (data.type)
|
| | | {
|
| | | case ChatInfoType.World:
|
| | | {
|
| | | return string.Format("<Img chat={0}/> <color=#109d06>{1}</color>: ", "ChatIcon_World", (data as ChatUeseData).name);
|
| | | chatIcon = "ChatIcon_World";
|
| | | chatName = chatUserData.name;
|
| | | if (chatUserData.vipLv > 0)
|
| | | {
|
| | | vipLv = StringUtility.Contact("V", chatUserData.vipLv);
|
| | | }
|
| | | break;
|
| | | }
|
| | | case ChatInfoType.Area:
|
| | | return string.Format("<Img chat={0}/> <color=#109d06>{1}</color>: ", "ChatIcon_Area", (data as ChatUeseData).name);
|
| | | {
|
| | | chatIcon = "ChatIcon_Area";
|
| | | chatName = chatUserData.name;
|
| | | if (chatUserData.vipLv > 0)
|
| | | {
|
| | | vipLv = StringUtility.Contact("V", chatUserData.vipLv);
|
| | | }
|
| | | break;
|
| | | }
|
| | | case ChatInfoType.Team:
|
| | | {
|
| | | string playerName = (data as ChatUeseData).name;
|
| | | return string.Format("<Img chat={0}/> <color=#109d06>{1}</color>", "ChatIcon_Team", playerName + (playerName != string.Empty ? ": " : string.Empty));
|
| | | chatIcon = "ChatIcon_Team";
|
| | | chatName = chatUserData.name;
|
| | | if (chatUserData.vipLv > 0)
|
| | | {
|
| | | vipLv = StringUtility.Contact("V", chatUserData.vipLv);
|
| | | }
|
| | | break;
|
| | | }
|
| | | case ChatInfoType.Friend:
|
| | | break;
|
| | | case ChatInfoType.Fairy:
|
| | | {
|
| | | string playerName = (data as ChatUeseData).name;
|
| | | return string.Format("<Img chat={0}/> <color=#109d06>{1}</color>", "ChatIcon_Fairy", playerName + (playerName != string.Empty ? ": " : string.Empty));
|
| | | chatIcon = "ChatIcon_Fairy";
|
| | | chatName = chatUserData.name;
|
| | | if (chatUserData.vipLv > 0)
|
| | | {
|
| | | vipLv = StringUtility.Contact("V", chatUserData.vipLv);
|
| | | }
|
| | | break;
|
| | | }
|
| | | case ChatInfoType.Trumpet:
|
| | | return string.Format("<Img chat={0}/> <color=#109d06>{1}</color>: ", "ChatIcon_Trumpet", (data as ChatTrumpetData).name);
|
| | | {
|
| | | chatIcon = "ChatIcon_Trumpet";
|
| | | chatName = chatUserData.name;
|
| | | if (chatUserData.vipLv > 0)
|
| | | {
|
| | | vipLv = StringUtility.Contact("V", chatUserData.vipLv);
|
| | | }
|
| | | break;
|
| | | }
|
| | | case ChatInfoType.Invite:
|
| | | return string.Format("<Img chat={0}/> ", "ChatIcon_Invite");
|
| | | {
|
| | | chatIcon = "ChatIcon_Invite";
|
| | | break;
|
| | | }
|
| | | case ChatInfoType.System:
|
| | | return string.Format("<Img chat={0}/> ", "ChatIcon_System");
|
| | | {
|
| | | chatIcon = "ChatIcon_System";
|
| | | break;
|
| | | }
|
| | | }
|
| | | return string.Empty;
|
| | | if (!string.IsNullOrEmpty(chatIcon))
|
| | | {
|
| | | sb.Append(string.Format("<Img chat={0}/> ", chatIcon));
|
| | | }
|
| | | if (!string.IsNullOrEmpty(vipLv))
|
| | | {
|
| | | sb.Append(string.Format("<color=#f8983b>{0}</color> ", vipLv));
|
| | | }
|
| | | if (!string.IsNullOrEmpty(chatName))
|
| | | {
|
| | | sb.Append(string.Format("<color=#109d06>{0}</color>: ", chatName));
|
| | | }
|
| | | return sb.ToString();
|
| | | }
|
| | |
|
| | | private void OnDisable()
|
| | |
| | | public InputField serverId;
|
| | | public InputField account;
|
| | | public InputField password;
|
| | | public InputField platform;
|
| | |
|
| | | public Toggle isToken;
|
| | |
|
| | | string appidRecorder
|
| | | {
|
| | | string appidRecorder {
|
| | | get { return LocalSave.GetString("DebugLogin_AppId"); }
|
| | | set { LocalSave.SetString("DebugLogin_AppId", value); }
|
| | | }
|
| | |
|
| | | string serverIdRecorder
|
| | | {
|
| | | string serverIdRecorder {
|
| | | get { return LocalSave.GetString("DebugLogin_ServerId"); }
|
| | | set { LocalSave.SetString("DebugLogin_ServerId", value); }
|
| | | }
|
| | |
|
| | |
|
| | | string accountRecorder
|
| | | {
|
| | | string accountRecorder {
|
| | | get { return LocalSave.GetString("DebugLogin_Account"); }
|
| | | set { LocalSave.SetString("DebugLogin_Account", value); }
|
| | | }
|
| | |
|
| | | string passwordRecorder
|
| | | {
|
| | | string passwordRecorder {
|
| | | get { return LocalSave.GetString("DebugLogin_Password"); }
|
| | | set { LocalSave.SetString("DebugLogin_Password", value); }
|
| | | }
|
| | |
|
| | | bool istokenRecorder
|
| | | {
|
| | | int platformRecorder {
|
| | | get {
|
| | | return LocalSave.GetInt("DebugLoging_Platform", 1);
|
| | | }
|
| | | set {
|
| | | LocalSave.SetInt("DebugLoging_Platform", value);
|
| | | }
|
| | | }
|
| | |
|
| | | bool istokenRecorder {
|
| | | get { return LocalSave.GetBool("DebugLogin_IsToken", false); }
|
| | | set { LocalSave.SetBool("DebugLogin_IsToken", value); }
|
| | | }
|
| | |
| | | serverId.text = serverIdRecorder;
|
| | | account.text = accountRecorder;
|
| | | password.text = passwordRecorder;
|
| | | platform.text = platformRecorder.ToString();
|
| | | isToken.isOn = istokenRecorder;
|
| | | }
|
| | |
|
| | |
| | | serverIdRecorder = serverId.text;
|
| | | accountRecorder = account.text;
|
| | | passwordRecorder = password.text;
|
| | | var platformTemp = 0;
|
| | | int.TryParse(platform.text, out platformTemp);
|
| | | platformRecorder = platformTemp;
|
| | | istokenRecorder = isToken.isOn;
|
| | |
|
| | | if (!string.IsNullOrEmpty(appid.text))
|
| | |
| | | VersionConfig.Get().m_AppId = appid.text;
|
| | | }
|
| | |
|
| | | SDKUtility.Instance.ChannelPlatform = (SDKUtility.E_ChannelPlatform)int.Parse(platform.text);
|
| | |
|
| | | if (isToken.isOn)
|
| | | {
|
| | | var loginModel = ModelCenter.Instance.GetModel<LoginModel>();
|
| | |
| | | m_Horizontal.GetChild(i).gameObject.SetActive(true);
|
| | | ItemCell ItemCell = m_Horizontal.GetChild(i).GetComponent<ItemCell>();
|
| | | float value = GetRating() * QuantityList[i];
|
| | | ItemCellModel cellModel = new ItemCellModel(RewardList[i], true, (ulong)Math.Floor(value), 0);
|
| | | ItemCellModel cellModel = new ItemCellModel(RewardList[i], true, (ulong)Math.Round(value,0), 0);
|
| | | ItemCell.Init(cellModel);
|
| | | }
|
| | | else
|
| | |
| | | {
|
| | | var cB910 = new CB910_tagCGQueryTeamMemFuncData();
|
| | | cB910.TeamMemFuncType = 0;
|
| | | mainModel.IsSend = false;
|
| | | GameNetSystem.Instance.SendInfo(cB910);
|
| | | }
|
| | | else
|
| | |
| | | {
|
| | | mainModel.LayerNumber = 0;
|
| | | }
|
| | | mainModel.IsSend = true;
|
| | | }
|
| | | SnxxzGame.Instance.StartCoroutine(AwaitTime());
|
| | | }
|
| | |
| | | IEnumerator AwaitTime()
|
| | | {
|
| | | yield return WaitingForSecondConst.WaitMS700;
|
| | | var mainModel = ModelCenter.Instance.GetModel<PlayerMainDate>();
|
| | | if (!mainModel.IsSend)
|
| | | {
|
| | | yield break;
|
| | | }
|
| | | WindowCenter.Instance.Open<FloorChooseWin>();
|
| | | }
|
| | |
|
| | |
| | |
|
| | | public class LaunchBackGroundWin : Window
|
| | | {
|
| | | [SerializeField] RectTransform m_StaticBackGround;
|
| | | [SerializeField] Image m_BackGroundImage;
|
| | | [SerializeField] RectTransform m_DynamicBackGround;
|
| | | [SerializeField] SkeletonGraphic m_SkeletonGraphic;
|
| | |
|
| | | GameObject loginEffect;
|
| | |
|
| | | bool useStaticBackGround = false;
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | |
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | var sprite = Resources.Load<Sprite>("UI/Sprites/LoginBackGround");
|
| | | useStaticBackGround = sprite != null;
|
| | |
|
| | | if (useStaticBackGround)
|
| | | {
|
| | | m_BackGroundImage.overrideSprite = sprite;
|
| | | m_StaticBackGround.gameObject.SetActive(true);
|
| | | m_DynamicBackGround.gameObject.SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_StaticBackGround.gameObject.SetActive(false);
|
| | | m_DynamicBackGround.gameObject.SetActive(true);
|
| | | }
|
| | |
|
| | | if (loginEffect != null)
|
| | | {
|
| | | loginEffect.gameObject.SetActive(false);
|
| | |
| | | {
|
| | | base.OnActived();
|
| | |
|
| | | if (m_SkeletonGraphic != null)
|
| | | if (!useStaticBackGround)
|
| | | {
|
| | | m_SkeletonGraphic.AnimationState.SetEmptyAnimations(0);
|
| | | if (m_SkeletonGraphic != null)
|
| | | {
|
| | | m_SkeletonGraphic.AnimationState.SetEmptyAnimations(0);
|
| | | }
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | public void ShowLoginEffect()
|
| | | {
|
| | | if (loginEffect != null)
|
| | | if (!useStaticBackGround)
|
| | | {
|
| | | loginEffect.gameObject.SetActive(true);
|
| | | }
|
| | | if (loginEffect != null)
|
| | | {
|
| | | loginEffect.gameObject.SetActive(true);
|
| | | }
|
| | |
|
| | | if (m_SkeletonGraphic != null)
|
| | | {
|
| | | m_SkeletonGraphic.AnimationState.SetAnimation(0, "animation2", true);
|
| | | if (m_SkeletonGraphic != null)
|
| | | {
|
| | | m_SkeletonGraphic.AnimationState.SetAnimation(0, "animation2", true);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | | public int LayerNumberNow = 0;//现在的选择层数
|
| | | public bool IsSend = false;//像服务端法宝请求回包保护
|
| | | //-------------用来控住主界面的Tip的执行调用
|
| | | public bool IsTipBool = true;
|
| | |
|
| | |
| | | presentHrefInfo.Add(split_value, array[1]);
|
| | | }
|
| | | break;
|
| | | case "jointeam":
|
| | | {
|
| | | presentHrefInfo.mEvents.Add(RichTextEventEnum.JOINTEAM);
|
| | | presentHrefInfo.Add(split_value, array[1]);
|
| | | }
|
| | | break;
|
| | | case "openui":
|
| | | {
|
| | | presentHrefInfo.mEvents.Add(RichTextEventEnum.OPENUI);
|
| | |
| | | SHOWPLAYER,//玩家详情
|
| | | TIP,//信息提示
|
| | | GetWay,//获取途径
|
| | | JOINTEAM,//加入队伍
|
| | | }
|
| | |
| | | RichTextMgr.Inst.RegisterEvent(RichTextEventEnum.OPENUI, this);
|
| | | RichTextMgr.Inst.RegisterEvent(RichTextEventEnum.TIP, this);
|
| | | RichTextMgr.Inst.RegisterEvent(RichTextEventEnum.GetWay, this);
|
| | | RichTextMgr.Inst.RegisterEvent(RichTextEventEnum.JOINTEAM, this);
|
| | | }
|
| | |
|
| | | public override bool Execute(RichTextEventEnum type, RichTextMgr.HrefInfo href)
|
| | |
| | | }
|
| | | }
|
| | | break;
|
| | | case RichTextEventEnum.JOINTEAM:
|
| | | {
|
| | | uint id = 0;
|
| | | if (uint.TryParse(href.mSplits["jointeam"], out id))
|
| | | {
|
| | | var teamModel = ModelCenter.Instance.GetModel<TeamModel>();
|
| | | if (teamModel.myTeam.GetIndexOfMember((int)id) != -1)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("AlreadyInTeam2");
|
| | | return false;
|
| | | }
|
| | | teamModel.RequestInviteJoinTeam((int)id);
|
| | | }
|
| | | }
|
| | | break;
|
| | | case RichTextEventEnum.INVITE:
|
| | | {
|
| | | uint id = 0;
|
| | |
| | | FairyGrabBossNotice,
|
| | | [Header("限时抢购")]
|
| | | FlashRushToBuy,
|
| | | [Header("许愿池")]
|
| | | WishingPool,
|
| | | }
|
| | | }
|
| | |
|
| New file |
| | |
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class OperationWishingWellInfo : OperationBase
|
| | | {
|
| | | public Dictionary<int, List<WishingWellItem>> wellItemDict = new Dictionary<int, List<WishingWellItem>>(); //key 组
|
| | |
|
| | | public override void Reset()
|
| | | {
|
| | | base.Reset();
|
| | | wellItemDict.Clear();
|
| | | }
|
| | |
|
| | | public override string ToDisplayTime()
|
| | | {
|
| | | var textBuilder = OperationTimeHepler.textBuilder;
|
| | | textBuilder.Length = 0;
|
| | | textBuilder.Append(startDate.ToDisplay());
|
| | | if (startDate != endDate)
|
| | | {
|
| | | textBuilder.Append("—");
|
| | | textBuilder.Append(endDate.ToDisplay());
|
| | | }
|
| | | return textBuilder.ToString();
|
| | | }
|
| | |
|
| | | public List<WishingWellItem> GetWellItemsByGroupType(int groupType)
|
| | | {
|
| | | List<WishingWellItem> items = null;
|
| | | wellItemDict.TryGetValue(groupType,out items);
|
| | | return items;
|
| | | }
|
| | |
|
| | | public int GetActivityDay()
|
| | | {
|
| | | int dayIndex = IndexOfDays(TimeUtility.ServerNow);
|
| | | return dayIndex + 1;
|
| | | }
|
| | |
|
| | | public void ParsePackage(HAA19_tagMCActWishingWellInfo package)
|
| | | {
|
| | | for (int i = 0; i < package.Count; i++)
|
| | | {
|
| | | var itemInfo = package.WellItemInfo[i];
|
| | | var wellItem = new WishingWellItem((int)itemInfo.ItemID,itemInfo.ItemCnt,itemInfo.IsBind,(int)itemInfo.Mark);
|
| | | int group = GetGroupTypeByMark(wellItem.mark);
|
| | | if(!wellItemDict.ContainsKey(group))
|
| | | {
|
| | | List<WishingWellItem> list = new List<WishingWellItem>();
|
| | | list.Add(wellItem);
|
| | | wellItemDict.Add(group,list);
|
| | | }
|
| | | else
|
| | | {
|
| | | wellItemDict[group].Add(wellItem);
|
| | | }
|
| | | }
|
| | |
|
| | | foreach(var key in wellItemDict.Keys)
|
| | | {
|
| | | wellItemDict[key].Sort(CompareByMark);
|
| | | }
|
| | | }
|
| | |
|
| | | public int GetGroupTypeByMark(int mark)
|
| | | {
|
| | | return mark / 100;
|
| | | }
|
| | |
|
| | | public int GetGroupIndexByMark(int mark)
|
| | | {
|
| | | return mark % 100;
|
| | | }
|
| | |
|
| | | public int CompareByMark(WishingWellItem start,WishingWellItem end)
|
| | | {
|
| | | if(start.mark.CompareTo(end.mark) != 0)
|
| | | {
|
| | | return -start.mark.CompareTo(end.mark);
|
| | | }
|
| | | return 0;
|
| | | }
|
| | | |
| | | public class WishingWellItem
|
| | | {
|
| | | public int itemId;
|
| | | public int itemCount;
|
| | | public int isBind;
|
| | | public int mark;// 排序标识
|
| | | public WishingWellItem(int id, int count, int isBind,int mark)
|
| | | {
|
| | | this.itemId = id;
|
| | | this.itemCount = count;
|
| | | this.isBind = isBind;
|
| | | this.mark = mark;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 63866afdba3f2ad47a206dc17e8da80f |
| | | timeCreated: 1540178667 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using UnityEngine;
|
| | | using UnityEngine.EventSystems;
|
| | | using UnityEngine.UI;
|
| | | using TableConfig;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
| | | {
|
| | | [SerializeField] CommonItemBaisc itemBaisc;
|
| | | [SerializeField] GameObject bestIconObj;
|
| | | |
| | | [SerializeField] Text nameText;
|
| | | ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
|
| | | WishingPoolModel wishingModel { get { return ModelCenter.Instance.GetModel<WishingPoolModel>(); } }
|
| | | int index = -1;
|
| | |
| | | public void Display(int index)
|
| | | {
|
| | | this.index = index;
|
| | | int id = 0;
|
| | | bool isPoolData = wishingModel.TryGetPoolDataByIndex(index,out id);
|
| | | WishingPoolModel.WishingWellItem wellItem = null;
|
| | | bool isPoolData = wishingModel.TryGetPoolDataByIndex(index,out wellItem);
|
| | | ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(wellItem.itemId);
|
| | | nameText.text = itemConfig.ItemName;
|
| | | nameText.color = UIHelper.GetUIColor(itemConfig.ItemColor);
|
| | | bestIconObj.SetActive(false);
|
| | | ItemCellModel cellModel = new ItemCellModel(id);
|
| | | ItemCellModel cellModel = new ItemCellModel(wellItem.itemId,false,(ulong)wellItem.itemCount,wellItem.isBind);
|
| | | itemBaisc.Init(cellModel);
|
| | | itemBaisc.cellBtn.RemoveAllListeners();
|
| | | itemBaisc.cellBtn.AddListener(()=>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(id);
|
| | | ItemAttrData attrData = new ItemAttrData(wellItem.itemId, true, (ulong)wellItem.itemCount, -1,wellItem.isBind);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | | });
|
| | | }
|
| New file |
| | |
| | | using EnhancedUI.EnhancedScroller;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | | using System;
|
| | | using TableConfig;
|
| | | using System.Collections.Generic;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class WishGroupCell : ScrollerUI
|
| | | {
|
| | | [SerializeField] List<PoolItem> poolItems = new List<PoolItem>();
|
| | | WishingPoolModel wishModel { get { return ModelCenter.Instance.GetModel<WishingPoolModel>(); } }
|
| | | ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
|
| | |
|
| | | public override void Refresh(CellView cell)
|
| | | {
|
| | | var operation = wishModel.GetOperationWishing();
|
| | | if (operation == null) return;
|
| | | var items = operation.GetWellItemsByGroupType(cell.index);
|
| | | if (items == null) return;
|
| | |
|
| | | for(int i = 0; i < poolItems.Count; i++)
|
| | | {
|
| | | var poolItem = poolItems[i];
|
| | | if(i < items.Count)
|
| | | {
|
| | | poolItem.Object.SetActive(true);
|
| | | var info = items[i];
|
| | | ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(info.itemId);
|
| | | poolItem.nameText.text = itemConfig.ItemName;
|
| | | poolItem.nameText.color = UIHelper.GetUIColor(itemConfig.ItemColor);
|
| | | ItemCellModel cellModel = new ItemCellModel(info.itemId,true,(ulong)info.itemCount,info.isBind);
|
| | | poolItem.itemBaisc.Init(cellModel);
|
| | | if(i == 0)
|
| | | {
|
| | | poolItem.bestImg.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | poolItem.bestImg.SetActive(false);
|
| | | }
|
| | |
|
| | | poolItem.itemBaisc.cellBtn.RemoveAllListeners();
|
| | | poolItem.itemBaisc.cellBtn.AddListener(()=>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(info.itemId,true, (ulong)info.itemCount,-1,info.isBind);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | poolItem.Object.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | [Serializable]
|
| | | public class PoolItem
|
| | | {
|
| | | public GameObject Object;
|
| | | public CommonItemBaisc itemBaisc;
|
| | | public GameObject bestImg;
|
| | | public Text nameText;
|
| | | }
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 788a58cd965d16646b5452012b08d27b |
| | | timeCreated: 1540193610 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | | using TableConfig;
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class WishItemCell : MonoBehaviour
|
| | | {
|
| | | [SerializeField] CommonItemBaisc itemBaisc;
|
| | | [SerializeField] GameObject noneItemObj;
|
| | | [SerializeField] Button noneItemBtn;
|
| | | [SerializeField] Text nameText;
|
| | |
|
| | | ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
|
| | | WishingPoolModel wishingModel { get { return ModelCenter.Instance.GetModel<WishingPoolModel>(); } }
|
| | | public void Display(int index)
|
| | | {
|
| | | WishingPoolModel.WishingWellItem wellItem = null;
|
| | | bool isWishData = wishingModel.TryGetWishDataByIndex(index, out wellItem);
|
| | | if (isWishData)
|
| | | {
|
| | | nameText.gameObject.SetActive(true);
|
| | | itemBaisc.gameObject.SetActive(true);
|
| | | noneItemObj.gameObject.SetActive(false);
|
| | | ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(wellItem.itemId);
|
| | | nameText.text = itemConfig.ItemName;
|
| | | nameText.color = UIHelper.GetUIColor(itemConfig.ItemColor);
|
| | | ItemCellModel cellModel = new ItemCellModel(wellItem.itemId, false, (ulong)wellItem.itemCount, wellItem.isBind);
|
| | | itemBaisc.Init(cellModel);
|
| | | itemBaisc.cellBtn.RemoveAllListeners();
|
| | | itemBaisc.cellBtn.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(wellItem.itemId, true, (ulong)wellItem.itemCount, -1, wellItem.isBind);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | itemBaisc.gameObject.SetActive(false);
|
| | | noneItemObj.gameObject.SetActive(true);
|
| | | nameText.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: c37d2addeecee1b4d91b72098f044169 |
| | | timeCreated: 1540260925 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | namespace Snxxz.UI
|
| | | {
|
| | | [XLua.LuaCallCSharp]
|
| | | public class WishingPoolModel : Model,IBeforePlayerDataInitialize,IPlayerLoginOk
|
| | | public class WishingPoolModel : Model,IBeforePlayerDataInitialize,IPlayerLoginOk,IOpenServerActivity
|
| | | {
|
| | | public event Action<int> UpdateWishingDataEvent;
|
| | | public event Action<int> UpdatePoolDataEvent;
|
| | |
|
| | | public event Action<int> onStateUpate;
|
| | | public const int WishRedKey = 20915;
|
| | | public override void Init()
|
| | | {
|
| | | |
| | | OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent;
|
| | | OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent;
|
| | | OperationTimeHepler.Instance.operationAdvanceEvent += OperationAdvanceEvent;
|
| | | OpenServerActivityCenter.Instance.Register((int)OpenServerActivityCenter.OSActivityType.FlashRushToBuy, this);
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | |
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | SetWishingPoolData();
|
| | | UpdateRedpoint();
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | public bool IsOpen
|
| | | {
|
| | | get
|
| | | {
|
| | | return OperationTimeHepler.Instance.SatisfyOpenCondition(Operation.WishingWellInfo);
|
| | | }
|
| | | }
|
| | |
|
| | | public bool priorityOpen
|
| | | {
|
| | | get
|
| | | {
|
| | | return wishPoolRedpoint.state == RedPointState.Simple;
|
| | | }
|
| | | }
|
| | |
|
| | | public bool IsAdvance
|
| | | {
|
| | | get
|
| | | {
|
| | | return OperationTimeHepler.Instance.SatisfyAdvanceCondition(Operation.WishingWellInfo);
|
| | | }
|
| | | }
|
| | |
|
| | | private void OperationEndEvent(Operation type, int state)
|
| | | {
|
| | | if (type == Operation.WishingWellInfo && state == 1)
|
| | | {
|
| | | UpdateRedpoint();
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate((int)OpenServerActivityCenter.OSActivityType.WishingPool);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void OperationAdvanceEvent(Operation type)
|
| | | {
|
| | | if (type == Operation.WishingWellInfo)
|
| | | {
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate((int)OpenServerActivityCenter.OSActivityType.WishingPool);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void OperationStartEvent(Operation type, int state)
|
| | | {
|
| | | if (type == Operation.WishingWellInfo && state == 1)
|
| | | {
|
| | | UpdateRedpoint();
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate((int)OpenServerActivityCenter.OSActivityType.WishingPool);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public OperationWishingWellInfo GetOperationWishing()
|
| | | {
|
| | | OperationBase operationBase;
|
| | | if (OperationTimeHepler.Instance.TryGetOperationTime(Operation.WishingWellInfo, out operationBase))
|
| | | {
|
| | | return operationBase as OperationWishingWellInfo;
|
| | | }
|
| | |
|
| | | return null;
|
| | | }
|
| | |
|
| | | public bool TryGetFreeWishCoolTime(out int second)
|
| | | {
|
| | | second = 0;
|
| | | if (freeStartTime == 25) return false;
|
| | |
|
| | | int endhour = freeStartTime + 2;
|
| | | int nowHour = TimeUtility.ServerNow.Hour;
|
| | | second = (endhour - nowHour) * 3600;
|
| | | if(second > 0)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | #region 本地数据
|
| | | public bool isDraging { get; set; }
|
| | |
| | | #endregion
|
| | |
|
| | | #region 协议
|
| | | Dictionary<int, int> poolDataDict = new Dictionary<int, int>();
|
| | | public void SetWishingPoolData()
|
| | | Dictionary<int, WishingWellItem> poolDataDict = new Dictionary<int, WishingWellItem>();
|
| | | public int freeStartTime { get; private set; }// 免费开始倒计时时间
|
| | | public int alreadyWishNum { get; private set; } // 许愿付费刷新次数
|
| | |
|
| | | public void SetWishingWellPlayerInfo(HAA1A_tagMCActWishingWellPlayerInfo wishInfo)
|
| | | {
|
| | | for(int i = 0; i< 8; i++)
|
| | | freeStartTime = (int)wishInfo.FreeStartTime;
|
| | | alreadyWishNum = (int)wishInfo.WishCnt;
|
| | | for(int i = 0; i < wishInfo.WellItemCnt; i++)
|
| | | {
|
| | | int itemId = 1 + i;
|
| | | SetWishingPoolData(i,itemId);
|
| | | var itemInfo = wishInfo.WellItemInfo[i];
|
| | | WishingWellItem wellItem = new WishingWellItem((int)itemInfo.ItemID,itemInfo.ItemCnt,itemInfo.IsBind);
|
| | | SetWishingPoolData(i,wellItem);
|
| | | }
|
| | |
|
| | | for(int i = 0; i < wishInfo.CurAwardCnt; i++)
|
| | | {
|
| | | var itemInfo = wishInfo.CurAwardItemInfo[i];
|
| | | WishingWellItem wellItem = new WishingWellItem((int)itemInfo.ItemID, itemInfo.ItemCnt, itemInfo.IsBind);
|
| | | SetWishingData(i, wellItem);
|
| | | }
|
| | |
|
| | | wishingAwardDict.Clear();
|
| | | for (int i = 0; i < wishInfo.LastAwardCnt; i++)
|
| | | {
|
| | | var itemInfo = wishInfo.LastAwardItemInfo[i];
|
| | | WishingWellItem wellItem = new WishingWellItem((int)itemInfo.ItemID, itemInfo.ItemCnt, itemInfo.IsBind);
|
| | | SetWishingAwardData(i, wellItem);
|
| | | }
|
| | | UpdateRedpoint();
|
| | | }
|
| | |
|
| | | public void SetWishingPoolData(int index, int id)
|
| | | public void SetWishingPoolData(int index, WishingWellItem wellItem)
|
| | | {
|
| | | if (!poolDataDict.ContainsKey(index))
|
| | | {
|
| | | poolDataDict.Add(index, id);
|
| | | poolDataDict.Add(index,wellItem);
|
| | | }
|
| | | else
|
| | | {
|
| | | poolDataDict[index] = id;
|
| | | poolDataDict[index] = wellItem;
|
| | | }
|
| | | if(UpdatePoolDataEvent != null)
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | Dictionary<int, int> wishingDataDict = new Dictionary<int, int>();
|
| | | public void SetWishingData(int index,int id)
|
| | | Dictionary<int, WishingWellItem> wishingDataDict = new Dictionary<int, WishingWellItem>();
|
| | | public void SetWishingData(int index, WishingWellItem wellItem)
|
| | | {
|
| | | if(!wishingDataDict.ContainsKey(index))
|
| | | {
|
| | | wishingDataDict.Add(index,id);
|
| | | wishingDataDict.Add(index,wellItem);
|
| | | }
|
| | | else
|
| | | {
|
| | | wishingDataDict[index] = id;
|
| | | wishingDataDict[index] = wellItem;
|
| | | }
|
| | |
|
| | | if(UpdateWishingDataEvent != null)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public bool TryGetPoolDataByIndex(int index,out int id)
|
| | | Dictionary<int, WishingWellItem> wishingAwardDict = new Dictionary<int, WishingWellItem>();
|
| | | public void SetWishingAwardData(int index, WishingWellItem wellItem)
|
| | | {
|
| | | return poolDataDict.TryGetValue(index,out id);
|
| | | if (!wishingAwardDict.ContainsKey(index))
|
| | | {
|
| | | wishingAwardDict.Add(index, wellItem);
|
| | | }
|
| | | else
|
| | | {
|
| | | wishingAwardDict[index] = wellItem;
|
| | | }
|
| | | }
|
| | | |
| | | public bool IsBetterItem()
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool TryGetWishDataByIndex(int index, out int id)
|
| | | public bool TryGetPoolDataByIndex(int index,out WishingWellItem wellItem)
|
| | | {
|
| | | return wishingDataDict.TryGetValue(index, out id);
|
| | | if(poolDataDict.TryGetValue(index, out wellItem))
|
| | | {
|
| | | if(wellItem.itemId != 0)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool TryGetWishDataByIndex(int index, out WishingWellItem wellItem)
|
| | | {
|
| | | if(wishingDataDict.TryGetValue(index, out wellItem))
|
| | | {
|
| | | if(wellItem.itemId != 0)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public void SendRefreshPoolInfo(int refreshType)
|
| | | {
|
| | | CAA07_tagCMActWishingRefresh wishingRefresh = new CAA07_tagCMActWishingRefresh();
|
| | | wishingRefresh.IsFree = (byte)refreshType;
|
| | | GameNetSystem.Instance.SendInfo(wishingRefresh);
|
| | | }
|
| | |
|
| | | public void SendRefreshWishInfo(int poolIndex,int wishIndex)
|
| | | {
|
| | | CAA06_tagCMActWishing actWishing = new CAA06_tagCMActWishing();
|
| | | actWishing.SrcWellType = 0;
|
| | | actWishing.SrcIndex = (byte)poolIndex;
|
| | | actWishing.DesWellType = 1;
|
| | | actWishing.DesIndex = (byte)wishIndex;
|
| | | GameNetSystem.Instance.SendInfo(actWishing);
|
| | |
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region 红点
|
| | | public Redpoint wishPoolRedpoint = new Redpoint(MainRedDot.REDPOINT_OPENSERVER, WishRedKey);
|
| | | public const int FREEWISH_REDKEY = 2091501;
|
| | | public Redpoint freeWishRedpoint = new Redpoint(WishRedKey, FREEWISH_REDKEY);
|
| | | public List<Redpoint> wishPointlist = new List<Redpoint>();
|
| | | public void SetWishRedpoint()
|
| | | {
|
| | | wishPointlist.Clear();
|
| | | for (int i = 0; i < 5; i++)
|
| | | {
|
| | | int redKey = WishRedKey * 100 + (i + 2);
|
| | | Redpoint redpoint = new Redpoint(WishRedKey,redKey);
|
| | | wishPointlist.Add(redpoint);
|
| | | }
|
| | | }
|
| | | private void UpdateRedpoint()
|
| | | {
|
| | | int second = 0;
|
| | | bool isCool = TryGetFreeWishCoolTime(out second);
|
| | | if(IsOpen && !isCool)
|
| | | {
|
| | | freeWishRedpoint.state = RedPointState.Simple;
|
| | | }
|
| | | else
|
| | | {
|
| | | freeWishRedpoint.state = RedPointState.None;
|
| | | }
|
| | |
|
| | | for (int i = 0; i < wishPointlist.Count; i++)
|
| | | {
|
| | | var wishPoint = wishPointlist[i];
|
| | | wishPoint.state = RedPointState.None;
|
| | | }
|
| | |
|
| | | for (int i = 0; i < wishPointlist.Count; i++)
|
| | | {
|
| | | var wishPoint = wishPointlist[i];
|
| | | WishingWellItem wellItem = null;
|
| | | bool isWishData = TryGetWishDataByIndex(i,out wellItem);
|
| | | if(!isWishData)
|
| | | {
|
| | | wishPoint.state = RedPointState.Simple;
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | public void ResetPoolData()
|
| | | {
|
| | | freeStartTime = 25;
|
| | | poolDataDict.Clear();
|
| | | wishingDataDict.Clear();
|
| | | wishingAwardDict.Clear();
|
| | | }
|
| | |
|
| | | public class WishingWellItem
|
| | | {
|
| | | public int itemId;
|
| | | public int itemCount;
|
| | | public int isBind;
|
| | | public WishingWellItem(int id,int count,int isBind)
|
| | | {
|
| | | this.itemId = id;
|
| | | this.itemCount = count;
|
| | | this.isBind = isBind;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | public class WishingPoolWin : Window
|
| | | {
|
| | | [SerializeField] DragItem dragItem;
|
| | | [SerializeField] Text activityDayText;
|
| | | [SerializeField] Text totalDayText;
|
| | | [SerializeField] Text dayRemainTime;
|
| | | [SerializeField] Button lookAllBtn;
|
| | | [SerializeField] Button freeRefreshWishBtn;
|
| | | [SerializeField] Button moneyRefreshWishBtn;
|
| | | [SerializeField] Text moneyValueText;
|
| | | [SerializeField] Text freeWishCoolText;
|
| | | [SerializeField] List<PoolItemCell> poolItemCells = new List<PoolItemCell>();
|
| | | [SerializeField] List<WishingCell> wishingCells = new List<WishingCell>();
|
| | | [SerializeField] List<WishItemCell> wishingCells = new List<WishItemCell>();
|
| | | [SerializeField] GameObject activityOpenObj;
|
| | | [SerializeField] GameObject activityCloseObj;
|
| | |
|
| | | ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
|
| | | WishingPoolModel wishingModel { get { return ModelCenter.Instance.GetModel<WishingPoolModel>(); } }
|
| | | OperationWishingWellInfo operation = null;
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | |
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | |
| | | freeRefreshWishBtn.AddListener(ClickFreeRefreshWish);
|
| | | moneyRefreshWishBtn.AddListener(ClickMoneyRefreshWish);
|
| | | lookAllBtn.AddListener(ClickLook);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | Display();
|
| | | OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent;
|
| | | wishingModel.UpdatePoolDataEvent += UpdatePoolItemByIndex;
|
| | | wishingModel.UpdateWishingDataEvent += UpdateWishItemByIndex;
|
| | | Display();
|
| | | GlobalTimeEvent.Instance.secondEvent += UpdateSecond;
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | |
| | | {
|
| | | wishingModel.UpdatePoolDataEvent -= UpdatePoolItemByIndex;
|
| | | wishingModel.UpdateWishingDataEvent -= UpdateWishItemByIndex;
|
| | | GlobalTimeEvent.Instance.secondEvent -= UpdateSecond;
|
| | | OperationTimeHepler.Instance.operationEndEvent -= OperationEndEvent;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | |
|
| | |
| | |
|
| | | private void Display()
|
| | | {
|
| | | operation = wishingModel.GetOperationWishing();
|
| | | if (operation == null) return;
|
| | |
|
| | | UpdatePoolItem();
|
| | | for(int i = 0; i < wishingCells.Count; i++)
|
| | | {
|
| | | UpdateWishItemByIndex(i);
|
| | | }
|
| | | dragItem.dragItemRect.gameObject.SetActive(false);
|
| | | UpdateFreeWishCool();
|
| | | UpdateActivityState();
|
| | | UpdateDayRemainTime();
|
| | | activityDayText.text = Language.Get("WishingPool103", Language.Get(StringUtility.Contact("Num_CHS_", operation.GetActivityDay())));
|
| | | totalDayText.text = Language.Get("WishingPool101", Language.Get(StringUtility.Contact("Num_CHS_", operation.totalDays + 1)));
|
| | | }
|
| | |
|
| | |
|
| | | #region 许愿逻辑
|
| | | protected override void LateUpdate()
|
| | | {
|
| | | if(wishingModel.isDraging)
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | private void CheckWishingCell()
|
| | | {
|
| | | for(int i = 0; i < wishingCells.Count; i++)
|
| | | {
|
| | | var rect = wishingCells[i].wishRect;
|
| | | var rect = wishingCells[i].transform as RectTransform;
|
| | | var des = RectTransformUtility.CalculateRelativeRectTransformBounds(this.transform, rect);
|
| | | var src = RectTransformUtility.CalculateRelativeRectTransformBounds(this.transform, dragItem.dragItemRect);
|
| | | var dis = Vector3.Distance(des.center, src.center);
|
| | | if (dis < rect.rect.width / 2)
|
| | | {
|
| | | int poolId = 0;
|
| | | bool isPoolData = wishingModel.TryGetPoolDataByIndex(wishingModel.dragIndex, out poolId);
|
| | | int wishId = 0;
|
| | | bool isWishData = wishingModel.TryGetWishDataByIndex(i, out wishId);
|
| | | if (wishId == 0)
|
| | | {
|
| | | wishingModel.RemovetWishingPoolData(i);
|
| | | }
|
| | | else
|
| | | {
|
| | | wishingModel.SetWishingPoolData(wishingModel.dragIndex, wishId);
|
| | | }
|
| | | wishingModel.SetWishingData(i,poolId);
|
| | | //WishingPoolModel.WishingWellItem wellPoolItem = null;
|
| | | //bool isPoolData = wishingModel.TryGetPoolDataByIndex(wishingModel.dragIndex, out wellPoolItem);
|
| | | //WishingPoolModel.WishingWellItem wellWishItem = null;
|
| | | //bool isWishData = wishingModel.TryGetWishDataByIndex(i, out wellWishItem);
|
| | | //if (wellWishItem.itemId == 0)
|
| | | //{
|
| | | // wishingModel.RemovetWishingPoolData(i);
|
| | | //}
|
| | | //else
|
| | | //{
|
| | | // wishingModel.SetWishingPoolData(wishingModel.dragIndex,wellWishItem);
|
| | | //}
|
| | | //wishingModel.SetWishingData(i,wellPoolItem);
|
| | | wishingModel.SendRefreshWishInfo(wishingModel.dragIndex,i);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | private bool TryGetDragItem()
|
| | | {
|
| | | int id = 0;
|
| | | bool isPoolData = wishingModel.TryGetPoolDataByIndex(wishingModel.dragIndex, out id);
|
| | | WishingPoolModel.WishingWellItem wellItem = null;
|
| | | bool isPoolData = wishingModel.TryGetPoolDataByIndex(wishingModel.dragIndex, out wellItem);
|
| | | if (isPoolData)
|
| | | {
|
| | | dragItem.dragItemRect.gameObject.SetActive(true);
|
| | | dragItem.dragBestIcon.SetActive(false);
|
| | | ItemCellModel cellModel = new ItemCellModel(id);
|
| | | ItemCellModel cellModel = new ItemCellModel(wellItem.itemId,false,(ulong)wellItem.itemCount,wellItem.isBind);
|
| | | dragItem.dragItemBasic.Init(cellModel);
|
| | | }
|
| | | else
|
| | |
| | |
|
| | | private void UpdatePoolItemByIndex(int index)
|
| | | {
|
| | | int id = 0;
|
| | | WishingPoolModel.WishingWellItem wellItem = null;
|
| | | var poolItemCell = poolItemCells[index];
|
| | | bool isPoolData = wishingModel.TryGetPoolDataByIndex(index, out id);
|
| | | bool isPoolData = wishingModel.TryGetPoolDataByIndex(index, out wellItem);
|
| | | if (isPoolData)
|
| | | {
|
| | | poolItemCell.gameObject.SetActive(true);
|
| | |
| | |
|
| | | private void UpdateWishItemByIndex(int index)
|
| | | {
|
| | | int id = 0;
|
| | | var wishCell = wishingCells[index];
|
| | | bool isWishData = wishingModel.TryGetWishDataByIndex(index, out id);
|
| | | if (isWishData)
|
| | | {
|
| | | wishCell.itemBaisc.gameObject.SetActive(true);
|
| | | wishCell.noneItemObj.gameObject.SetActive(false);
|
| | | ItemCellModel cellModel = new ItemCellModel(id);
|
| | | wishCell.itemBaisc.Init(cellModel);
|
| | | wishCell.itemBaisc.cellBtn.RemoveAllListeners();
|
| | | wishCell.itemBaisc.cellBtn.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(id);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | wishCell.itemBaisc.gameObject.SetActive(false);
|
| | | wishCell.noneItemObj.gameObject.SetActive(true);
|
| | | }
|
| | | }
|
| | |
|
| | | [Serializable]
|
| | | public class WishingCell
|
| | | {
|
| | | public RectTransform wishRect;
|
| | | public CommonItemBaisc itemBaisc;
|
| | | public GameObject noneItemObj;
|
| | | public Button noneItemBtn;
|
| | | wishCell.Display(index);
|
| | | }
|
| | |
|
| | | [Serializable]
|
| | |
| | | public CommonItemBaisc dragItemBasic;
|
| | | public GameObject dragBestIcon;
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region 活动逻辑
|
| | | private void OperationEndEvent(Operation type, int state)
|
| | | {
|
| | | if(type == Operation.WishingWellInfo && state == 1)
|
| | | {
|
| | | UpdateActivityState();
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | private void UpdateSecond()
|
| | | {
|
| | | if (operation == null) return;
|
| | | UpdateFreeWishCool();
|
| | | UpdateDayRemainTime();
|
| | | }
|
| | |
|
| | | private void UpdateDayRemainTime()
|
| | | {
|
| | | dayRemainTime.text = Language.Get("WishingPool104", TimeUtility.SecondsToHMS(operation.GetResetSurplusTime()));
|
| | | }
|
| | |
|
| | | private void UpdateFreeWishCool()
|
| | | {
|
| | | int second = 0;
|
| | | bool isCool = wishingModel.TryGetFreeWishCoolTime(out second);
|
| | | if (isCool)
|
| | | {
|
| | | freeRefreshWishBtn.gameObject.SetActive(false);
|
| | | freeWishCoolText.gameObject.SetActive(true);
|
| | | moneyRefreshWishBtn.gameObject.SetActive(true);
|
| | | moneyValueText.text = "100";
|
| | | freeWishCoolText.text = Language.Get("WishingPool102", TimeUtility.SecondsToHMS(second));
|
| | | }
|
| | | else
|
| | | {
|
| | |
|
| | | freeRefreshWishBtn.gameObject.SetActive(true);
|
| | | freeWishCoolText.gameObject.SetActive(false);
|
| | | moneyRefreshWishBtn.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | private void UpdateActivityState()
|
| | | {
|
| | | if (wishingModel.IsOpen)
|
| | | {
|
| | | activityOpenObj.SetActive(true);
|
| | | activityCloseObj.SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | | activityOpenObj.SetActive(false);
|
| | | activityCloseObj.SetActive(true);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | private void ClickLook()
|
| | | {
|
| | | WindowCenter.Instance.Open<WishingWarehouseWin>();
|
| | | }
|
| | |
|
| | | private void ClickMoneyRefreshWish()
|
| | | {
|
| | | wishingModel.SendRefreshPoolInfo(0);
|
| | | }
|
| | |
|
| | | private void ClickFreeRefreshWish()
|
| | | {
|
| | | wishingModel.SendRefreshPoolInfo(1);
|
| | | }
|
| | | #endregion
|
| | |
|
| | | }
|
| | | }
|
| New file |
| | |
| | | using System;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class WishingWarehouseWin : Window
|
| | | {
|
| | | [SerializeField] Button closeBtn;
|
| | | [SerializeField] ScrollerController wishGroupCtrl;
|
| | | WishingPoolModel wishModel { get { return ModelCenter.Instance.GetModel<WishingPoolModel>(); } }
|
| | | protected override void BindController()
|
| | | {
|
| | | |
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | closeBtn.AddListener(CloseClick);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | CreateWishGroup();
|
| | | }
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | |
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | |
| | | }
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | private void CreateWishGroup()
|
| | | {
|
| | | var operation = wishModel.GetOperationWishing();
|
| | | if (operation == null) return;
|
| | | wishGroupCtrl.Refresh();
|
| | | foreach(var key in operation.wellItemDict.Keys)
|
| | | {
|
| | | wishGroupCtrl.AddCell(ScrollerDataType.Header,key);
|
| | | }
|
| | | wishGroupCtrl.Restart();
|
| | | }
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: fe79dd1562e90624bb7c5e2443363897 |
| | | timeCreated: 1540193204 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System;
|
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class AddPointBehaviour : MonoBehaviour
|
| | | {
|
| | | [SerializeField] int m_Property;
|
| | | [SerializeField] Text m_PropertyName;
|
| | | [SerializeField] Text m_PropertyValue;
|
| | | [SerializeField] Text m_PropertyPreview;
|
| | | [SerializeField] RectTransform m_PointBottom;
|
| | | [SerializeField] Button m_Sub;
|
| | | [SerializeField] Button m_Add;
|
| | |
|
| | | public int property
|
| | | {
|
| | | get { return m_Property; }
|
| | | }
|
| | |
|
| | | public Text propertyName
|
| | | {
|
| | | get { return m_PropertyName; }
|
| | | }
|
| | |
|
| | | public Text propertyValue
|
| | | {
|
| | | get { return m_PropertyValue; }
|
| | | }
|
| | |
|
| | | public Text propertyPreview
|
| | | {
|
| | | get { return m_PropertyPreview; }
|
| | | }
|
| | |
|
| | | public RectTransform pointBottom
|
| | | {
|
| | | get
|
| | | {
|
| | | return m_PointBottom;
|
| | | }
|
| | | }
|
| | |
|
| | | public Action<int> onPreview;
|
| | | public Action<int, bool> onSub;
|
| | | public Action<int, bool> onAdd;
|
| | |
|
| | | private void Awake()
|
| | | {
|
| | | UIEventTrigger.Get(m_PropertyPreview.gameObject).OnNoParamsClick = () =>
|
| | | {
|
| | | if (onPreview != null)
|
| | | {
|
| | | onPreview(property);
|
| | | }
|
| | | };
|
| | | UIEventTrigger.Get(m_Sub.gameObject).OnDown = OnSubDown;
|
| | | UIEventTrigger.Get(m_Sub.gameObject).OnUp = OnSubUp;
|
| | | UIEventTrigger.Get(m_Add.gameObject).OnDown = OnAddDown;
|
| | | UIEventTrigger.Get(m_Add.gameObject).OnUp = OnAddUp;
|
| | | }
|
| | |
|
| | | private void OnAddUp(GameObject go)
|
| | | {
|
| | | if (onAdd != null)
|
| | | {
|
| | | onAdd(property, false);
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnAddDown(GameObject go)
|
| | | {
|
| | | if (onAdd != null)
|
| | | {
|
| | | onAdd(property, true);
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnSubDown(GameObject go)
|
| | | {
|
| | | if (onSub != null)
|
| | | {
|
| | | onSub(property, true);
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnSubUp(GameObject go)
|
| | | {
|
| | | if (onSub != null)
|
| | | {
|
| | | onSub(property, false);
|
| | | }
|
| | | }
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e12ce6e065f8801458ea82da575ad306 |
| | | timeCreated: 1540280577 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | [SerializeField] Button closeBtn;
|
| | | [SerializeField] Button baseBtn;
|
| | | [SerializeField] Button specialBtn;
|
| | | [SerializeField] Button addBtn;
|
| | |
|
| | | [SerializeField] Image baseImg;
|
| | | [SerializeField] Image specialImg;
|
| | | [SerializeField] Image addImg;
|
| | |
|
| | | [SerializeField] Text m_BaseTxt;
|
| | | [SerializeField] Text m_SpecialTxt;
|
| | | [SerializeField] Text m_AddTxt;
|
| | |
|
| | | private readonly Color selectTxtCol = new Color32(52, 7, 1, 255);
|
| | | private readonly Color unSelectTxtCol = new Color32(125, 91, 52, 255);
|
| | |
| | |
|
| | | [SerializeField] Text descText;
|
| | |
|
| | | private void OnAddBtn()
|
| | | {
|
| | | if (attrShowType == 3) return;
|
| | | attrShowType = 3;
|
| | |
|
| | | addImg.SetSprite("2LVSelectTab_b");
|
| | | specialImg.SetSprite("2LVUnSelectTab_b");
|
| | | baseImg.SetSprite("2LVUnSelectTab_b");
|
| | | m_BaseTxt.color = unSelectTxtCol;
|
| | | m_SpecialTxt.color = unSelectTxtCol;
|
| | | m_AddTxt.color = selectTxtCol;
|
| | | OnRefreshScroll();
|
| | | }
|
| | |
|
| | | private void OnSpecialBtn()
|
| | | {
|
| | | if (attrShowType == 2) return;
|
| | | attrShowType = 2;
|
| | |
|
| | | addImg.SetSprite("2LVUnSelectTab_b");
|
| | | specialImg.SetSprite("2LVSelectTab_b");
|
| | | baseImg.SetSprite("2LVUnSelectTab_b");
|
| | | m_BaseTxt.color = unSelectTxtCol;
|
| | | m_SpecialTxt.color = selectTxtCol;
|
| | | m_AddTxt.color = unSelectTxtCol;
|
| | |
|
| | | OnRefreshScroll();
|
| | | }
|
| | |
| | | if (attrShowType == 1) return;
|
| | | attrShowType = 1;
|
| | |
|
| | | addImg.SetSprite("2LVUnSelectTab_b");
|
| | | specialImg.SetSprite("2LVUnSelectTab_b");
|
| | | baseImg.SetSprite("2LVSelectTab_b");
|
| | | m_BaseTxt.color = selectTxtCol;
|
| | | m_SpecialTxt.color = unSelectTxtCol;
|
| | | m_AddTxt.color = unSelectTxtCol;
|
| | |
|
| | | OnRefreshScroll();
|
| | | }
|
| | |
| | | m_Controller.OnGetDynamicSize += OnGetDynamicSize;
|
| | | specialBtn.onClick.AddListener(OnSpecialBtn);
|
| | | baseBtn.onClick.AddListener(OnBaseBtn);
|
| | | addBtn.onClick.AddListener(OnAddBtn);
|
| | | closeBtn.onClick.AddListener(OnClose);
|
| | | }
|
| | |
|
| | |
| | | [SerializeField] RectTransform m_ContainerExp;
|
| | | [SerializeField] Slider m_ExpSlider;
|
| | | [SerializeField] Text m_WorldExp;
|
| | | [SerializeField] Button m_AddPoint;
|
| | | [SerializeField] Button m_PlayerPropertyBtn;
|
| | | [SerializeField] Button m_TitleBtn;
|
| | | [SerializeField] Button m_RenameBtn;
|
| | |
| | | {
|
| | | WindowCenter.Instance.Open<RoleAttrWin>();
|
| | | }
|
| | | //private void OnPromoteClick()
|
| | | //{
|
| | | // if (FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.AddPoint))
|
| | | // {
|
| | | // WindowCenter.Instance.Open<RolePoint>();
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // FuncOpen.Instance.ProcessorFuncErrorTip((int)FuncOpenEnum.AddPoint);
|
| | | // }
|
| | | //}
|
| | |
|
| | | private void OnPromoteClick()
|
| | | {
|
| | | if (FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.AddPoint))
|
| | | {
|
| | | WindowCenter.Instance.Open<RolePointWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | FuncOpen.Instance.ProcessorFuncErrorTip((int)FuncOpenEnum.AddPoint);
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnRefreshPlayerInfo(PlayerDataRefresh refreshType)
|
| | | {
|
| | | switch (refreshType)
|
| | |
| | | functionButtonMagician.onClick.AddListener(OnFuncMagician);
|
| | | functionButtonGulu.onClick.AddListener(OnFuncGulu);
|
| | | functionButtonHorucx.onClick.AddListener(OnFuncHorucx);
|
| | | //m_PromoteBtn.onClick.AddListener(OnPromoteClick);
|
| | | m_AddPoint.onClick.AddListener(OnPromoteClick);
|
| | | m_PlayerPropertyBtn.onClick.AddListener(OnAttrExplainClick);
|
| | | m_TitleBtn.onClick.AddListener(OnDesignationClick);
|
| | | m_RenameBtn.onClick.AddListener(OnRenameClick);
|
| New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using TableConfig; |
| | | namespace Snxxz.UI |
| | | { |
| | | public class RolePointModel : Model,IPlayerLoginOk |
| | | { |
| | | public override void Init() |
| | | { |
| | | ParseConfig(); |
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent; |
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += PlayerDataRefreshInfoEvent; |
| | | } |
| | | |
| | | public override void UnInit() |
| | | {
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= PlayerDataRefreshInfoEvent; |
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | UpdateRedPoint();
|
| | | }
|
| | |
|
| | | private void PlayerDataRefreshInfoEvent(PlayerDataRefresh refreshType)
|
| | | {
|
| | | if (refreshType == PlayerDataRefresh.FreePoint)
|
| | | {
|
| | | UpdateRedPoint();
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnFuncStateChangeEvent(int func) |
| | | { |
| | | if ((FuncOpenEnum)func == FuncOpenEnum.AddPoint) |
| | | { |
| | | UpdateRedPoint(); |
| | | } |
| | | } |
| | | |
| | | private Dictionary<int, Dictionary<int, string>> formulaDict = new Dictionary<int, Dictionary<int, string>>(); |
| | | public bool TryGetPointFormula(int job, out Dictionary<int, string> dict) |
| | | { |
| | | return formulaDict.TryGetValue(job, out dict); |
| | | } |
| | | |
| | | public bool ContainsProperty(int type) |
| | | { |
| | | Dictionary<int, string> dict; |
| | | return formulaDict.TryGetValue(PlayerDatas.Instance.baseData.Job, out dict) && dict.ContainsKey(type); |
| | | } |
| | | |
| | | private Dictionary<int, Dictionary<int, float>> suggestDict = new Dictionary<int, Dictionary<int, float>>(); |
| | | public bool TryGetPointSuggest(int job, out Dictionary<int, float> dict) |
| | | { |
| | | return suggestDict.TryGetValue(job, out dict); |
| | | }
|
| | |
|
| | | public int[] propertys { get; private set; } |
| | | |
| | | private Dictionary<int, Dictionary<int, int>> initPointDict = new Dictionary<int, Dictionary<int, int>>(); |
| | | public bool TryGetPointInit(int job,out Dictionary<int, int> dict) |
| | | { |
| | | return initPointDict.TryGetValue(job, out dict); |
| | | } |
| | | |
| | | private void ParseConfig() |
| | | { |
| | | FuncConfigConfig config; |
| | | for (int i = 1; i <= 3; i++) |
| | | { |
| | | config = Config.Instance.Get<FuncConfigConfig>(string.Format("PointAttr{0}", i)); |
| | | if (config != null) |
| | | { |
| | | Dictionary<int, string> dic = ConfigParse.GetDic<int, string>(config.Numerical1); |
| | | formulaDict.Add(i, dic); |
| | | } |
| | | config = Config.Instance.Get<FuncConfigConfig>(string.Format("PointAdd{0}", i)); |
| | | if (config != null) |
| | | { |
| | | Dictionary<int, float> dic = ConfigParse.GetDic<int, float>(config.Numerical1); |
| | | suggestDict.Add(i, dic); |
| | | } |
| | | config = Config.Instance.Get<FuncConfigConfig>(string.Format("CreatRolePoint{0}", i)); |
| | | if (config != null) |
| | | { |
| | | Dictionary<int, int> dic = ConfigParse.GetDic<int, int>(config.Numerical1); |
| | | initPointDict.Add(i, dic); |
| | | } |
| | | } |
| | | config = Config.Instance.Get<FuncConfigConfig>("PointAddAttr"); |
| | | propertys = ConfigParse.GetMultipleStr<int>(config.Numerical1); |
| | | } |
| | | |
| | | public Redpoint redpoint = new Redpoint(10101, 1010101); |
| | | |
| | | public void UpdateRedPoint() |
| | | { |
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.AddPoint)) |
| | | { |
| | | return; |
| | | } |
| | | redpoint.state = PlayerDatas.Instance.baseData.FreePoint > 0 ? RedPointState.Simple : RedPointState.None; |
| | | } |
| | | |
| | | public void SendAddPoint(int type, int point) |
| | | { |
| | | C0301_tagCAddPoint pak = new C0301_tagCAddPoint(); |
| | | pak.Type = (byte)type; |
| | | pak.Point = (ushort)point; |
| | | GameNetSystem.Instance.SendInfo(pak); |
| | | }
|
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 0e26857000300af4a8cceca9ddf5a553 |
| | | timeCreated: 1540277852 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Tuesday, October 23, 2018
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using TableConfig;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class RolePointWin : Window
|
| | | {
|
| | | [SerializeField] Button m_Close; |
| | | [SerializeField] Button m_Suggest; |
| | | [SerializeField] Button m_Confirm; |
| | | [SerializeField] Text m_Point; |
| | | [SerializeField] RectTransform m_ContainerRight; |
| | | [SerializeField] List<PropertyValue> m_PropertyValues; |
| | | [SerializeField] List<AddPointBehaviour> m_AddPoints; |
| | | [SerializeField] NumKeyBoard m_NumkeyBoard;
|
| | |
|
| | | RolePointModel model { get { return ModelCenter.Instance.GetModel<RolePointModel>(); } }
|
| | |
|
| | | bool isSpeedUp = false;
|
| | | int presentAddPoint = 0;
|
| | | int surplusPoint = 0;
|
| | | Dictionary<int, int> allocatPoints = new Dictionary<int, int>();
|
| | |
|
| | | static WaitForSeconds waitSpeedUp = new WaitForSeconds(0.5f);
|
| | | static WaitForSeconds waitSpeedFaster = new WaitForSeconds(0.05f);
|
| | | static WaitForSeconds waitSpeedSlow = new WaitForSeconds(0.2f);
|
| | |
|
| | | const int WAITCNT = 1;
|
| | |
|
| | |
|
| | | protected override void BindController()
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_Close.onClick.AddListener(CloseClick);
|
| | | m_Confirm.onClick.AddListener(Confirm);
|
| | | m_Suggest.onClick.AddListener(Suggest);
|
| | | m_NumkeyBoard.onValueChange.AddListener(OnPointValChange);
|
| | | m_NumkeyBoard.onConfirm.AddListener((bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | m_NumkeyBoard.gameObject.SetActive(false);
|
| | | }
|
| | | });
|
| | | for (int i = 0; i < m_AddPoints.Count; i++)
|
| | | {
|
| | | m_AddPoints[i].onPreview = OnPreview;
|
| | | m_AddPoints[i].onSub = OnSub;
|
| | | m_AddPoints[i].onAdd = OnAdd;
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += OnPlayerInfoRefresh;
|
| | | m_NumkeyBoard.gameObject.SetActive(false);
|
| | | Dictionary<int, string> dict = null;
|
| | | if (model.TryGetPointFormula(PlayerDatas.Instance.baseData.Job, out dict))
|
| | | {
|
| | | int i = 0;
|
| | | foreach (var _type in dict.Keys)
|
| | | {
|
| | | m_PropertyValues[i].property = _type;
|
| | | i++;
|
| | | }
|
| | | }
|
| | | OnRefreshProprety();
|
| | | isSpeedUp = false;
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | HandleAchievement();
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= OnPlayerInfoRefresh;
|
| | | isSpeedUp = false;
|
| | | StopAllCoroutines();
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | if (!WindowJumpMgr.Instance.IsJumpState
|
| | | && !WindowCenter.Instance.IsOpen<RolePanel>()
|
| | | && !WindowCenter.Instance.IsOpen<MainInterfaceWin>())
|
| | | {
|
| | | WindowCenter.Instance.Open<MainInterfaceWin>();
|
| | | }
|
| | | }
|
| | |
|
| | | void OnRefreshProprety()
|
| | | {
|
| | | if (model.propertys != null)
|
| | | {
|
| | | for (int i = 0; i < model.propertys.Length; i++)
|
| | | {
|
| | | var proprety = model.propertys[i];
|
| | | var behaviour = m_AddPoints.Find((x) =>
|
| | | {
|
| | | return x.property == proprety;
|
| | | });
|
| | | var config = Config.Instance.Get<PlayerPropertyConfig>(proprety);
|
| | | behaviour.propertyName.text = config.Name;
|
| | | behaviour.propertyValue.text = UIHelper.GetPropertyMapPlayerData((AttrEnum)proprety).ToString();
|
| | | allocatPoints[proprety] = 0;
|
| | | behaviour.propertyPreview.text = allocatPoints[proprety].ToString();
|
| | | }
|
| | | }
|
| | |
|
| | | surplusPoint = (int)PlayerDatas.Instance.baseData.FreePoint;
|
| | | m_Point.text = surplusPoint.ToString();
|
| | |
|
| | | OnRefreshAdd();
|
| | | }
|
| | |
|
| | | private void OnRefreshAdd()
|
| | | {
|
| | | Equation.Instance.Clear();
|
| | | foreach (var key in allocatPoints.Keys)
|
| | | {
|
| | | var config = Config.Instance.Get<PlayerPropertyConfig>(key);
|
| | | Equation.Instance.AddKeyValue(config.Parameter, allocatPoints[key]);
|
| | | }
|
| | | Dictionary<int, string> dict = null;
|
| | | if (model.TryGetPointFormula(PlayerDatas.Instance.baseData.Job, out dict))
|
| | | {
|
| | | foreach (var property in dict.Keys)
|
| | | {
|
| | | float value = Equation.Instance.Eval<float>(dict[property]);
|
| | | GetProperty(property).RefreshAdd(value);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private PropertyValue GetProperty(int property)
|
| | | {
|
| | | return m_PropertyValues.Find((x) =>
|
| | | {
|
| | | return x.property == property;
|
| | | });
|
| | | }
|
| | |
|
| | | private void HandleAchievement()
|
| | | {
|
| | | if (AchievementGoto.achievementType == AchievementGoto.RolePoint)
|
| | | {
|
| | | var _effect = AchievementGuideEffectPool.Require(1);
|
| | | _effect.transform.SetParentEx(m_Suggest.transform, Vector3.zero, Vector3.zero, Vector3.one);
|
| | | AchievementGoto.achievementType = 0;
|
| | | }
|
| | | }
|
| | |
|
| | | private void Confirm()
|
| | | {
|
| | | foreach (int key in allocatPoints.Keys)
|
| | | {
|
| | | if (allocatPoints[key] > 0)
|
| | | {
|
| | | model.SendAddPoint(key, allocatPoints[key]);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void Suggest()
|
| | | {
|
| | | int points = (int)PlayerDatas.Instance.baseData.FreePoint;
|
| | | int totalpoints = points;
|
| | | int pt = 0;
|
| | |
|
| | | Dictionary<int, float> suggestDict = null;
|
| | | model.TryGetPointSuggest(PlayerDatas.Instance.baseData.Job, out suggestDict);
|
| | | Dictionary<int, int> initDict = null;
|
| | | model.TryGetPointInit(PlayerDatas.Instance.baseData.Job, out initDict);
|
| | |
|
| | | if (suggestDict == null || initDict == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | foreach (var property in suggestDict.Keys)
|
| | | {
|
| | | totalpoints += ((int)UIHelper.GetPropertyMapPlayerData((AttrEnum)property) - initDict[property]);
|
| | | }
|
| | |
|
| | | allocatPoints.Clear();
|
| | | foreach (var property in initDict.Keys)
|
| | | {
|
| | | allocatPoints.Add(property, 0);
|
| | | var behaviour = m_AddPoints.Find((x) =>
|
| | | {
|
| | | return x.property == property;
|
| | | });
|
| | | behaviour.propertyPreview.text = allocatPoints[property].ToString();
|
| | | }
|
| | |
|
| | | foreach (var property in suggestDict.Keys)
|
| | | {
|
| | | int expectpt = Mathf.RoundToInt(suggestDict[property] * totalpoints);
|
| | | int presentpt = expectpt - ((int)UIHelper.GetPropertyMapPlayerData((AttrEnum)property) - initDict[property]);
|
| | | if (presentpt > 0)
|
| | | {
|
| | | if (pt + presentpt > points)
|
| | | {
|
| | | presentpt = points - pt;
|
| | | }
|
| | | pt += presentpt;
|
| | | allocatPoints[property] = presentpt;
|
| | | }
|
| | | var behaviour = m_AddPoints.Find((x) =>
|
| | | {
|
| | | return x.property == property;
|
| | | });
|
| | | behaviour.propertyPreview.text = allocatPoints[property].ToString();
|
| | | }
|
| | |
|
| | | surplusPoint = points - pt;
|
| | | m_Point.text = surplusPoint.ToString();
|
| | | OnRefreshAdd();
|
| | | }
|
| | |
|
| | | private void OnPlayerInfoRefresh(PlayerDataRefresh refreshType)
|
| | | {
|
| | | switch (refreshType)
|
| | | {
|
| | | case PlayerDataRefresh.FreePoint:
|
| | | {
|
| | | OnRefreshProprety();
|
| | | }
|
| | | break;
|
| | | case PlayerDataRefresh.STR:
|
| | | case PlayerDataRefresh.PNE:
|
| | | case PlayerDataRefresh.PHY:
|
| | | case PlayerDataRefresh.CON:
|
| | | {
|
| | | OnRefreshProprety();
|
| | | }
|
| | | break;
|
| | | case PlayerDataRefresh.MAXATK:
|
| | | case PlayerDataRefresh.MINATK:
|
| | | case PlayerDataRefresh.MaxHP:
|
| | | case PlayerDataRefresh.DEF:
|
| | | case PlayerDataRefresh.HIT:
|
| | | case PlayerDataRefresh.AtkInterval:
|
| | | case PlayerDataRefresh.BattleValEx1:
|
| | | {
|
| | | foreach (var property in m_PropertyValues)
|
| | | {
|
| | | property.RefreshValue();
|
| | | }
|
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnPointValChange()
|
| | | {
|
| | | var key = presentAddPoint;
|
| | | surplusPoint += allocatPoints[key];
|
| | | int num = int.Parse(m_NumkeyBoard.Value);
|
| | | if (surplusPoint - num < 0)
|
| | | {
|
| | | num = surplusPoint;
|
| | | }
|
| | | allocatPoints[key] = num;
|
| | | surplusPoint -= num;
|
| | | OnUpdatePoint(key);
|
| | | m_NumkeyBoard.Value = num.ToString();
|
| | | }
|
| | |
|
| | | private void OnUpdatePoint(int key)
|
| | | {
|
| | | var behaviour = m_AddPoints.Find((x) =>
|
| | | {
|
| | | return x.property == key;
|
| | | });
|
| | | behaviour.propertyPreview.text = allocatPoints[key].ToString();
|
| | | m_Point.text = surplusPoint.ToString();
|
| | | OnRefreshAdd();
|
| | | }
|
| | |
|
| | | private void OnAdd(int property, bool down)
|
| | | {
|
| | | if (!down)
|
| | | {
|
| | | isSpeedUp = false;
|
| | | StopAllCoroutines();
|
| | | return;
|
| | | }
|
| | | isSpeedUp = true;
|
| | | if (allocatPoints.ContainsKey(property))
|
| | | {
|
| | | if (surplusPoint < 1)
|
| | | {
|
| | | return;
|
| | | }
|
| | | allocatPoints[property]++;
|
| | | surplusPoint--;
|
| | | OnUpdatePoint(property);
|
| | | }
|
| | | StartCoroutine(Co_OnSpeedUp(true, property));
|
| | | }
|
| | |
|
| | | private void OnSub(int property, bool down)
|
| | | {
|
| | | if (!down)
|
| | | {
|
| | | isSpeedUp = false;
|
| | | StopAllCoroutines();
|
| | | return;
|
| | | }
|
| | | isSpeedUp = true;
|
| | | if (allocatPoints.ContainsKey(property))
|
| | | {
|
| | | if (allocatPoints[property] < 1)
|
| | | {
|
| | | return;
|
| | | }
|
| | | allocatPoints[property]--;
|
| | | surplusPoint++;
|
| | | OnUpdatePoint(property);
|
| | | }
|
| | | StartCoroutine(Co_OnSpeedUp(false, property));
|
| | | }
|
| | |
|
| | | IEnumerator Co_OnSpeedUp(bool up, int property)
|
| | | {
|
| | | yield return waitSpeedUp;
|
| | | int upCnt = 0;
|
| | | while (isSpeedUp)
|
| | | {
|
| | | if (allocatPoints.ContainsKey(property))
|
| | | {
|
| | | if (up)
|
| | | {
|
| | | if (surplusPoint < 1)
|
| | | {
|
| | | yield break;
|
| | | }
|
| | | allocatPoints[property]++;
|
| | | surplusPoint--;
|
| | | OnUpdatePoint(property);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (allocatPoints[property] < 1)
|
| | | {
|
| | | yield break;
|
| | | }
|
| | | allocatPoints[property]--;
|
| | | surplusPoint++;
|
| | | OnUpdatePoint(property);
|
| | | }
|
| | | }
|
| | | if (upCnt < WAITCNT)
|
| | | {
|
| | | yield return waitSpeedSlow;
|
| | | }
|
| | | else
|
| | | {
|
| | | yield return waitSpeedFaster;
|
| | | }
|
| | | upCnt++;
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnPreview(int property)
|
| | | {
|
| | | presentAddPoint = property;
|
| | | m_NumkeyBoard.gameObject.SetActive(true);
|
| | | m_NumkeyBoard.max = (uint)surplusPoint + (uint)allocatPoints[property];
|
| | | m_NumkeyBoard.min = 0;
|
| | | var behaviour = m_AddPoints.Find((x) =>
|
| | | {
|
| | | return x.property == property;
|
| | | });
|
| | | RectTransform parent = behaviour.pointBottom;
|
| | | var worldpos = parent.TransformPoint(new Vector3(0, -parent.rect.height / 2, 0));
|
| | | var localpos = m_ContainerRight.InverseTransformPoint(worldpos);
|
| | | m_NumkeyBoard.transform.localPosition = localpos;
|
| | | }
|
| | |
|
| | | [Serializable]
|
| | | public class PropertyValue
|
| | | {
|
| | | private int m_Property;
|
| | | public int property
|
| | | {
|
| | | get
|
| | | {
|
| | | return m_Property;
|
| | | }
|
| | | set
|
| | | {
|
| | | m_Property = value;
|
| | | Refresh();
|
| | | }
|
| | | }
|
| | |
|
| | | [SerializeField] Text m_PropertyName;
|
| | | [SerializeField] Text m_PropertyValue;
|
| | | [SerializeField] Text m_PropertyAdd;
|
| | |
|
| | | public void Refresh()
|
| | | {
|
| | | var config = Config.Instance.Get<PlayerPropertyConfig>(property);
|
| | | if (config != null)
|
| | | {
|
| | | m_PropertyName.text = config.Name;
|
| | | RefreshValue();
|
| | | RefreshAdd(0);
|
| | | }
|
| | | }
|
| | |
|
| | | public void RefreshValue()
|
| | | {
|
| | | var config = Config.Instance.Get<PlayerPropertyConfig>(property);
|
| | | if ((AttrEnum)property == AttrEnum.ATK)
|
| | | {
|
| | | m_PropertyValue.text = StringUtility.Contact(UIHelper.ReplaceLargeNum((ulong)PlayerDatas.Instance.extersion.MINATK),
|
| | | "-", UIHelper.ReplaceLargeNum((ulong)PlayerDatas.Instance.extersion.MAXATK));
|
| | | }
|
| | | else
|
| | | {
|
| | | m_PropertyValue.text = UIHelper.ReplaceLargeNum((ulong)UIHelper.GetPropertyMapPlayerData((AttrEnum)property));
|
| | | }
|
| | | }
|
| | |
|
| | | public void RefreshAdd(float _value)
|
| | | {
|
| | | m_PropertyAdd.gameObject.SetActive(_value != 0);
|
| | | if (_value > 0)
|
| | | {
|
| | | m_PropertyAdd.text = StringUtility.Contact("+", _value);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: d337657873ed5bb4bb61182d25e030e4 |
| | | timeCreated: 1540277803 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | |
|
| | | RoleModel roleModel { get { return ModelCenter.Instance.GetModel<RoleModel>(); } }
|
| | |
|
| | | RolePointModel rolePointModel { get { return ModelCenter.Instance.GetModel<RolePointModel>(); } }
|
| | |
|
| | | #region 配置
|
| | | public Dictionary<int, int> wingLv2GenerDict = new Dictionary<int, int>();
|
| | | public Dictionary<int, List<RoleStrongerConfig>> roleStrongerDic = new Dictionary<int, List<RoleStrongerConfig>>();
|
| | |
| | | _id == methodData.fairyHeartRedpoint.id ||
|
| | | _id == realmModel.realmRedpoint.id ||
|
| | | _id == gemModel.gemTagRedPoint.id ||
|
| | | //_id == blastFurnaceModel.MakeDrugRedpoint.id ||
|
| | | _id == rolePointModel.redpoint.id ||
|
| | | IsTreasureRedpoint(_id))
|
| | | {
|
| | | CheckPromoteDetailEffect();
|
| | |
| | | case PromoteDetailType.BetterEquip:
|
| | | var dict = modelInterface.CheckBetterEquipByRealm();
|
| | | return dict != null && dict.Count > 0;
|
| | | case PromoteDetailType.AddPoint:
|
| | | return rolePointModel.redpoint.state == RedPointState.Simple;
|
| | | case PromoteDetailType.EquipStrength:
|
| | | return strengthengmodel.StrengthRedpoint.state == RedPointState.Simple;
|
| | | case PromoteDetailType.Mount:
|
| | |
| | | public enum PromoteDetailType
|
| | | {
|
| | | BetterEquip,
|
| | | AddPoint,
|
| | | EquipStrength,
|
| | | Mount,
|
| | | Pet,
|
| | |
| | | |
| | | public class CrystalSelectionWin : Window |
| | | { |
| | | [SerializeField] Text m_TextDisplay; |
| | | [SerializeField] Text m_NumberText; |
| | | [SerializeField] Slider m_Slider; |
| | | [SerializeField] Button m_AddBtn;
|
| | | [SerializeField] Button m_ReduceBtn; |
| | | [SerializeField] Button m_DetermineBtn; |
| | | [SerializeField] Button m_CancelBtn; |
| | | [SerializeField] Button m_CloseBtn;
|
| | | [SerializeField] Button m_ReduceBtn;
|
| | | [SerializeField] Transform m_Tran;
|
| | | public Vector3 Pos1 = new Vector3(311,160,0);
|
| | | public Vector3 Pos2 = new Vector3(387, 160, 0);
|
| | | public Vector3 Pos3 = new Vector3(465, 160, 0);
|
| | | #region Built-in |
| | | PlayerPackModel _playerPack; |
| | | PlayerPackModel playerPack { get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); } }
|
| | |
| | | m_Slider.onValueChanged.AddListener(OnClickSlider); |
| | | m_AddBtn.AddListener(OnClickAddBtn); |
| | | m_ReduceBtn.AddListener(OnClickReduceBtn); |
| | | m_DetermineBtn.AddListener(OnClickDetermineBtn); |
| | | m_CancelBtn.AddListener(OnClickCancelBtn); |
| | | m_CloseBtn.AddListener(OnClickCloseBtn); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | string str = godBeastModel.Crystal_ItemModel.chinItemModel.ItemName; |
| | | |
| | | m_TextDisplay.text = string.Format(Language.Get("OwnQuantity_SH"), godBeastModel.Crystal_ItemModel.itemInfo.ItemCount, |
| | | UIHelper.GetTextColorByItemColor(godBeastModel.Crystal_ItemModel.chinItemModel.ItemColor, str, true)); |
| | | m_Slider.minValue = 0; |
| | | m_Slider.maxValue = godBeastModel.Crystal_ItemModel.itemInfo.ItemCount; |
| | | if (godBeastModel.Absorption_Dic.ContainsKey(godBeastModel.ItemInde))
|
| | |
| | | } |
| | | m_NumberText.text = m_Slider.value.ToString(); |
| | | } |
| | | |
| | | protected override void OnActived()
|
| | | {
|
| | | switch (godBeastModel.ItemPos)
|
| | | {
|
| | | case 1:
|
| | | m_Tran.localPosition = Pos1;
|
| | | break;
|
| | | case 2:
|
| | | m_Tran.localPosition = Pos2;
|
| | | break;
|
| | | case 3:
|
| | | m_Tran.localPosition = Pos3;
|
| | | break;
|
| | |
|
| | |
|
| | | }
|
| | | } |
| | | protected override void OnAfterOpen() |
| | | { |
| | | } |
| | |
| | | {
|
| | | m_Slider.value += 1;
|
| | | m_NumberText.text = m_Slider.value.ToString();
|
| | | Determine();//确认
|
| | | }
|
| | | }
|
| | | private void OnClickReduceBtn()
|
| | |
| | | {
|
| | | m_Slider.value -= 1;
|
| | | m_NumberText.text = m_Slider.value.ToString();
|
| | | Determine();//确认
|
| | | }
|
| | | }
|
| | | private void OnClickDetermineBtn()
|
| | | private void Determine()//确认
|
| | | {
|
| | | if (godBeastModel.Absorption_Dic.ContainsKey(godBeastModel.ItemInde))
|
| | | {
|
| | |
| | | else
|
| | | {
|
| | | godBeastModel.Absorption_Dic[godBeastModel.ItemInde] = (int)m_Slider.value;
|
| | | }
|
| | | |
| | | } |
| | | }
|
| | | else
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | | godBeastModel.AbsorbEventUpdate();
|
| | | Close();
|
| | | }
|
| | | private void OnClickCancelBtn()
|
| | | {
|
| | | Close();
|
| | | }
|
| | | private void OnClickCloseBtn()
|
| | | {
|
| | | Close();
|
| | | }
|
| | | private void OnClickSlider(float value)
|
| | | {
|
| | | m_NumberText.text = m_Slider.value.ToString();
|
| | | Determine();//确认
|
| | | }
|
| | | } |
| | | |
| | |
| | | {
|
| | | ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.rptDogzItem, Index);
|
| | | m_ItemCell.Init(itemModel);
|
| | | m_ItemCell.countText.gameObject.SetActive(false);
|
| | | m_ItemCell.bindIcon.gameObject.SetActive(false);
|
| | | var IudetDogzEquipPlus = itemModel.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);// 神兽装备强化信息列表 [强化等级, 强化熟练度]
|
| | | TextNumber.gameObject.SetActive(false);
|
| | |
| | | public event Action AbsorbEvent;
|
| | | public int ItemInde = 0;//物品下标
|
| | | public ItemModel Crystal_ItemModel;//当前所选中的水晶物品
|
| | | public int ItemPos = 1;//设置弹框的位置索引
|
| | | public int ItemPlace = -1;//神兽装备位置信息
|
| | | public Dictionary<int, int> QualityLimit = new Dictionary<int, int>();//对应品质所能选择的最大强化等级
|
| | | DogzModel Dogz_model;
|
| | |
| | | private List<GodBeastBagClass> GodBeastBagList = new List<GodBeastBagClass>();
|
| | | private List<int> DeleteIndexList = new List<int>();
|
| | | private int Quality = 10;
|
| | | private int GetJumpIndex = 0;//获取跳转下标
|
| | | PlayerPackModel _playerPack; |
| | | PlayerPackModel playerPack { get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); } }
|
| | | GodBeastModel godBeastModel { get { return ModelCenter.Instance.GetModel<GodBeastModel>(); } }
|
| | |
| | | int childCode = 0;
|
| | | for (childCode = 0; childCode < cell.transform.childCount; childCode++)
|
| | | {
|
| | |
|
| | | int ItemPos = childCode + 1;
|
| | | GodBeastChildNodes GodBeastChildNodes = cell.transform.GetChild(childCode).GetComponent<GodBeastChildNodes>();
|
| | | int cellCount = (cell.transform.childCount) * gridlineIndex + (childCode + 1);
|
| | | if (cellCount > 100)
|
| | |
| | | GodBeastChildNodes.ButtonDown.RemoveAllListeners();
|
| | | if (cellCount - 1 < GodBeastBagList.Count)
|
| | | {
|
| | | int index = cellCount - 1;
|
| | | int index = cellCount - 1; |
| | | GodBeastChildNodes.ItemCell.gameObject.SetActive(true);
|
| | | GodBeastBagClass godBeastBagClass = GodBeastBagList[index];
|
| | | ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.rptDogzItem, godBeastBagClass.Index);
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (godBeastModel.Absorption_Dic.ContainsKey(godBeastBagClass.Index))
|
| | | {
|
| | | GodBeastChildNodes.ChoosenImg.SetActive(true);
|
| | | if (itemModel.EquipPlace <= 0 && itemModel.itemInfo.ItemCount>1)
|
| | | if (itemModel.EquipPlace <= 0 && itemModel.itemInfo.ItemCount > 1)
|
| | | {
|
| | | GodBeastChildNodes.NumberNow.gameObject.SetActive(true);
|
| | | GodBeastChildNodes.NumberNow.text = godBeastModel.Absorption_Dic[godBeastBagClass.Index].ToString();
|
| | | GodBeastChildNodes.NumberNow.text = godBeastModel.Absorption_Dic[godBeastBagClass.Index].ToString() + "/" + itemModel.itemInfo.ItemCount;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (itemModel.EquipPlace <= 0 && itemModel.itemInfo.ItemCount > 1)
|
| | | {
|
| | | GodBeastChildNodes.NumberNow.gameObject.SetActive(true);
|
| | | GodBeastChildNodes.NumberNow.text = itemModel.itemInfo.ItemCount.ToString();
|
| | | }
|
| | | }
|
| | | GodBeastChildNodes.GetGodBeastIndex(godBeastBagClass.Index);
|
| | |
| | | {
|
| | | godBeastModel.Crystal_ItemModel = itemModel;
|
| | | godBeastModel.ItemInde = godBeastBagClass.Index;
|
| | | GetJumpIndex = godBeastBagClass.Index;
|
| | | m_ScrollerController.JumpIndex(JumpIndex());
|
| | | godBeastModel.ItemPos = ItemPos;
|
| | | WindowCenter.Instance.Open<CrystalSelectionWin>();
|
| | |
|
| | | }
|
| | | |
| | | } |
| | | }
|
| | | godBeastModel.AbsorbEventUpdate();
|
| | | });
|
| | | }
|
| | | }
|
| | | } |
| | | private int JumpIndex()
|
| | | {
|
| | | int jumpIndex = 0;
|
| | | for (int i = 0; i < GodBeastBagList.Count; i++)
|
| | | {
|
| | | if (GodBeastBagList[i].Index == GetJumpIndex)
|
| | | {
|
| | | jumpIndex= Mathf.CeilToInt((float)(i+1) / 3);
|
| | | }
|
| | | }
|
| | | if (jumpIndex >= 1)
|
| | | {
|
| | | jumpIndex -= 1;
|
| | | }
|
| | | return jumpIndex;
|
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | var cB910 = new CB910_tagCGQueryTeamMemFuncData();
|
| | | cB910.TeamMemFuncType = 0;
|
| | | GameNetSystem.Instance.SendInfo(cB910);
|
| | | main.IsSend = false;
|
| | | StartCoroutine(Co_DelayShowFloorChooseWin(_isAutoMatch));
|
| | | }
|
| | | }
|
| | |
| | | IEnumerator Co_DelayShowFloorChooseWin(bool _isAutoMatch)
|
| | | {
|
| | | yield return WaitingForSecondConst.WaitMS700;
|
| | |
|
| | | if (!main.IsSend)
|
| | | {
|
| | | yield break;
|
| | | }
|
| | | if (main.LayerNumber == -1)
|
| | | {
|
| | | main.LayerNumberNow = 0;
|
| | |
| | | case RolePromoteModel.PromoteDetailType.BetterEquip:
|
| | | WindowCenter.Instance.Open<KnapSackWin>();
|
| | | break;
|
| | | case RolePromoteModel.PromoteDetailType.AddPoint:
|
| | | WindowCenter.Instance.Open<RolePointWin>();
|
| | | break;
|
| | | case RolePromoteModel.PromoteDetailType.EquipStrength:
|
| | | WindowCenter.Instance.Open<EquipReinforceWin>();
|
| | | break;
|
| | |
| | | _leftRifht = Config.Instance.Get<TreasureConfig>(model.selectedTreasure - 1);
|
| | | m_LeftBtn.gameObject.SetActive(_leftRifht != null);
|
| | | var skillLevelUpRedpointTreasure = model.GetSkillLevelUpRedpointTreasure();
|
| | | m_LeftRedpoint.gameObject.SetActive(skillLevelUpRedpointTreasure != 0
|
| | | && model.selectedTreasure > skillLevelUpRedpointTreasure && model.currentCategory == TreasureCategory.Human);
|
| | | m_RightRedpoint.gameObject.SetActive(skillLevelUpRedpointTreasure != 0
|
| | | && model.selectedTreasure < skillLevelUpRedpointTreasure && model.currentCategory == TreasureCategory.Human);
|
| | | m_LeftRedpoint.gameObject.SetActive(false);
|
| | | m_RightRedpoint.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | private void HideHuman()
|
| | |
| | | private void SkillLevelUpRedpointUpdate()
|
| | | {
|
| | | var skillLevelUpRedpointTreasure = model.GetSkillLevelUpRedpointTreasure();
|
| | | m_LeftRedpoint.gameObject.SetActive(skillLevelUpRedpointTreasure != 0
|
| | | && model.selectedTreasure > skillLevelUpRedpointTreasure && model.currentCategory == TreasureCategory.Human);
|
| | | m_RightRedpoint.gameObject.SetActive(skillLevelUpRedpointTreasure != 0
|
| | | && model.selectedTreasure < skillLevelUpRedpointTreasure && model.currentCategory == TreasureCategory.Human);
|
| | | m_LeftRedpoint.gameObject.SetActive(false);
|
| | | m_RightRedpoint.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | protected override void LateUpdate()
|
| | |
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.LootPreciousFrameFunc1);
|
| | | break;
|
| | | case TreasurePrivilege.Sp:
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.FindPreciousFrameFunc1);
|
| | | var treasureModel = ModelCenter.Instance.GetModel<TreasureModel>();
|
| | | treasureModel.selectedTreasure = 101;
|
| | | treasureModel.currentCategory = TreasureCategory.Human;
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.TreasureCollectSoul);
|
| | | break;
|
| | | case TreasurePrivilege.MountAtk:
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.PetFunc1);
|
| | |
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 许愿池
|
| | | /// </summary>
|
| | | /// <param name="package"></param>
|
| | | public void UpdateWishingWellInfo(HAA19_tagMCActWishingWellInfo package)
|
| | | {
|
| | | OperationBase operationBase = null;
|
| | | operationDict.TryGetValue(Operation.WishingWellInfo, out operationBase);
|
| | | if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
|
| | | {
|
| | | ForceStopOperation(Operation.WishingWellInfo);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (operationBase == null)
|
| | | {
|
| | | operationBase = new OperationWishingWellInfo();
|
| | | operationDict.Add(Operation.WishingWellInfo, operationBase);
|
| | | }
|
| | | OperationWishingWellInfo operation = operationBase as OperationWishingWellInfo;
|
| | | operation.Reset();
|
| | | operation.limitLv = package.LimitLV;
|
| | | operation.startDate = ParseOperationDate(package.StartDate);
|
| | | operation.endDate = ParseOperationDate(package.EndtDate);
|
| | | operation.dayReset = package.IsDayReset == 1;
|
| | | operation.ParsePackage(package);
|
| | | if (operationTimeUpdateEvent != null)
|
| | | {
|
| | | operationTimeUpdateEvent(Operation.WishingWellInfo);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 限时礼包
|
| | | /// </summary>
|
| | | /// <param name="package"></param>
|
| | |
| | | FairyCeremony, //仙界盛典
|
| | | MultipRealmPoint, //N倍修行点
|
| | | FlashRushToBuy, //限时抢购
|
| | | WishingWellInfo, //许愿池
|
| | | max,
|
| | | }
|
| | | }
|
| | |
| | | RegisterModel<TalentModel>();
|
| | | RegisterModel<OpenServerActivityNotifyModel>();
|
| | | RegisterModel<WishingPoolModel>();
|
| | | RegisterModel<RolePointModel>();
|
| | | inited = true;
|
| | | }
|
| | |
|
| | |
| | | SetJumpLogic<RealmWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.RolePoint:
|
| | | //SetJumpLogic<RolePoint>(_tagWinSearchModel.TABID);
|
| | | SetJumpLogic<RolePointWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.MainTask:
|
| | | PlayerTaskDatas taskDatas = ModelCenter.Instance.GetModel<PlayerTaskDatas>();
|
| | |
| | | SetJumpLogic<KnapSackWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.RebornOpenAddPoint:
|
| | | //SetJumpLogic<RolePoint>(_tagWinSearchModel.TABID);
|
| | | SetJumpLogic<RolePointWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.RebornOpenHourse:
|
| | | SetJumpLogic<PetWin>(_tagWinSearchModel.TABID);
|