Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | //private string m_OutputPath = string.Empty;
|
| | | //[SerializeField]
|
| | | //private bool m_UseDefaultPath = true;
|
| | | private string m_streamingPath {
|
| | | get {
|
| | | private string m_streamingPath
|
| | | {
|
| | | get
|
| | | {
|
| | | switch (m_UserData.m_BuildTarget)
|
| | | {
|
| | | case ValidBuildTarget.Android:
|
| | |
| | |
|
| | | [SerializeField] int m_Version;
|
| | |
|
| | | public string ApkOutputPath {
|
| | | public string ApkOutputPath
|
| | | {
|
| | | get { return LocalSave.GetString("APKOutPutPath"); }
|
| | | set { LocalSave.SetString("APKOutPutPath", value); }
|
| | | }
|
| | |
|
| | | public string publishers {
|
| | | public string publishers
|
| | | {
|
| | | get { return LocalSave.GetString("APKPublishers"); }
|
| | | set { LocalSave.SetString("APKPublishers", value); }
|
| | | }
|
| | |
| | |
|
| | | GUILayout.EndHorizontal();
|
| | |
|
| | | GUILayout.Space(20);
|
| | | if (GUILayout.Button("SwitchVersionConfig"))
|
| | | {
|
| | | EditorApplication.delayCall += ExecuteSwitchVersionConfig;
|
| | | }
|
| | |
|
| | | GUILayout.EndVertical();
|
| | | EditorGUILayout.EndScrollView();
|
| | | }
|
| | |
| | | ClientPackage.BuildPublishers(ClientPackage.SDK_PLUGIN_PROJECT, outputPath, ApkOutputPath, publishers, true, false);
|
| | | }
|
| | |
|
| | | private void ExecuteSwitchVersionConfig()
|
| | | {
|
| | | var newVersionConfigPath = StringUtility.Contact("Assets/Resources/ScriptableObject/Config/VersionConfig", ".asset");
|
| | | var versionsFilePath = Application.dataPath + Path.DirectorySeparatorChar + "Editor/VersionConfigs/Versions.txt";
|
| | |
|
| | | var lines = File.ReadAllLines(versionsFilePath);
|
| | | for (int i = 2; i < lines.Length; i++)
|
| | | {
|
| | | var line = lines[i];
|
| | | var lineStrings = line.Split('\t');
|
| | | if (lineStrings[0] == publishers)
|
| | | {
|
| | | VersionConfig.Get().Read(line);
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private static void DirectoryCopy(string sourceDirName, string destDirName)
|
| | | {
|
| | | // Get the subdirectories for the specified directory.
|
| | |
| | | public static void Init()
|
| | | {
|
| | | // 登记相应的数据体及对应的数据转逻辑类
|
| | | Register(typeof(HAC10_tagGCAllFamilyBossHurtInfoList), typeof(DTCAC10_tagGCAllFamilyBossHurtInfoList));
|
| | | Register(typeof(HA715_tagMCFamilyBossHurtList), typeof(DTCA715_tagMCFamilyBossHurtList));
|
| | | Register(typeof(HAB04_tagMCBossRebornInfo), typeof(DTCAB04_tagMCBossRebornInfo));
|
| | | Register(typeof(HA40B_tagGCPlayerJoinFamilyWarInfo), typeof(DTCA40B_tagGCPlayerJoinFamilyWarInfo));
|
| | | Register(typeof(HA319_tagMCPackDownloadRecord), typeof(DTCA319_tagMCPackDownloadRecord));
|
| | |
| | | public override void Initialize()
|
| | | {
|
| | | base.Initialize();
|
| | | WindowCenter.Instance.OpenFromLocal<LaunchBackGroundWin>();
|
| | | WindowCenter.Instance.Open<LaunchBackGroundWin>(true);
|
| | |
|
| | | var backGroundWin = WindowCenter.Instance.Get<LaunchBackGroundWin>();
|
| | | if (backGroundWin != null)
|
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Saturday, January 06, 2018 |
| | | // [ Date ]: Tuesday, August 28, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using UnityEngine; |
| | |
| | | |
| | | public partial class BossInfoConfig : ConfigBase { |
| | | |
| | | public int NPCID { get ; private set ; } |
| | | public int MapID { get ; private set ; } |
| | | public int NPCID { get ; private set ; }
|
| | | public int MapID { get ; private set ; }
|
| | | public int RelatedType { get ; private set ; }
|
| | | public int RelatedID { get ; private set ; }
|
| | | public int StoneNPCID { get ; private set ; } |
| | | |
| | | public override string getKey() |
| | |
| | | public override void Parse() { |
| | | try |
| | | { |
| | | NPCID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; |
| | | |
| | | MapID=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0; |
| | | |
| | | StoneNPCID=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0; |
| | | NPCID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; |
| | | |
| | | MapID=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0; |
| | | |
| | | RelatedType=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0; |
| | | |
| | | RelatedID=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0; |
| | | |
| | | StoneNPCID=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | fileFormatVersion: 2 |
| | | guid: fd079b12ba8134442adceeacd5b31101 |
| | | timeCreated: 1515224036 |
| | | licenseType: Free |
| | | timeCreated: 1535441070 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Tuesday, August 28, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using UnityEngine; |
| | | using System; |
| | | |
| | | namespace TableConfig { |
| | | |
| | | |
| | | public partial class FairyGrabBossConfig : ConfigBase { |
| | | |
| | | public int NPCID { get ; private set ; }
|
| | | public string PortraitID { get ; private set; } |
| | | public string dropItems { get ; private set; } |
| | | |
| | | public override string getKey() |
| | | { |
| | | return NPCID.ToString(); |
| | | } |
| | | |
| | | public override void Parse() { |
| | | try |
| | | { |
| | | NPCID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; |
| | | |
| | | PortraitID = rawContents[1].Trim();
|
| | | |
| | | dropItems = rawContents[2].Trim(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | DebugEx.Log(ex); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 353bb58b84bc9d74b87bcdbb10330f00 |
| | | timeCreated: 1535422842 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | AddAsyncTask<TrialExchangeConfig>();
|
| | | AddAsyncTask<TrialRewardsConfig>();
|
| | | AddAsyncTask<DogzEquipPlusConfig>();
|
| | | AddAsyncTask<FairyGrabBossConfig>();
|
| | | while (!AllCompleted())
|
| | | {
|
| | | var completedCount = 0;
|
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // AC 04 查询仙盟抢Boss所有Boss当前进度 #tagCGQueryAllFamilyBossHurt
|
| | |
|
| | | public class CAC04_tagCGQueryAllFamilyBossHurt : GameNetPackBasic {
|
| | |
|
| | | public CAC04_tagCGQueryAllFamilyBossHurt () {
|
| | | combineCmd = (ushort)0x1801;
|
| | | _cmd = (ushort)0xAC04;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 0830d890575ec164888e6bf61b29571c |
| | | timeCreated: 1535428369 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // A2 28 查询仙盟抢Boss伤血列表 #tagCMQueryFamilyBossHurt
|
| | |
|
| | | public class CA228_tagCMQueryFamilyBossHurt : GameNetPackBasic {
|
| | | public uint ObjID;
|
| | | public uint NPCID;
|
| | | public byte QueryType; // 0-实时仙盟伤血,1-历史仙盟伤血,2-实时玩家伤血,3-历史玩家伤血
|
| | |
|
| | | public CA228_tagCMQueryFamilyBossHurt () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xA228;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (ObjID, NetDataType.DWORD);
|
| | | WriteBytes (NPCID, NetDataType.DWORD);
|
| | | WriteBytes (QueryType, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 983c43e61a332a34298145db9e1355d6 |
| | | timeCreated: 1535424857 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Tuesday, August 28, 2018
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using Snxxz.UI;
|
| | | public class DTCA715_tagMCFamilyBossHurtList : DtcBasic {
|
| | |
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | base.Done(vNetPack);
|
| | | var package = vNetPack as HA715_tagMCFamilyBossHurtList;
|
| | | ModelCenter.Instance.GetModel<FairyGrabBossModel>().UpdateBossHurt(package);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6a28582703aa0f745a33db2218188e29 |
| | | timeCreated: 1535424983 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Tuesday, August 28, 2018
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using Snxxz.UI;
|
| | | public class DTCAC10_tagGCAllFamilyBossHurtInfoList : DtcBasic
|
| | | {
|
| | |
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | base.Done(vNetPack);
|
| | | var package = vNetPack as HAC10_tagGCAllFamilyBossHurtInfoList;
|
| | | ModelCenter.Instance.GetModel<FairyGrabBossModel>().UpdateBossProgress(package);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 071c5cebd0dfade468e752ff2c301cdd |
| | | timeCreated: 1535428774 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using UnityEngine;
|
| | | using System;
|
| | | using System.Text;
|
| | | using System.IO;
|
| | |
|
| | | public class NetPkgCtl
|
| | | {
|
| | |
| | | {
|
| | | return _tempNetPkgLst;
|
| | | }
|
| | |
|
| | | public static void WriteAllNetLog()
|
| | | {
|
| | | if (_typeLst != null)
|
| | | {
|
| | | var count = 0;
|
| | | var lines = new List<string>();
|
| | | for (int i = _typeLst.Count - 1; i >= 0; i--)
|
| | | {
|
| | | if (count > 20000)
|
| | | {
|
| | | break;
|
| | | }
|
| | |
|
| | | var package = _typeLst[i];
|
| | | var line = string.Empty;
|
| | | line = StringUtility.Contact(package.NetPkgTp == NetPkgType.Client ? "【发送】" : "【接收】", package.SendOrGetTime, ":", package.GameNetName, "\r\n");
|
| | | if (package.fieldDetails != null)
|
| | | {
|
| | | for (int j = 0; j < package.fieldDetails.Count; j++)
|
| | | {
|
| | | line = StringUtility.Contact(line, "\t\t\t", package.fieldDetails[j], "\r\n");
|
| | | }
|
| | | }
|
| | |
|
| | | lines.Add(line);
|
| | | count++;
|
| | | }
|
| | |
|
| | | File.WriteAllLines(Application.dataPath + "/PackageLogs" + "_" + DateTime.Now.ToString("HH_mm_ss") + ".txt", lines.ToArray());
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public class NetPkg
|
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // A7 15 通知仙盟抢Boss伤血信息 #tagMCFamilyBossHurtList
|
| | |
|
| | | public class HA715_tagMCFamilyBossHurtList : GameNetPackBasic {
|
| | | public uint ObjID;
|
| | | public uint NPCID;
|
| | | public byte HurtType; // 0-实时仙盟伤血,1-历史仙盟伤血,2-实时玩家伤血,3-历史玩家伤血
|
| | | public byte IsSort; // 是否排序过的,一般boss被击杀后会统一同步一次排序过的最终结果,其他情况下客户端自己排序
|
| | | public ushort HurtCount; // 伤血个数
|
| | | public tagMCFamilyBossHurt[] HurtList; // 伤血列表
|
| | |
|
| | | public HA715_tagMCFamilyBossHurtList () {
|
| | | _cmd = (ushort)0xA715;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out ObjID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out NPCID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out HurtType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out IsSort, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out HurtCount, vBytes, NetDataType.WORD);
|
| | | HurtList = new tagMCFamilyBossHurt[HurtCount];
|
| | | for (int i = 0; i < HurtCount; i ++) {
|
| | | HurtList[i] = new tagMCFamilyBossHurt();
|
| | | TransBytes (out HurtList[i].FamilyID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out HurtList[i].HurtID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out HurtList[i].NameLen, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out HurtList[i].HurtName, vBytes, NetDataType.Chars, HurtList[i].NameLen);
|
| | | TransBytes (out HurtList[i].HurtValue, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out HurtList[i].HurtValueEx, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out HurtList[i].InitTick, vBytes, NetDataType.DWORD);
|
| | | }
|
| | | }
|
| | |
|
| | | public struct tagMCFamilyBossHurt {
|
| | | public uint FamilyID; // 所属仙盟ID
|
| | | public uint HurtID; // 伤血的ID, 根据伤血类型表示不同的ID, 如仙盟ID或玩家ID
|
| | | public byte NameLen;
|
| | | public string HurtName;
|
| | | public uint HurtValue; // 累计伤血,求余1亿的值
|
| | | public uint HurtValueEx; // 累计伤血,整除1亿的值
|
| | | public uint InitTick; // 伤血初始tick,用于排序,先按伤血倒序排,再按tick正序排
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e0fd17399da94b049b20f72960faf7a8 |
| | | timeCreated: 1535424939 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // AC 10 仙盟抢Boss所有Boss伤血进度信息 #tagGCAllFamilyBossHurtInfoList
|
| | |
|
| | | public class HAC10_tagGCAllFamilyBossHurtInfoList : GameNetPackBasic {
|
| | | public byte NPCCount; // 个数
|
| | | public tagGCFamilyBossHurtInfo[] NPCHurtInfo; // NPC伤血信息列表
|
| | |
|
| | | public HAC10_tagGCAllFamilyBossHurtInfoList () {
|
| | | _cmd = (ushort)0xAC10;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out NPCCount, vBytes, NetDataType.BYTE);
|
| | | NPCHurtInfo = new tagGCFamilyBossHurtInfo[NPCCount];
|
| | | for (int i = 0; i < NPCCount; i ++) {
|
| | | NPCHurtInfo[i] = new tagGCFamilyBossHurtInfo();
|
| | | TransBytes (out NPCHurtInfo[i].NPCID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out NPCHurtInfo[i].CurHP, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out NPCHurtInfo[i].CurHPEx, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out NPCHurtInfo[i].MaxHP, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out NPCHurtInfo[i].MaxHPEx, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out NPCHurtInfo[i].FamilyID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out NPCHurtInfo[i].NameLen, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out NPCHurtInfo[i].FamilyName, vBytes, NetDataType.Chars, NPCHurtInfo[i].NameLen);
|
| | | }
|
| | | }
|
| | |
|
| | | public struct tagGCFamilyBossHurtInfo {
|
| | | public uint NPCID;
|
| | | public uint CurHP;
|
| | | public uint CurHPEx;
|
| | | public uint MaxHP;
|
| | | public uint MaxHPEx;
|
| | | public uint FamilyID; // 最大实时伤血仙盟
|
| | | public byte NameLen;
|
| | | public string FamilyName;
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: c11d8c087e7207547a6ed68826fc894b |
| | | timeCreated: 1535428733 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | public event UnityAction<uint> OnGActorRequest;
|
| | | public event UnityAction<uint> OnGActorServerDie;
|
| | |
|
| | | public event UnityAction<uint> OnFightNpcRequest;
|
| | | public event UnityAction<uint> OnFightNpcRelease;
|
| | |
|
| | | // 由角色池生成的prefab列表. 用来卸载用的.
|
| | | public List<GameObject> needDestroyPrefabList = new List<GameObject>();
|
| | | public List<GActorFight> needDieList = new List<GActorFight>();
|
| | |
| | | RuntimeLogUtility.AddLog_Green(_content, serverInstID);
|
| | | #endif
|
| | |
|
| | | if (OnFightNpcRequest != null)
|
| | | {
|
| | | OnFightNpcRequest(npcID);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | return _actor as T;
|
| | |
| | | /// <param name="actor"></param>
|
| | | public void Release(GActor actor)
|
| | | {
|
| | | var _npcfight = actor as GActorNpcFight;
|
| | |
|
| | | if (_npcfight != null)
|
| | | {
|
| | | if (OnFightNpcRequest != null)
|
| | | {
|
| | | OnFightNpcRequest((uint)_npcfight.NpcConfig.NPCID);
|
| | | }
|
| | | }
|
| | |
|
| | | #if UNITY_EDITOR
|
| | | string _content = string.Format("GAMgr => 对角色 SID: {0}, CID: {1} 进行了回收", actor.ServerInstID, actor.ClientInstID);
|
| | | RuntimeLogUtility.AddLog_Green(_content, actor.ServerInstID);
|
| | |
| | |
|
| | | // 加入判断是否世界BOSS判断
|
| | | WorldBossConfig _worldBoss = Config.Instance.Get<WorldBossConfig>(npcID);
|
| | | bool _isWorldBoss = _worldBoss != null;
|
| | | if (_isWorldBoss && _findLocation)
|
| | | FairyGrabBossConfig _fairyBoss = Config.Instance.Get<FairyGrabBossConfig>(npcID);
|
| | | bool _isBoss = _worldBoss != null || _fairyBoss != null;
|
| | | if (_isBoss && _findLocation)
|
| | | {
|
| | | //Debug.LogFormat("目标是世界boss");
|
| | | //Debug.LogFormat("目标是boss");
|
| | | _npc = GAMgr.Instance.GetCloserNPC(_hero.Pos, npcID);
|
| | |
|
| | | if (_npc != null)
|
| | |
| | | //Debug.LogFormat(" |-- 不在视野内");
|
| | | var _mapConfig = Config.Instance.Get<MapConfig>(_npcLocation.mapId);
|
| | |
|
| | | var _lineID = 0;
|
| | | var _forceTransfer = false;
|
| | |
|
| | | // 判断仙盟boss逻辑
|
| | | var _fairyBossModel = ModelCenter.Instance.GetModel<FairyGrabBossModel>();
|
| | | if (_fairyBossModel != null)
|
| | | {
|
| | | // 是仙盟boss
|
| | | if (_fairyBossModel.bosses != null
|
| | | && _fairyBossModel.bosses.Contains(npcID))
|
| | | {
|
| | | //Debug.LogFormat(" |-- 这是一只活动boss");
|
| | | // 取得分线
|
| | | if (GeneralConfig.Instance.fairyGrabBossMapLines != null)
|
| | | {
|
| | | _lineID = GeneralConfig.Instance.fairyGrabBossMapLines.ContainsKey(_npcLocation.mapId) ?
|
| | | GeneralConfig.Instance.fairyGrabBossMapLines[_npcLocation.mapId] : 0;
|
| | | // 如果当前处于不同的分线, 则下面的处理中,地图ID相同也切线
|
| | | if (_lineID != PlayerDatas.Instance.baseData.FBID)
|
| | | {
|
| | | //Debug.LogFormat(" |-- 不在同一分线: {0} != {1}", _lineID, PlayerDatas.Instance.baseData.FBID);
|
| | | _forceTransfer = true;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | Debug.LogErrorFormat("对应的地图ID: {0} 在配置中没有对应的分线id", _npcLocation.mapId);
|
| | | }
|
| | | }
|
| | |
|
| | | npcID = 0;
|
| | | }
|
| | |
|
| | | // 如果不是处于相同地图, 则切图
|
| | | if (_npcLocation.mapId != PlayerDatas.Instance.baseData.MapID)
|
| | | if (_npcLocation.mapId != PlayerDatas.Instance.baseData.MapID || _forceTransfer)
|
| | | {
|
| | | if (PlayerDatas.Instance.extersion.pkState == 1)
|
| | | {
|
| | |
| | | //Debug.LogFormat(" |-- 不在本地图");
|
| | | var mapId = _npcLocation.mapId;
|
| | | var position = new Vector3(_mapConfig.BornPoints[0].x, 0, _mapConfig.BornPoints[0].y);
|
| | | Send_WorldTransfer(mapId, position, MapTransferType.WorldTransport, 0, npcID);
|
| | | Send_WorldTransfer(mapId, position, MapTransferType.WorldTransport, (byte)_lineID, npcID);
|
| | |
|
| | | if (BossFakeLineUtility.Instance.IsShuntBoss(npcID))
|
| | | {
|
| | |
| | | if (((lastMoveToWorldBossNpcID == npcID
|
| | | && Time.realtimeSinceStartup - lastMoveToWorldBossTime < 60)
|
| | | && PlayerDatas.Instance.baseData.FBID == 0)
|
| | | || BossFakeLineUtility.Instance.showFakeLine)
|
| | | || BossFakeLineUtility.Instance.showFakeLine
|
| | | || _fairyBossModel != null)
|
| | | {
|
| | | //Debug.LogFormat(" |-- 非想去的boss为60秒内行为产生且为同一只boss, {0}, {1}", BossFakeLineUtility.Instance.showFakeLine,
|
| | | //PlayerDatas.Instance.baseData.FBID);
|
| | |
| | | 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)
|
| | | {
|
| | |
| | | {
|
| | | if (currentMapResId != 0 && currentMapResId == mapResConfigID)
|
| | | {
|
| | | //OperationLogCollect.Instance.BugReport("Warning", "StageManager Load Same MapID:" + mapResConfigID); |
| | | //OperationLogCollect.Instance.BugReport("Warning", "StageManager Load Same MapID:" + mapResConfigID);
|
| | | #if UNITY_EDITOR
|
| | | Debug.LogFormat("StageManager出现加载相同地图行为:" + mapResConfigID); |
| | | Debug.LogFormat("StageManager出现加载相同地图行为:" + mapResConfigID);
|
| | | #endif
|
| | | yield break;
|
| | | }
|
| | |
| | | WindowCenter.Instance.CloseOthers<LaunchBackGroundWin>();
|
| | | if (!WindowCenter.Instance.CheckOpen<LaunchBackGroundWin>())
|
| | | {
|
| | | WindowCenter.Instance.OpenFromLocal<LaunchBackGroundWin>();
|
| | | WindowCenter.Instance.Open<LaunchBackGroundWin>(true);
|
| | | }
|
| | |
|
| | | WindowCenter.Instance.CloseOthers<LaunchBackGroundWin>();
|
| | |
| | | WindowCenter.Instance.CloseOthers<LaunchBackGroundWin>();
|
| | | if (!WindowCenter.Instance.CheckOpen<LaunchBackGroundWin>())
|
| | | {
|
| | | WindowCenter.Instance.OpenFromLocal<LaunchBackGroundWin>();
|
| | | WindowCenter.Instance.Open<LaunchBackGroundWin>(true);
|
| | | }
|
| | |
|
| | | WindowCenter.Instance.CloseOthers<LaunchBackGroundWin>();
|
| | |
| | | DailyQuestConfig cfg = Config.Instance.Get<DailyQuestConfig>(type);
|
| | | switch ((DailyQuestType)type)
|
| | | {
|
| | | case DailyQuestType.FairyGrabBoss:
|
| | | case DailyQuestType.FairyFeast:
|
| | | {
|
| | | if (!PlayerDatas.Instance.fairyData.HasFairy)
|
| | |
| | | return true;
|
| | | }
|
| | | }
|
| | |
|
| | | switch ((DailyQuestType)type)
|
| | | {
|
| | | case DailyQuestType.FairyGrabBoss:
|
| | | return false;
|
| | | }
|
| | |
|
| | | int entertimes = dailyQuestModel.GetDailyQuestCompletedTimes(type);
|
| | | if (dailyQuestModel.GetDailyQuestTotalTimes(cfg.ID) <= entertimes)
|
| | | {
|
| | |
| | |
|
| | | private void OnConfirmClick()
|
| | | {
|
| | | if((DailyQuestType)m_NotifyType != DailyQuestType.WyTaiChi)
|
| | | switch ((DailyQuestType)m_NotifyType)
|
| | | {
|
| | | if (PlayerDatas.Instance.extersion.pkState == 1)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("PK_Leave");
|
| | | return;
|
| | | }
|
| | | if (PlayerDatas.Instance.extersion.bossState == 1)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("Boss_Leave");
|
| | | return;
|
| | | }
|
| | | case DailyQuestType.FairyGrabBoss:
|
| | | case DailyQuestType.WyTaiChi:
|
| | | break;
|
| | | default:
|
| | | if (PlayerDatas.Instance.extersion.pkState == 1)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("PK_Leave");
|
| | | return;
|
| | | }
|
| | | if (PlayerDatas.Instance.extersion.bossState == 1)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("Boss_Leave");
|
| | | return;
|
| | | }
|
| | | break;
|
| | | }
|
| | |
|
| | | var config = Config.Instance.Get<DailyQuestConfig>((int)m_NotifyType);
|
| | |
| | | case DailyQuestType.FairyLeague:
|
| | | WindowCenter.Instance.Open<UnionPanel>(false, 4);
|
| | | break;
|
| | | case DailyQuestType.FairyGrabBoss:
|
| | | WindowCenter.Instance.Open<LootPreciousFrameWin>(false, 1);
|
| | | break;
|
| | | }
|
| | | }
|
| | | else
|
| | |
| | |
|
| | | private void Awake()
|
| | | {
|
| | | if (InGameDownLoad.Instance.dominantState != InGameDownLoad.Dominant.None
|
| | | && InGameDownLoad.Instance.state != InGameDownLoad.State.Completed)
|
| | | if (!InGameDownLoad.Instance.hasReward
|
| | | && InGameDownLoad.Instance.completeDownLoadAccount == PlayerDatas.Instance.baseData.AccID)
|
| | | {
|
| | | this.gameObject.SetActive(true);
|
| | | m_ProgressText.gameObject.SetActive(true);
|
| | | m_ProgressText.text = "100%";
|
| | | this.gameObject.SetActive(true);
|
| | | }
|
| | | else if (!InGameDownLoad.Instance.hasReward
|
| | | && InGameDownLoad.Instance.completeDownLoadAccount == PlayerDatas.Instance.baseData.AccID)
|
| | | else if (InGameDownLoad.Instance.dominantState != InGameDownLoad.Dominant.None)
|
| | | {
|
| | | m_ProgressText.gameObject.SetActive(true);
|
| | | var progress = Mathf.RoundToInt(InGameDownLoad.Instance.progress * 100);
|
| | | m_ProgressText.text = StringUtility.Contact(progress, "%");
|
| | | this.gameObject.SetActive(true);
|
| | | m_ProgressText.gameObject.SetActive(true);
|
| | | if (InGameDownLoad.Instance.state != InGameDownLoad.State.Completed)
|
| | | {
|
| | | m_ProgressText.text = "100%";
|
| | | }
|
| | | else
|
| | | {
|
| | | var progress = Mathf.RoundToInt(InGameDownLoad.Instance.progress * 100);
|
| | | m_ProgressText.text = StringUtility.Contact(progress, "%");
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | {
|
| | | case InGameDownLoad.State.Completed:
|
| | | this.gameObject.SetActive(false);
|
| | | m_ProgressText.gameObject.SetActive(false);
|
| | | break;
|
| | | case InGameDownLoad.State.None:
|
| | | case InGameDownLoad.State.Prepared:
|
| | |
| | | case InGameDownLoad.State.Award:
|
| | | this.gameObject.SetActive(true);
|
| | | m_ProgressText.gameObject.SetActive(true);
|
| | | var progress = Mathf.RoundToInt(InGameDownLoad.Instance.progress * 100);
|
| | | m_ProgressText.text = StringUtility.Contact(progress, "%");
|
| | | m_ProgressText.text = "100%";
|
| | | break;
|
| | | }
|
| | | }
|
| | |
| | | private void UpdateDownLoadProgress()
|
| | | {
|
| | | m_ProgressSlider.fillAmount = InGameDownLoad.Instance.progress;
|
| | |
|
| | | if (InGameDownLoad.Instance.state == InGameDownLoad.State.DownLoad)
|
| | | if (m_ProgressText != null)
|
| | | {
|
| | | if (m_ProgressText != null)
|
| | | if (InGameDownLoad.Instance.state == InGameDownLoad.State.Award)
|
| | | {
|
| | | m_ProgressText.text = "100%";
|
| | | }
|
| | | else
|
| | | {
|
| | | var progress = Mathf.RoundToInt(InGameDownLoad.Instance.progress * 100);
|
| | | m_ProgressText.text = StringUtility.Contact(Mathf.Clamp(progress, 0, 99), "%");
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | private void OpenInGameDownloadWin()
|
| | |
| | | case DailyQuestType.FairyLeague:
|
| | | case DailyQuestType.FairyFeast:
|
| | | case DailyQuestType.FairyTask:
|
| | | case DailyQuestType.FairyGrabBoss:
|
| | | var _dailyConfig = Config.Instance.Get<DailyQuestConfig>(_dailyQuestId);
|
| | | return PlayerDatas.Instance.baseData.Family > 0 &&
|
| | | (_dailyConfig.UnLockFuncID == 0 || FuncOpen.Instance.IsFuncOpen(_dailyConfig.UnLockFuncID));
|
| | |
| | | case DailyQuestType.HeavenBattle:
|
| | | case DailyQuestType.FairyFeast:
|
| | | case DailyQuestType.FairyLeague:
|
| | | case DailyQuestType.FairyGrabBoss:
|
| | | return DailyQuestState.Normal;
|
| | | case DailyQuestType.GuardSky:
|
| | | if (!fairyModel.completeGuardSky)
|
| | |
| | | ChatCtrl.Inst.openFromDaily = true;
|
| | | WindowCenter.Instance.Open<ChatWin>();
|
| | | break;
|
| | | case DailyQuestType.FairyGrabBoss:
|
| | | WindowCenter.Instance.CloseImmediately<DailyQuestWin>();
|
| | | WindowCenter.Instance.Open<LootPreciousFrameWin>(false, 1);
|
| | | break;
|
| | | default:
|
| | | break;
|
| | | }
|
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | using Snxxz.UI; |
| | | using LitJson; |
| | | |
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | | using Snxxz.UI;
|
| | | using LitJson;
|
| | |
|
| | | public class DebugLogin : MonoBehaviour
|
| | | { |
| | | public InputField appid; |
| | | public InputField serverId; |
| | | public InputField ipInputField; |
| | | public InputField portInputField;
|
| | | public InputField gateInputField; |
| | | public InputField account; |
| | | public InputField password; |
| | | |
| | | public Toggle isToken; |
| | | |
| | | string appidRecorder {
|
| | | {
|
| | | public InputField appid;
|
| | | public InputField account;
|
| | | public InputField password;
|
| | |
|
| | | public Toggle isToken;
|
| | |
|
| | | string appidRecorder
|
| | | {
|
| | | get { return LocalSave.GetString("DebugLogin_AppId"); }
|
| | | set { LocalSave.SetString("DebugLogin_AppId", value); }
|
| | | }
|
| | |
|
| | | string serverIdRecorder {
|
| | | get { return LocalSave.GetString("DebugLogin_ServerId"); }
|
| | | set { LocalSave.SetString("DebugLogin_ServerId", value); }
|
| | | }
|
| | |
|
| | | string ipRecorder {
|
| | | get { return LocalSave.GetString("DebugLogin_Ip"); }
|
| | | set { LocalSave.SetString("DebugLogin_Ip", value); }
|
| | | }
|
| | |
|
| | | string portRecorder {
|
| | | get { return LocalSave.GetString("DebugLogin_Port"); }
|
| | | set { LocalSave.SetString("DebugLogin_Port", value); }
|
| | | }
|
| | |
|
| | | string gateRecorder {
|
| | | get { return LocalSave.GetString("DebugLogin_Gate"); }
|
| | | set { LocalSave.SetString("DebugLogin_Gate", 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 {
|
| | | bool istokenRecorder
|
| | | {
|
| | | get { return LocalSave.GetBool("DebugLogin_IsToken", false); }
|
| | | set { LocalSave.SetBool("DebugLogin_IsToken", value); }
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | private void OnEnable()
|
| | | {
|
| | | appid.text = appidRecorder;
|
| | | serverId.text = serverIdRecorder;
|
| | | ipInputField.text = ipRecorder;
|
| | | portInputField.text = portRecorder;
|
| | | gateInputField.text = gateRecorder;
|
| | | account.text = accountRecorder;
|
| | | password.text = passwordRecorder;
|
| | | isToken.isOn = istokenRecorder;
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | public void Login()
|
| | | {
|
| | | appidRecorder = appid.text;
|
| | | serverIdRecorder = serverId.text;
|
| | | ipRecorder = ipInputField.text;
|
| | | portRecorder = portInputField.text;
|
| | | gateRecorder = gateInputField.text;
|
| | | accountRecorder = account.text;
|
| | | passwordRecorder = password.text;
|
| | | istokenRecorder = isToken.isOn;
|
| | |
|
| | | if (!string.IsNullOrEmpty(appid.text))
|
| | | {
|
| | | VersionConfig.Get().m_AppId = appid.text;
|
| | | }
|
| | |
|
| | | if (isToken.isOn)
|
| | | {
|
| | | var loginModel = ModelCenter.Instance.GetModel<LoginModel>();
|
| | |
|
| | | var ip = ipInputField.text;
|
| | | var port = int.Parse(portInputField.text);
|
| | | var gamePort = int.Parse(gateInputField.text);
|
| | | VersionConfig.Get().m_AppId = appid.text;
|
| | | ServerListCenter.Instance.currentServer = new ServerData()
|
| | | {
|
| | | region_flag = int.Parse(serverId.text),
|
| | | login_port = port,
|
| | | game_port = gamePort,
|
| | | };
|
| | |
|
| | | loginModel.sdkLoginResult = new SDKUtility.FP_LoginOk()
|
| | | {
|
| | | account = account.text,
|
| | |
| | | };
|
| | |
|
| | | loginModel.sdkLogined = true;
|
| | | var ip = ServerListCenter.Instance.currentServer.region_domain;
|
| | | var port = ServerListCenter.Instance.currentServer.login_port;
|
| | | var gamePort = ServerListCenter.Instance.currentServer.game_port;
|
| | | loginModel.AccountLogin(ip, port, gamePort);
|
| | | }
|
| | | else
|
| | |
| | | };
|
| | |
|
| | | SDKUtility.Instance.FreePlatformCheckIDAuthentication(result.account);
|
| | |
|
| | | var ip = ipInputField.text;
|
| | | var port = int.Parse(portInputField.text);
|
| | | var gamePort = int.Parse(gateInputField.text);
|
| | | VersionConfig.Get().m_AppId = appid.text;
|
| | | ServerListCenter.Instance.currentServer = new ServerData()
|
| | | {
|
| | | region_flag = int.Parse(serverId.text),
|
| | | login_port = port,
|
| | | game_port = gamePort,
|
| | | };
|
| | |
|
| | | var ip = ServerListCenter.Instance.currentServer.region_domain;
|
| | | var port = ServerListCenter.Instance.currentServer.login_port;
|
| | | var gamePort = ServerListCenter.Instance.currentServer.game_port;
|
| | | loginModel.AccountLogin(ip, port, gamePort);
|
| | | }
|
| | | else
|
| | |
| | | public string token_expire;
|
| | | public string phone;
|
| | | public string account_id;
|
| | | } |
| | | } |
| | | }
|
| | | }
|
| | |
| | | return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<FairyModel>());
|
| | | }
|
| | | }
|
| | |
|
| | | FairyGrabBossModel fairyGrabBossModel { get { return ModelCenter.Instance.GetModel<FairyGrabBossModel>(); } }
|
| | | private void OnRefreshFairyMine()
|
| | | {
|
| | | if (!PlayerDatas.Instance.fairyData.HasFairy)
|
| | |
| | |
|
| | | private void OnExitBtn()
|
| | | {
|
| | | if (fairyGrabBossModel.InActivityTime)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("FairyGrabBossExitError");
|
| | | return;
|
| | | }
|
| | | PlayerFairyData.FairyData fairy = PlayerDatas.Instance.fairyData.fairy;
|
| | | if (fairy != null)
|
| | | {
|
| New file |
| | |
| | | using System;
|
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using TableConfig;
|
| | | using UnityEngine; |
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class FairyGrabBossBehaviour : ScrollItem
|
| | | {
|
| | | [SerializeField] AutoSelectCyclicScroll m_Scroll;
|
| | | [SerializeField] SmoothMask m_SmoothMask;
|
| | | [SerializeField] RectTransform m_CenterSign;
|
| | | [SerializeField] RectTransform m_ContainerSelect;
|
| | | [SerializeField] RectTransform m_ContainerKilling;
|
| | | [SerializeField] RectTransform m_ContainerKilled;
|
| | | [SerializeField] Image m_BossPortrait;
|
| | | [SerializeField] Text m_MapName;
|
| | | [SerializeField] Text m_BossName;
|
| | | [SerializeField] Text m_Progress;
|
| | | [SerializeField] Button m_Select;
|
| | | public int bossId { get; private set; }
|
| | |
|
| | | FairyGrabBossModel model { get { return ModelCenter.Instance.GetModel<FairyGrabBossModel>(); } }
|
| | |
|
| | | private void Awake()
|
| | | {
|
| | | m_Select.AddListener(SelectBoss);
|
| | | }
|
| | |
|
| | | private void SelectBoss()
|
| | | {
|
| | | m_Scroll.TrySelectData(bossId);
|
| | | }
|
| | |
|
| | | public override void Display(object _data)
|
| | | {
|
| | | base.Display(_data);
|
| | | bossId = (int)_data;
|
| | |
|
| | | DrawBossBaseInfo();
|
| | | DisplayProgress();
|
| | | OnSelected(model.selectBoss);
|
| | |
|
| | | model.bossSelectedEvent -= OnSelected;
|
| | | model.bossSelectedEvent += OnSelected;
|
| | | model.bossProgressUpdate -= BossProgressUpdate;
|
| | | model.bossProgressUpdate += BossProgressUpdate;
|
| | | model.stateUpdate -= StateUpdate;
|
| | | model.stateUpdate += StateUpdate;
|
| | | }
|
| | |
|
| | | public override void Dispose()
|
| | | {
|
| | | base.Dispose();
|
| | | model.bossSelectedEvent -= OnSelected;
|
| | | model.bossProgressUpdate -= BossProgressUpdate;
|
| | | model.stateUpdate -= StateUpdate;
|
| | | }
|
| | |
|
| | | private void OnSelected(int _bossId)
|
| | | {
|
| | | m_ContainerSelect.gameObject.SetActive(model.selectBoss == bossId);
|
| | | }
|
| | |
|
| | | void DrawBossBaseInfo()
|
| | | {
|
| | | var config = Config.Instance.Get<FairyGrabBossConfig>(bossId);
|
| | | var bossInfoConfig = Config.Instance.Get<BossInfoConfig>(bossId);
|
| | | var mapConfig = Config.Instance.Get<MapConfig>(bossInfoConfig.MapID);
|
| | | var npcConfig = Config.Instance.Get<NPCConfig>(bossId);
|
| | | m_BossPortrait.SetSprite(config.PortraitID);
|
| | | m_MapName.text = mapConfig.Name;
|
| | | m_BossName.text = npcConfig.charName;
|
| | | }
|
| | |
|
| | | private void BossProgressUpdate(int _bossId)
|
| | | {
|
| | | if (_bossId == bossId)
|
| | | {
|
| | | DisplayProgress();
|
| | | }
|
| | | }
|
| | |
|
| | | private void StateUpdate()
|
| | | {
|
| | | DisplayProgress();
|
| | | }
|
| | |
|
| | | void DisplayProgress()
|
| | | {
|
| | | FairyGrabBossModel.BossProgressInfo bossProgress;
|
| | | bool killed = false;
|
| | | bool opened = model.InActivityTime;
|
| | | if (model.TryGetBossProgress(bossId, out bossProgress))
|
| | | {
|
| | | var progress = 1 - (float)bossProgress.currentHp / bossProgress.totalHp;
|
| | | m_Progress.text = StringUtility.Contact((int)(progress * 100), "%");
|
| | | killed = progress >= 1;
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Progress.text = StringUtility.Contact(0, "%");
|
| | | }
|
| | | m_ContainerKilled.gameObject.SetActive(killed && opened);
|
| | | m_ContainerKilling.gameObject.SetActive(!killed && opened);
|
| | | m_BossPortrait.material = opened ? m_SmoothMask.imageMaterials[0] : m_SmoothMask.imageMaterials[1];
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | protected virtual void LateUpdate()
|
| | | {
|
| | | if (m_Scroll.autoSelectable && model.selectBoss != bossId && bossId > 0)
|
| | | {
|
| | | if (Mathf.Abs(m_CenterSign.position.y - rectTransform.position.y) * 100f < rectTransform.rect.height * 0.45f)
|
| | | {
|
| | | model.selectBoss = bossId;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 39b96e40dd3a91d4592771f3254b58af |
| | | timeCreated: 1535593768 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Tuesday, August 28, 2018
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using TableConfig;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI {
|
| | |
|
| | | public class FairyGrabBossHintWin : Window
|
| | | {
|
| | | [SerializeField] Text m_MapName;
|
| | | [SerializeField] Text m_BossName;
|
| | | [SerializeField] RectTransform m_ContainerKilling;
|
| | | [SerializeField] RectTransform m_ContainerKilled;
|
| | | [SerializeField] FairyGrabBossRankBehaviour[] m_RankBehaviours;
|
| | | [SerializeField] Text m_Progress;
|
| | | [SerializeField] Text m_SurplusTime;
|
| | |
|
| | | float m_Timer = 0f;
|
| | | const float Interval = 10f;
|
| | |
|
| | | int bossId = 0;
|
| | | uint objId = 0;
|
| | |
|
| | | FairyGrabBossModel model { get { return ModelCenter.Instance.GetModel<FairyGrabBossModel>(); } }
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | m_Timer = 0f;
|
| | | var list = GAMgr.Instance.GetTypeList(E_ActorClassType.NpcFightBoss);
|
| | | bossId = 0;
|
| | | if (list != null)
|
| | | {
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | GA_NpcFightBoss bossActor = list[i] as GA_NpcFightBoss;
|
| | | if (bossActor != null && model.bosses.Contains(bossActor.NpcConfig.NPCID))
|
| | | {
|
| | | bossId = bossActor.NpcConfig.NPCID;
|
| | | objId = bossActor.ServerInstID;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | if (bossId != 0)
|
| | | {
|
| | | model.QueryGrabBossHurt(bossId, 0, objId);
|
| | | model.QueryGrabBossProgress(true);
|
| | | GlobalTimeEvent.Instance.secondEvent += SecondEvent;
|
| | | model.bossProgressUpdate += BossProgressUpdate;
|
| | | model.bossHurtUpdate += BossHurtUpdate;
|
| | | DisplayAreaInfo();
|
| | | DisplayTimer();
|
| | | DisplayProgress();
|
| | | DisplayRanks();
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | if (bossId == 0)
|
| | | {
|
| | | CloseImmediately();
|
| | | model.RecheckGrabBoss();
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | GlobalTimeEvent.Instance.secondEvent -= SecondEvent;
|
| | | model.bossProgressUpdate -= BossProgressUpdate;
|
| | | model.bossHurtUpdate -= BossHurtUpdate;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void LateUpdate()
|
| | | {
|
| | | base.LateUpdate();
|
| | | m_Timer += Time.deltaTime;
|
| | | if (m_Timer >= Interval && bossId != 0)
|
| | | {
|
| | | m_Timer = 0f;
|
| | | model.QueryGrabBossHurt(bossId, 0, objId);
|
| | | model.QueryGrabBossProgress();
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | private void DisplayAreaInfo()
|
| | | {
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | var mapConfig = Config.Instance.Get<MapConfig>(mapId);
|
| | | m_MapName.text = mapConfig.Name;
|
| | | var npcConfig = Config.Instance.Get<NPCConfig>(bossId);
|
| | | if (npcConfig != null)
|
| | | {
|
| | | m_BossName.text = npcConfig.charName;
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayProgress()
|
| | | {
|
| | | FairyGrabBossModel.BossProgressInfo bossProgress;
|
| | | bool killed = false;
|
| | | if (model.TryGetBossProgress(bossId, out bossProgress))
|
| | | {
|
| | | var progress = 1 - (float)bossProgress.currentHp / bossProgress.totalHp;
|
| | | m_Progress.text = StringUtility.Contact((int)(progress * 100), "%");
|
| | | killed = progress >= 1;
|
| | | }
|
| | | m_ContainerKilling.gameObject.SetActive(!killed);
|
| | | m_ContainerKilled.gameObject.SetActive(killed);
|
| | | }
|
| | |
|
| | | void DisplayRanks()
|
| | | {
|
| | | FairyGrabBossModel.FairyGrabBossInfo fairyGrabBossInfo;
|
| | | FairyGrabBossModel.BossProgressInfo bossProgress;
|
| | | var index = 0;
|
| | | if (model.TryGetBossHurt(bossId, 0, out fairyGrabBossInfo)
|
| | | && model.TryGetBossProgress(bossId, out bossProgress))
|
| | | {
|
| | | for (int i = 0; i < m_RankBehaviours.Length; i++)
|
| | | {
|
| | | if (i < fairyGrabBossInfo.hurtInfos.Count)
|
| | | {
|
| | | var hurtInfo = fairyGrabBossInfo.hurtInfos[i];
|
| | | var percent = (int)(((float)hurtInfo.totalHurt / bossProgress.totalHp) * 100);
|
| | | m_RankBehaviours[i].Display(hurtInfo.HurtName, percent);
|
| | | index++;
|
| | | }
|
| | | }
|
| | | }
|
| | | for (int i = index; i < m_RankBehaviours.Length; i++)
|
| | | {
|
| | | m_RankBehaviours[i].Display(string.Empty, 0);
|
| | | }
|
| | | }
|
| | |
|
| | | private void DisplayTimer()
|
| | | {
|
| | | var seconds = model.surplusSeconds;
|
| | | if (seconds > 0)
|
| | | {
|
| | | m_SurplusTime.text = TimeUtility.SecondsToDHMSCHS(seconds);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_SurplusTime.text = Language.Get("ActivityEnd");
|
| | | }
|
| | | }
|
| | |
|
| | | private void BossProgressUpdate(int _id)
|
| | | {
|
| | | if (_id == bossId)
|
| | | {
|
| | | DisplayProgress();
|
| | | DisplayRanks();
|
| | | }
|
| | | }
|
| | |
|
| | | private void BossHurtUpdate(int id, int type)
|
| | | {
|
| | | if (id == bossId && type == 0)
|
| | | {
|
| | | DisplayRanks();
|
| | | }
|
| | | }
|
| | |
|
| | | private void SecondEvent()
|
| | | {
|
| | | DisplayTimer();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: b54179e2c4d5fb746a580a62e969c8e7 |
| | | timeCreated: 1535443093 |
| | | 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 TableConfig;
|
| | | using UnityEngine; |
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class FairyGrabBossModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | {
|
| | | public List<int> bosses { get; private set; }
|
| | | Dictionary<int, List<Item>> dropItemDict = new Dictionary<int, List<Item>>();
|
| | | Dictionary<int, Dictionary<int, FairyGrabBossInfo>> fairyGrabBossDict = new Dictionary<int, Dictionary<int, FairyGrabBossInfo>>();
|
| | | Dictionary<int, BossProgressInfo> bossProgressDict = new Dictionary<int, BossProgressInfo>();
|
| | |
|
| | | public bool IsOpen
|
| | | {
|
| | | get
|
| | | {
|
| | | return dailyQuestModel.GetQuestState((int)DailyQuestType.FairyGrabBoss)
|
| | | == DailyQuestModel.DailyQuestState.Normal;
|
| | | }
|
| | | }
|
| | |
|
| | | public bool InActivityTime
|
| | | {
|
| | | get
|
| | | {
|
| | | DailyQuestOpenTime dailyQuestOpenTime;
|
| | | if (dailyQuestModel.TryGetOpenTime((int)DailyQuestType.FairyGrabBoss, out dailyQuestOpenTime))
|
| | | {
|
| | | return dailyQuestOpenTime.InOpenTime() && dailyQuestOpenTime.IsValidServerOpenTime();
|
| | | }
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | | int m_SelectBoss = 0;
|
| | | public int selectBoss
|
| | | {
|
| | | get { return m_SelectBoss; }
|
| | | set
|
| | | {
|
| | | if (value != m_SelectBoss)
|
| | | {
|
| | | m_SelectBoss = value;
|
| | | if (bossSelectedEvent != null)
|
| | | {
|
| | | bossSelectedEvent(m_SelectBoss);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | public int surplusSeconds
|
| | | {
|
| | | get
|
| | | {
|
| | | DailyQuestOpenTime openTime;
|
| | | if (dailyQuestModel.TryGetOpenTime((int)DailyQuestType.FairyGrabBoss, out openTime))
|
| | | {
|
| | | if (openTime.InOpenTime() && openTime.IsValidServerOpenTime())
|
| | | {
|
| | | HourMinute hourMinute;
|
| | | if (openTime.TryGetTodayNearestOpenTime(out hourMinute))
|
| | | {
|
| | | DateTime end = new DateTime(TimeUtility.Year, TimeUtility.Month, TimeUtility.Day,
|
| | | hourMinute.hourEnd, hourMinute.minuteEnd, 0);
|
| | | return (int)(end - TimeUtility.ServerNow).TotalSeconds;
|
| | | }
|
| | | }
|
| | | }
|
| | | return 0;
|
| | | }
|
| | | }
|
| | | public bool grabBossHintOpen { get; private set; }
|
| | |
|
| | | private bool serverInited = false;
|
| | | private DateTime lastQueryProgressTime = DateTime.Now;
|
| | |
|
| | | public event Action stateUpdate;
|
| | | public event Action<int> bossSelectedEvent;
|
| | | public event Action<int, int> bossHurtUpdate;
|
| | | public event Action<int> bossProgressUpdate;
|
| | | public event Action bossGrabHintEvent;
|
| | |
|
| | | DailyQuestModel dailyQuestModel { get { return ModelCenter.Instance.GetModel<DailyQuestModel>(); } }
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | | ParseConfig();
|
| | | StageManager.Instance.onStageLoadFinish += OnStageLoadFinish;
|
| | | DailyQuestActionTimer.Instance.RefreshDailyQuestState += RefreshDailyQuestState;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
|
| | | GA_Hero.OnEnterOrExitArea += OnEnterOrExitArea;
|
| | | GAMgr.Instance.OnFightNpcRequest += OnFightNpcUpdate;
|
| | | GAMgr.Instance.OnFightNpcRelease += OnFightNpcUpdate;
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | serverInited = false;
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | serverInited = true;
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | | {
|
| | | StageManager.Instance.onStageLoadFinish -= OnStageLoadFinish;
|
| | | DailyQuestActionTimer.Instance.RefreshDailyQuestState -= RefreshDailyQuestState;
|
| | | GA_Hero.OnEnterOrExitArea -= OnEnterOrExitArea;
|
| | | GAMgr.Instance.OnFightNpcRequest -= OnFightNpcUpdate;
|
| | | GAMgr.Instance.OnFightNpcRelease -= OnFightNpcUpdate;
|
| | | }
|
| | |
|
| | | private void OnEnterOrExitArea(MapArea.E_Type type, bool arg1)
|
| | | {
|
| | | if (type == MapArea.E_Type.Boss)
|
| | | {
|
| | | RecheckGrabBoss();
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnStageLoadFinish()
|
| | | {
|
| | | if (!(StageManager.Instance.CurrentStage is DungeonStage))
|
| | | {
|
| | | grabBossHintOpen = false;
|
| | | ClearGrabBossInfo();
|
| | | }
|
| | | else
|
| | | {
|
| | | RecheckGrabBoss();
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnFightNpcUpdate(uint npcId)
|
| | | {
|
| | | if (bosses.Contains((int)npcId))
|
| | | {
|
| | | RecheckGrabBoss();
|
| | | }
|
| | | }
|
| | |
|
| | | void ClearGrabBossInfo()
|
| | | {
|
| | | fairyGrabBossDict.Clear();
|
| | | bossProgressDict.Clear();
|
| | | }
|
| | |
|
| | | public void RecheckGrabBoss()
|
| | | {
|
| | | if (!InActivityTime)
|
| | | {
|
| | | CloseGrabBossHint();
|
| | | return;
|
| | | }
|
| | | if (!MapArea.IsInMapArea(PlayerDatas.Instance.hero.CurMapArea, MapArea.E_Type.Boss))
|
| | | {
|
| | | CloseGrabBossHint();
|
| | | return;
|
| | | }
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | var grabBossLine = GeneralConfig.Instance.fairyGrabBossMapLines.ContainsKey(mapId) ?
|
| | | GeneralConfig.Instance.fairyGrabBossMapLines[mapId] : 0;
|
| | | if (PlayerDatas.Instance.baseData.FBID != grabBossLine)
|
| | | {
|
| | | CloseGrabBossHint();
|
| | | return;
|
| | | }
|
| | | int bossId = 0;
|
| | | var list = GAMgr.Instance.GetTypeList(E_ActorClassType.NpcFightBoss);
|
| | | if (list != null)
|
| | | {
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | GA_NpcFightBoss bossActor = list[i] as GA_NpcFightBoss;
|
| | | if (bossActor != null && bosses.Contains(bossActor.NpcConfig.NPCID))
|
| | | {
|
| | | bossId = bossActor.NpcConfig.NPCID;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | if (bossId == 0)
|
| | | {
|
| | | CloseGrabBossHint();
|
| | | return;
|
| | | }
|
| | | grabBossHintOpen = true;
|
| | | if (!WindowCenter.Instance.CheckOpen<FairyGrabBossHintWin>())
|
| | | {
|
| | | WindowCenter.Instance.Open<FairyGrabBossHintWin>();
|
| | | }
|
| | | if (bossGrabHintEvent != null)
|
| | | {
|
| | | bossGrabHintEvent();
|
| | | }
|
| | | }
|
| | |
|
| | | void CloseGrabBossHint()
|
| | | {
|
| | | grabBossHintOpen = false;
|
| | | if (WindowCenter.Instance.CheckOpen<FairyGrabBossHintWin>())
|
| | | {
|
| | | WindowCenter.Instance.CloseImmediately<FairyGrabBossHintWin>();
|
| | | }
|
| | | if (bossGrabHintEvent != null)
|
| | | {
|
| | | bossGrabHintEvent();
|
| | | }
|
| | | }
|
| | |
|
| | | private void RefreshDailyQuestState()
|
| | | {
|
| | | if (!InActivityTime)
|
| | | {
|
| | | ClearGrabBossInfo();
|
| | | }
|
| | | RecheckGrabBoss();
|
| | | if (stateUpdate != null)
|
| | | {
|
| | | stateUpdate();
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnFuncStateChangeEvent(int _id)
|
| | | {
|
| | | if (_id == 139)
|
| | | {
|
| | | RecheckGrabBoss();
|
| | | }
|
| | | }
|
| | |
|
| | | void ParseConfig()
|
| | | {
|
| | | bosses = new List<int>();
|
| | | var configs = Config.Instance.GetAllValues<FairyGrabBossConfig>();
|
| | | for (int i = 0; i < configs.Count; i++)
|
| | | {
|
| | | bosses.Add(configs[i].NPCID);
|
| | | var itemArray = LitJson.JsonMapper.ToObject<int[][]>(configs[i].dropItems);
|
| | | List<Item> list = new List<Item>();
|
| | | for (int k = 0; k < itemArray.Length; k++)
|
| | | {
|
| | | Item item = new Item()
|
| | | {
|
| | | id = itemArray[k][0],
|
| | | count = itemArray[k][1],
|
| | | bind = itemArray[k][2] == 1,
|
| | | };
|
| | | list.Add(item);
|
| | | }
|
| | | dropItemDict.Add(configs[i].NPCID, list);
|
| | | }
|
| | | }
|
| | |
|
| | | public bool TryGetDropItems(int bossId, out List<Item> dropItems)
|
| | | {
|
| | | return dropItemDict.TryGetValue(bossId, out dropItems);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 查询Boss伤害信息
|
| | | /// </summary>
|
| | | /// <param name="bossId"></param>
|
| | | /// <param name="queryType">0-实时仙盟伤血 1-历史仙盟伤血 2-实时玩家伤血 3-历史玩家伤血</param>
|
| | | public void QueryGrabBossHurt(int bossId, int queryType,uint objId)
|
| | | {
|
| | | CA228_tagCMQueryFamilyBossHurt pak = new CA228_tagCMQueryFamilyBossHurt();
|
| | | pak.NPCID = (uint)bossId;
|
| | | pak.QueryType = (byte)queryType;
|
| | | pak.ObjID = (uint)objId;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | |
|
| | | public void UpdateBossHurt(HA715_tagMCFamilyBossHurtList package)
|
| | | {
|
| | | Dictionary<int, FairyGrabBossInfo> dict = null;
|
| | | FairyGrabBossInfo fairyGrabBossInfo = null;
|
| | | if (!fairyGrabBossDict.TryGetValue((int)package.NPCID, out dict))
|
| | | {
|
| | | dict = new Dictionary<int, FairyGrabBossInfo>();
|
| | | fairyGrabBossDict.Add((int)package.NPCID, dict);
|
| | | }
|
| | | if (!dict.TryGetValue(package.HurtType, out fairyGrabBossInfo))
|
| | | {
|
| | | fairyGrabBossInfo = new FairyGrabBossInfo();
|
| | | dict.Add(package.HurtType, fairyGrabBossInfo);
|
| | | }
|
| | | fairyGrabBossInfo.SetData(package);
|
| | | if (bossHurtUpdate != null)
|
| | | {
|
| | | bossHurtUpdate((int)package.NPCID, package.HurtType);
|
| | | }
|
| | | }
|
| | |
|
| | | public void QueryGrabBossProgress(bool force = false)
|
| | | {
|
| | | if (!force && (DateTime.Now - lastQueryProgressTime).TotalSeconds < 10)
|
| | | {
|
| | | return;
|
| | | }
|
| | | lastQueryProgressTime = DateTime.Now;
|
| | | CAC04_tagCGQueryAllFamilyBossHurt pak = new CAC04_tagCGQueryAllFamilyBossHurt();
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | |
|
| | | public void UpdateBossProgress(HAC10_tagGCAllFamilyBossHurtInfoList package)
|
| | | {
|
| | | for (int i = 0; i < package.NPCCount; i++)
|
| | | {
|
| | | var sBossProgress = package.NPCHurtInfo[i];
|
| | | var bossProgress = new BossProgressInfo()
|
| | | {
|
| | | NPCID = (int)sBossProgress.NPCID,
|
| | | CurHP = (int)sBossProgress.CurHP,
|
| | | CurHPEx = (int)sBossProgress.CurHPEx,
|
| | | MaxHP = (int)sBossProgress.MaxHP,
|
| | | MaxHPEx = (int)sBossProgress.MaxHPEx,
|
| | | FamilyID = (int)sBossProgress.FamilyID,
|
| | | FamilyName = UIHelper.ServerStringTrim(sBossProgress.FamilyName),
|
| | | };
|
| | | bossProgressDict[(int)package.NPCHurtInfo[i].NPCID] = bossProgress;
|
| | | if (bossProgressUpdate != null)
|
| | | {
|
| | | bossProgressUpdate(bossProgress.NPCID);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public bool TryGetBossProgress(int bossId,out BossProgressInfo bossProgressInfo)
|
| | | {
|
| | | return bossProgressDict.TryGetValue(bossId, out bossProgressInfo);
|
| | | }
|
| | |
|
| | | public bool TryGetBossHurt(int bossId, int queryType, out FairyGrabBossInfo fairyGrabBossInfo)
|
| | | {
|
| | | fairyGrabBossInfo = null;
|
| | | if (fairyGrabBossDict.ContainsKey(bossId))
|
| | | {
|
| | | return fairyGrabBossDict[bossId].TryGetValue(queryType, out fairyGrabBossInfo);
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 只给地图界面用,谨慎使用
|
| | | /// </summary>
|
| | | /// <param name="lineId"></param>
|
| | | /// <returns></returns>
|
| | | public bool TryGetFairyGrabBossLine(out int lineId)
|
| | | {
|
| | | lineId = 0;
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | var mapLinesDict = GeneralConfig.Instance.fairyGrabBossMapLines;
|
| | | if (mapLinesDict != null && mapLinesDict.ContainsKey(mapId))
|
| | | {
|
| | | lineId = mapLinesDict[mapId];
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public class FairyGrabBossInfo
|
| | | {
|
| | | public int npcId { get; private set; }
|
| | | public int objId { get; private set; }
|
| | | public int hurtType { get; private set; }
|
| | | public int IsSort { get; private set; }
|
| | |
|
| | | public List<BossHurtInfo> hurtInfos = new List<BossHurtInfo>();
|
| | |
|
| | | public void SetData(HA715_tagMCFamilyBossHurtList package)
|
| | | {
|
| | | npcId = (int)package.NPCID;
|
| | | objId = (int)package.ObjID;
|
| | | hurtType = package.HurtType;
|
| | | IsSort = package.IsSort;
|
| | | hurtInfos.Clear();
|
| | | for (int i = 0; i < package.HurtCount; i++)
|
| | | {
|
| | | var sHurt = package.HurtList[i];
|
| | | var hurtInfo = new BossHurtInfo()
|
| | | {
|
| | | FamilyID = (int)sHurt.FamilyID,
|
| | | HurtID = (int)sHurt.HurtID,
|
| | | HurtName = UIHelper.ServerStringTrim(sHurt.HurtName),
|
| | | HurtValue = (int)sHurt.HurtValue,
|
| | | HurtValueEx = (int)sHurt.HurtValueEx,
|
| | | InitTick = sHurt.InitTick,
|
| | | };
|
| | | hurtInfos.Add(hurtInfo);
|
| | | }
|
| | | if (IsSort != 1)
|
| | | {
|
| | | hurtInfos.Sort(Compare);
|
| | | }
|
| | | }
|
| | |
|
| | | int Compare(BossHurtInfo x, BossHurtInfo y)
|
| | | {
|
| | | if (x.totalHurt != y.totalHurt)
|
| | | {
|
| | | return -x.totalHurt.CompareTo(y.totalHurt);
|
| | | }
|
| | | return x.InitTick.CompareTo(y.InitTick);
|
| | | }
|
| | | }
|
| | |
|
| | | public struct BossHurtInfo
|
| | | {
|
| | | public int FamilyID;
|
| | | public int HurtID; // 伤血的ID, 根据伤血类型表示不同的ID, 如仙盟ID或玩家ID
|
| | | public string HurtName;
|
| | | public int HurtValue; // 累计伤血,求余1亿的值
|
| | | public int HurtValueEx; // 累计伤血,整除1亿的值
|
| | | public uint InitTick; // 伤血初始tick,用于排序,先按伤血倒序排,再按tick正序排
|
| | |
|
| | | public long totalHurt
|
| | | {
|
| | | get
|
| | | {
|
| | | return HurtValue + (long)HurtValueEx * Constants.ExpPointValue;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public struct BossProgressInfo
|
| | | {
|
| | | public int NPCID;
|
| | | public int CurHP;
|
| | | public int CurHPEx;
|
| | | public int MaxHP;
|
| | | public int MaxHPEx;
|
| | | public int FamilyID;
|
| | | public string FamilyName;
|
| | |
|
| | | public long currentHp
|
| | | {
|
| | | get
|
| | | {
|
| | | return CurHP + (long)CurHPEx * Constants.ExpPointValue;
|
| | | }
|
| | | }
|
| | |
|
| | | public long totalHp
|
| | | {
|
| | | get
|
| | | {
|
| | | return MaxHP + (long)MaxHPEx * Constants.ExpPointValue;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 7a2dd205b34e1894eadb79449b5eeb65 |
| | | timeCreated: 1535593768 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class FairyGrabBossRankBehaviour : MonoBehaviour
|
| | | {
|
| | | [SerializeField] Text m_FairyName;
|
| | | [SerializeField] Text m_Percent;
|
| | |
|
| | | public void Display(string fairyName, int percent)
|
| | | {
|
| | | m_FairyName.text = fairyName;
|
| | | m_Percent.text = string.IsNullOrEmpty(fairyName) ? string.Empty : StringUtility.Contact(percent, "%");
|
| | | }
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 7719f43979e23884c8f057d774c12353 |
| | | timeCreated: 1535445054 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Monday, August 27, 2018
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using TableConfig;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI {
|
| | |
|
| | | public class FairyGrabBossWin : Window
|
| | | {
|
| | | [SerializeField] CyclicScroll m_Bosses;
|
| | | [SerializeField] Text m_FairyName;
|
| | | [SerializeField] Text m_NoneFairy;
|
| | | [SerializeField] ItemCell[] m_DropItems;
|
| | | [SerializeField] Button m_KillRecord;
|
| | | [SerializeField] Button m_Goto;
|
| | | [SerializeField] RectTransform m_ContainerUnOpen;
|
| | | [SerializeField] RectTransform m_ContainerOpen;
|
| | | [SerializeField] Text m_SurplusTime;
|
| | |
|
| | | FairyGrabBossModel model { get { return ModelCenter.Instance.GetModel<FairyGrabBossModel>(); } }
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | | BossHomeModel bossHomeModel { get { return ModelCenter.Instance.GetModel<BossHomeModel>(); } }
|
| | | FindPreciousModel findPreciousModel { get { return ModelCenter.Instance.GetModel<FindPreciousModel>(); } }
|
| | |
|
| | | float m_Timer = 0f;
|
| | | const float Interval = 10f;
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_KillRecord.onClick.AddListener(KillRecord);
|
| | | m_Goto.onClick.AddListener(Goto);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | DisplaySurplusTime();
|
| | | DisplayBossInfo();
|
| | | DisplayHighestFairy();
|
| | | model.QueryGrabBossProgress(true);
|
| | | GlobalTimeEvent.Instance.secondEvent += SecondEvent;
|
| | | model.bossSelectedEvent += BossSelectedEvent;
|
| | | model.bossProgressUpdate += BossProgressUpdate;
|
| | | model.stateUpdate += StateUpdate;
|
| | | m_Timer = 0;
|
| | | }
|
| | |
|
| | | protected override void OnActived()
|
| | | {
|
| | | base.OnActived();
|
| | | DisplayBosses();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | GlobalTimeEvent.Instance.secondEvent -= SecondEvent;
|
| | | model.bossSelectedEvent -= BossSelectedEvent;
|
| | | model.bossProgressUpdate -= BossProgressUpdate;
|
| | | model.stateUpdate -= StateUpdate;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void LateUpdate()
|
| | | {
|
| | | base.LateUpdate();
|
| | | m_Timer += Time.deltaTime;
|
| | | if (m_Timer >= Interval)
|
| | | {
|
| | | m_Timer = 0;
|
| | | model.QueryGrabBossProgress();
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | void DisplayBosses()
|
| | | {
|
| | | var bosses = new List<int>();
|
| | | bosses.AddRange(model.bosses);
|
| | | model.selectBoss = DefaultSelect();
|
| | | m_Bosses.Init(bosses);
|
| | | m_Bosses.MoveToCenter(bosses.IndexOf(model.selectBoss));
|
| | | }
|
| | |
|
| | | void DisplayBossInfo()
|
| | | {
|
| | | List<Item> dropItems;
|
| | | model.TryGetDropItems(model.selectBoss, out dropItems);
|
| | | for (int i = 0; i < m_DropItems.Length; i++)
|
| | | {
|
| | | m_DropItems[i].cellBtn.RemoveAllListeners();
|
| | | if (dropItems != null && i < dropItems.Count)
|
| | | {
|
| | | m_DropItems[i].gameObject.SetActive(true);
|
| | | var item = dropItems[i];
|
| | | ItemCellModel itemCellModel = new ItemCellModel(item.id, true, (ulong)item.count, item.bind ? 1 : 0);
|
| | | m_DropItems[i].Init(itemCellModel);
|
| | | m_DropItems[i].cellBtn.AddListener(() =>
|
| | | {
|
| | | ItemAttrData itemAttrData = new ItemAttrData(item.id, true, (ulong)item.count, -1, item.bind ? 1 : 0);
|
| | | ModelCenter.Instance.GetModel<ItemTipsModel>().SetItemTipsModel(itemAttrData);
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | m_DropItems[i].gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayHighestFairy()
|
| | | {
|
| | | m_FairyName.text = string.Empty;
|
| | | m_NoneFairy.gameObject.SetActive(true);
|
| | | if (!model.IsOpen)
|
| | | {
|
| | | return;
|
| | | }
|
| | | FairyGrabBossModel.BossProgressInfo bossProgress;
|
| | | if (model.TryGetBossProgress(model.selectBoss, out bossProgress))
|
| | | {
|
| | | m_FairyName.text = bossProgress.FamilyName;
|
| | | m_NoneFairy.gameObject.SetActive(string.IsNullOrEmpty(bossProgress.FamilyName));
|
| | | }
|
| | | }
|
| | |
|
| | | int DefaultSelect()
|
| | | {
|
| | | return model.bosses[0];
|
| | | }
|
| | |
|
| | | void DisplaySurplusTime()
|
| | | {
|
| | | var seconds = model.surplusSeconds;
|
| | | if (seconds > 0)
|
| | | {
|
| | | if (!m_ContainerOpen.gameObject.activeSelf || m_ContainerUnOpen.gameObject.activeSelf)
|
| | | {
|
| | | m_ContainerOpen.gameObject.SetActive(true);
|
| | | m_ContainerUnOpen.gameObject.SetActive(false);
|
| | | }
|
| | | m_SurplusTime.text = TimeUtility.SecondsToDHMSCHS(seconds);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (!m_ContainerUnOpen.gameObject.activeSelf || m_ContainerOpen.gameObject.activeSelf)
|
| | | {
|
| | | m_ContainerUnOpen.gameObject.SetActive(true);
|
| | | m_ContainerOpen.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void Goto()
|
| | | {
|
| | | var error = 0;
|
| | | if (TestEnterDungeon(out error))
|
| | | {
|
| | | WindowJumpMgr.Instance.ClearJumpData();
|
| | | WindowCenter.Instance.Close<LootPreciousFrameWin>();
|
| | | MapTransferUtility.Instance.MoveToNPC(model.selectBoss);
|
| | | }
|
| | | else
|
| | | {
|
| | | switch (error)
|
| | | {
|
| | | case 1:
|
| | | SysNotifyMgr.Instance.ShowTip("FairyGrabBossNoFairy");
|
| | | break;
|
| | | case 3:
|
| | | SysNotifyMgr.Instance.ShowTip("FairyGrabBossUnOpen");
|
| | | break;
|
| | | case 2:
|
| | | FuncOpen.Instance.ProcessorFuncErrorTip(139);
|
| | | break;
|
| | | case 4:
|
| | | var dataMapId = dungeonModel.GetDungeonDataIdByMapId(PlayerDatas.Instance.baseData.MapID);
|
| | | var config = Config.Instance.Get<DungeonOpenTimeConfig>(dataMapId);
|
| | | var tip = string.Empty;
|
| | |
|
| | | if (dataMapId == BossHomeModel.BOSSHOME_MAPID)
|
| | | {
|
| | | var vipLevel = PlayerDatas.Instance.baseData.VIPLv;
|
| | | var vipNeed = bossHomeModel.GetFloorVipRequirement(PlayerDatas.Instance.baseData.dungeonLineId + 1);
|
| | | if (vipLevel < vipNeed)
|
| | | {
|
| | | var moneyNeed = bossHomeModel.GetVipLackCost(PlayerDatas.Instance.baseData.dungeonLineId + 1);
|
| | | var dungeonId = dungeonModel.DungeonMap(BossHomeModel.BOSSHOME_MAPID, PlayerDatas.Instance.baseData.dungeonLineId);
|
| | | var dungeonConfig = Config.Instance.Get<DungeonConfig>(dungeonId);
|
| | | tip = Language.Get("QuitRemindBossHome", dungeonConfig.FBName, vipNeed, moneyNeed);
|
| | | }
|
| | | else
|
| | | {
|
| | | tip = Language.Get(config.ExitDescription);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | tip = Language.Get(config.ExitDescription);
|
| | | }
|
| | |
|
| | | ConfirmCancel.ShowPopConfirm(
|
| | | Language.Get("Mail101"),
|
| | | tip,
|
| | | (bool _ok) =>
|
| | | {
|
| | | if (_ok)
|
| | | {
|
| | | WindowCenter.Instance.Close<LootPreciousFrameWin>();
|
| | | MapTransferUtility.Instance.MoveToNPC(model.selectBoss);
|
| | | }
|
| | | }
|
| | | );
|
| | | break;
|
| | | case 5:
|
| | | SysNotifyMgr.Instance.ShowTip("InDungeon_CantGo");
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private bool TestEnterDungeon(out int _error)
|
| | | {
|
| | | if (!model.InActivityTime)
|
| | | {
|
| | | _error = 3;
|
| | | return false;
|
| | | }
|
| | | if (!PlayerDatas.Instance.fairyData.HasFairy)
|
| | | {
|
| | | _error = 1;
|
| | | return false;
|
| | | }
|
| | | if (!FuncOpen.Instance.IsFuncOpen(139))
|
| | | {
|
| | | _error = 2;
|
| | | return false;
|
| | | }
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | var dataMapId = dungeonModel.GetDungeonDataIdByMapId(mapId);
|
| | |
|
| | | if (dataMapId == BossHomeModel.BOSSHOME_MAPID || dataMapId == ElderGodAreaModel.ELDERGODAREA_MAPID)
|
| | | {
|
| | | _error = 4;
|
| | | return false;
|
| | | }
|
| | |
|
| | | var mapConfig = Config.Instance.Get<MapConfig>(mapId);
|
| | | if (mapConfig.MapFBType != (int)MapType.OpenCountry)
|
| | | {
|
| | | _error = 5;
|
| | | return false;
|
| | | }
|
| | |
|
| | | _error = 0;
|
| | | return true;
|
| | | }
|
| | |
|
| | | private void KillRecord()
|
| | | {
|
| | | findPreciousModel.ViewKillRecordsBoss = model.selectBoss;
|
| | | WindowCenter.Instance.Open<KillRecordsWin>();
|
| | | }
|
| | |
|
| | | private void SecondEvent()
|
| | | {
|
| | | DisplaySurplusTime();
|
| | | }
|
| | |
|
| | | private void BossSelectedEvent(int bossId)
|
| | | {
|
| | | DisplayBossInfo();
|
| | | DisplayHighestFairy();
|
| | | }
|
| | |
|
| | | private void BossProgressUpdate(int bossId)
|
| | | {
|
| | | if (bossId == model.selectBoss)
|
| | | {
|
| | | DisplayHighestFairy();
|
| | | }
|
| | | }
|
| | | private void StateUpdate()
|
| | | {
|
| | | DisplayHighestFairy();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: adb7f6edfa1466b42a2c498cd4c02a92 |
| | | timeCreated: 1535593769 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using UnityEngine.UI; |
| | | using System; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | |
| | | |
| | | [SerializeField] FunctionButtonGroup m_FunctionGroup; |
| | | [SerializeField] FunctionButton m_DemonJar; |
| | | [SerializeField] FunctionButton m_FairyGrabBoss; |
| | | |
| | | [SerializeField] Button m_Left; |
| | | [SerializeField] Button m_Right; |
| | | [SerializeField] Button m_Close; |
| | | |
| | | FairyGrabBossModel fairyGrabBossModel { get { return ModelCenter.Instance.GetModel<FairyGrabBossModel>(); } } |
| | | |
| | | #region Built-in |
| | | protected override void BindController() |
| | |
| | | protected override void AddListeners() |
| | | { |
| | | m_DemonJar.AddListener(ShowDemonJar); |
| | | m_FairyGrabBoss.AddListener(FairyGrabBoss); |
| | | |
| | | m_Left.AddListener(ShowLastFunction); |
| | | m_Right.AddListener(ShowNextFunction); |
| | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | |
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | |
| | | functionOrder = m_DemonJar.order; |
| | | } |
| | | |
| | | private void FairyGrabBoss() |
| | | { |
| | | CloseSubWindows(); |
| | | WindowCenter.Instance.Open<FairyGrabBossWin>(); |
| | | functionOrder = m_FairyGrabBoss.order; |
| | | } |
| | | |
| | | private void CloseSubWindows() |
| | | { |
| | | WindowCenter.Instance.CloseImmediately<DemonJarWin>(); |
| | | WindowCenter.Instance.CloseImmediately<FairyGrabBossWin>(); |
| | | } |
| | | |
| | | private void ShowLastFunction() |
| | |
| | | using TableConfig;
|
| | | using System;
|
| | | using System.Text.RegularExpressions;
|
| | | using System.Linq;
|
| | |
|
| | | public class GeneralConfig : Singleton<GeneralConfig>
|
| | | {
|
| | |
| | |
|
| | | public Dictionary<int, int> dungeonRebornClientTimes { get; private set; }
|
| | | public int[] CompareEquipPlaces { get; private set;}
|
| | | public Dictionary<int,int> fairyGrabBossMapLines { get; private set; }
|
| | |
|
| | | public void Init()
|
| | | {
|
| | |
| | |
|
| | | dungeonCanUseMoneyIds = new List<int>(GetIntArray("FBEnterTickeyAuto", 1));
|
| | | dungeonRebornClientTimes = ConfigParse.GetDic<int, int>(GetInputString("DuplicatesRebornTime", 2));
|
| | |
|
| | | fairyGrabBossMapLines = ConfigParse.GetDic<int, int>(GetInputString("MapLine", 2));
|
| | | var grabBossMaps = fairyGrabBossMapLines.Keys.ToList();
|
| | | foreach (var _key in grabBossMaps)
|
| | | {
|
| | | fairyGrabBossMapLines[_key] = fairyGrabBossMapLines[_key] - 1;
|
| | | }
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | |
| | | modelInterface.RefreshGetBetterEquipEvent += RefreshGetBetterEquipEvent;
|
| | | PlayerMountDatas.PlayerLoginOKData += PlayerLoginOKData;
|
| | | blastFurnaceModel.blastFurnacePromoteUpdate += BlastFurnacePromoteUpdate;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += PlayerDataRefreshInfoEvent;
|
| | | OnBeforePlayerDataInitialize();
|
| | | }
|
| | |
|
| | |
| | | CheckPromoteDetailEffect();
|
| | | }
|
| | |
|
| | | private void PlayerDataRefreshInfoEvent(PlayerDataRefresh refreshType)
|
| | | {
|
| | | if (refreshType == PlayerDataRefresh.OfficialRank)
|
| | | {
|
| | | CheckPromoteDetailEffect();
|
| | | }
|
| | | }
|
| | |
|
| | | private void RedpointValueChangeEvent(int _id)
|
| | | {
|
| | | if (_id == strengthengmodel.StrengthRedpoint.id ||
|
| | |
| | | switch (_type)
|
| | | {
|
| | | case PromoteDetailType.BetterEquip:
|
| | | return modelInterface.CheckBetterEquip(RoleEquipType.retSpiritAnimal);
|
| | | var dict = modelInterface.CheckBetterEquipByRealm();
|
| | | return dict != null && dict.Count > 0;
|
| | | case PromoteDetailType.EquipStrength:
|
| | | return strengthengmodel.StrengthRedpoint.state == RedPointState.Simple;
|
| | | case PromoteDetailType.Mount:
|
| | |
| | | RegisterModel<MultipleRealmPointModel>();
|
| | | RegisterModel<DogzModel>();
|
| | | RegisterModel<TreasureSoulModel>();
|
| | | RegisterModel<FairyGrabBossModel>();
|
| | | inited = true;
|
| | | }
|
| | |
|
| | |
| | | List<string> closeAllIgnoreWindows = new List<string>() {
|
| | | "MessageWin", "NewBieWin", "NewItemGetWin", "AttributePromoteShowWin" ,"DungeonBeginCoolDownWin","DungeonFightWin","StatusTipWin"
|
| | | ,"ScrollTipWin","MarqueeWin","ExperienceOpenWin","TrumpetWin","BattlePrepareCoolDownWin","DungeonGradeWin","BattleHintWin",
|
| | | "TreasureDungeonMissionHintWin",
|
| | | "TreasureDungeonMissionHintWin","FairyGrabBossHintWin",
|
| | | };
|
| | |
|
| | | UIRoot m_UIRoot;
|
| | |
| | | return;
|
| | | }
|
| | | break;
|
| | | case JumpUIType.OpenServerActivityFunc2_1:
|
| | | case JumpUIType.OpenServerActivityFunc2_2:
|
| | | if(TimeUtility.OpenDay >= ModelCenter.Instance.GetModel<OSRedEnvelopeModel>().openDays)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("ActiveOutTime");
|
| | | return;
|
| | | }
|
| | | break;
|
| | | case JumpUIType.TreasureFindHostFunc1:
|
| | | case JumpUIType.TreasureFindHostFunc2:
|
| | | case JumpUIType.TreasureFindHostFunc3:
|
| | |
| | | return;
|
| | | }
|
| | | break;
|
| | | case JumpUIType.OpenServerGift:
|
| | | if(!ModelCenter.Instance.GetModel<OSGiftModel>().activate)
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.coinPointTotal <= 0
|
| | | || !ModelCenter.Instance.GetModel<VipModel>().firstChargeRewardGet)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("GiftNoOpen");
|
| | | }
|
| | | else
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("GiftAlreadyBuy");
|
| | | }
|
| | | return;
|
| | | }
|
| | | break;
|
| | | case JumpUIType.FirstRecharge:
|
| | | var model = ModelCenter.Instance.GetModel<VipModel>();
|
| | | if (model.firstChargeRewardGet)
|
| | | {
|
| | | model.AreadyGetFirstRecharge();
|
| | | return;
|
| | | }
|
| | | break;
|
| | | case JumpUIType.OpenServerMountRank:
|
| | | var type = int.Parse(_tagWinSearchModel.SelectActive);
|
| | | if (rankModel.IsLock(type))
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("InOperationTimeError");
|
| | | return;
|
| | | }
|
| | | if (TimeUtility.OpenDay >= rankModel.openServerActivityDays)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("ActiveOutTime");
|
| | | return;
|
| | | }
|
| | | break;
|
| | | case JumpUIType.OpenServerRank:
|
| | | if (TimeUtility.OpenDay >= rankModel.openServerActivityDays)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("ActiveOutTime");
|
| | | return;
|
| | | }
|
| | | break;
|
| | |
| | | return;
|
| | | }
|
| | | break;
|
| | | case JumpUIType.ConsumreRebate:
|
| | | OperationBase operationBaseConsumre;
|
| | | if (!OperationTimeHepler.Instance.TryGetOperationTime(Operation.ConsumeRebate, out operationBaseConsumre))
|
| | | case JumpUIType.TrialExchange:
|
| | | if (!trialDungeonModel.CompleteTrialFloor(0))
|
| | | {
|
| | | OperationTimeHepler.Instance.ProcessConditionError(Operation.ConsumeRebate);
|
| | | return;
|
| | | }
|
| | | if (!operationBaseConsumre.SatisfyOpenCondition() || !operationBaseConsumre.InTime(TimeUtility.ServerNow))
|
| | | {
|
| | | OperationTimeHepler.Instance.ProcessConditionError(Operation.ConsumeRebate);
|
| | | trialDungeonModel.ProcessOpenTrialExchangeError();
|
| | | return;
|
| | | }
|
| | | break;
|
| | | case JumpUIType.BossReborn:
|
| | | OperationBase operationBaseBoss;
|
| | | if (!OperationTimeHepler.Instance.TryGetOperationTime(Operation.BossReborn, out operationBaseBoss))
|
| | | case JumpUIType.OpenServerMountRank:
|
| | | var type = int.Parse(_tagWinSearchModel.SelectActive);
|
| | | if (rankModel.IsLock(type))
|
| | | {
|
| | | OperationTimeHepler.Instance.ProcessConditionError(Operation.BossReborn);
|
| | | SysNotifyMgr.Instance.ShowTip("InOperationTimeError");
|
| | | return;
|
| | | }
|
| | | if (!operationBaseBoss.SatisfyOpenCondition() || !operationBaseBoss.InTime(TimeUtility.ServerNow))
|
| | | {
|
| | | OperationTimeHepler.Instance.ProcessConditionError(Operation.BossReborn);
|
| | | return;
|
| | | }
|
| | | break;
|
| | | case JumpUIType.LimitedTimePackage:
|
| | | OperationBase operationBaseLimitTime;
|
| | | if (!OperationTimeHepler.Instance.TryGetOperationTime(Operation.GiftPackage, out operationBaseLimitTime))
|
| | | {
|
| | | OperationTimeHepler.Instance.ProcessConditionError(Operation.GiftPackage);
|
| | | return;
|
| | | }
|
| | | if (!operationBaseLimitTime.SatisfyOpenCondition() || !operationBaseLimitTime.InTime(TimeUtility.ServerNow))
|
| | | {
|
| | | OperationTimeHepler.Instance.ProcessConditionError(Operation.GiftPackage);
|
| | | return;
|
| | | }
|
| | | break;
|
| | |
|
| | | case JumpUIType.OSTimeLimitGift:
|
| | | if (!OpenServerActivityCenter.Instance.IsActivityOpen(3))
|
| | | if (TimeUtility.OpenDay >= rankModel.openServerActivityDays)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("ActiveOutTime");
|
| | | return;
|
| | | }
|
| | | break;
|
| | | case JumpUIType.OpenServerRank:
|
| | | case JumpUIType.OSTimeLimitGift:
|
| | | case JumpUIType.VipRechargeFunc3:
|
| | | case JumpUIType.FlashSale:
|
| | | OperationBase operationBaseFlash;
|
| | | if (!OperationTimeHepler.Instance.TryGetOperationTime(Operation.FlashSale, out operationBaseFlash))
|
| | | case JumpUIType.ConsumreRebate:
|
| | | case JumpUIType.LimitedTimePackage:
|
| | | case JumpUIType.BossReborn:
|
| | | case JumpUIType.OpenServerActivityFunc2_1:
|
| | | case JumpUIType.OpenServerActivityFunc2_2:
|
| | | if (!OpenServerActivityCenter.Instance.IsActivityOpen(_tagWinSearchModel.TABID))
|
| | | {
|
| | | OperationTimeHepler.Instance.ProcessConditionError(Operation.FlashSale);
|
| | | return;
|
| | | }
|
| | | if (!operationBaseFlash.SatisfyOpenCondition() || !operationBaseFlash.InTime(TimeUtility.ServerNow))
|
| | | {
|
| | | OperationTimeHepler.Instance.ProcessConditionError(Operation.FlashSale);
|
| | | SysNotifyMgr.Instance.ShowTip("ActiveOutTime");
|
| | | return;
|
| | | }
|
| | | break;
|
| | | case JumpUIType.TrialExchange:
|
| | | if (!trialDungeonModel.CompleteTrialFloor(0))
|
| | | case JumpUIType.OpenServerGift:
|
| | | if (!ModelCenter.Instance.GetModel<OSGiftModel>().activate)
|
| | | {
|
| | | trialDungeonModel.ProcessOpenTrialExchangeError();
|
| | | if (PlayerDatas.Instance.baseData.coinPointTotal <= 0
|
| | | || !ModelCenter.Instance.GetModel<VipModel>().firstChargeRewardGet)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("GiftNoOpen");
|
| | | }
|
| | | else
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("GiftAlreadyBuy");
|
| | | }
|
| | | return;
|
| | | }
|
| | | break;
|
| | |
| | | case JumpUIType.WelfareFunc2:
|
| | | case JumpUIType.WelfareFunc3:
|
| | | case JumpUIType.WelfareFunc2Type2:
|
| | | case JumpUIType.VipRechargeFunc3:
|
| | | SetJumpLogic<WelfareWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.SystemSettingFunc1:
|
| | |
| | | case JumpUIType.UnionTask2:
|
| | | SetJumpLogic<FairyAuTaskWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.OpenServerActivityFunc2_1:
|
| | | case JumpUIType.OpenServerActivityFunc2_2:
|
| | | ModelCenter.Instance.GetModel<OSRedEnvelopeModel>().JumpType = int.Parse(_tagWinSearchModel.SelectActive) + 1;
|
| | | SetJumpLogic<OpenServerActivityWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.UnionActive1:
|
| | | case JumpUIType.UnionActive2:
|
| | | SetJumpLogic<UnionTaskWin>(_tagWinSearchModel.TABID);
|
| | |
| | | ModelCenter.Instance.GetModel<BlastFurnaceModel>().jumpToPrescripe =int.Parse(_tagWinSearchModel.SelectActive);
|
| | | SetJumpLogic<BlastFurnaceWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.OpenServerMountRank:
|
| | | var type = int.Parse(_tagWinSearchModel.SelectActive);
|
| | | ModelCenter.Instance.GetModel<ImpactRankModel>().gotoImpactRankType = type;
|
| | | SetJumpLogic<OpenServerActivityWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.OpenServerRank:
|
| | | SetJumpLogic<OpenServerActivityWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.AttackMagicianType1:
|
| | | case JumpUIType.AttackMagicianType2:
|
| | | ModelCenter.Instance.GetModel<MagicianModel>().gotoType = int.Parse(_tagWinSearchModel.SelectActive);
|
| | |
| | | case JumpUIType.TreasureSoul:
|
| | | SetJumpLogic<TreasureSoulWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.VipRechargeFunc3:
|
| | | case JumpUIType.OSTimeLimitGift:
|
| | | case JumpUIType.FlashSale:
|
| | | case JumpUIType.ConsumreRebate:
|
| | | case JumpUIType.BossReborn:
|
| | | case JumpUIType.OpenServerGift:
|
| | | case JumpUIType.LimitedTimePackage:
|
| | | case JumpUIType.OpenServerRank:
|
| | | SetJumpLogic<OpenServerActivityWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.OpenServerMountRank:
|
| | | var type = int.Parse(_tagWinSearchModel.SelectActive);
|
| | | ModelCenter.Instance.GetModel<ImpactRankModel>().gotoImpactRankType = type;
|
| | | SetJumpLogic<OpenServerActivityWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.OpenServerActivityFunc2_1:
|
| | | case JumpUIType.OpenServerActivityFunc2_2:
|
| | | ModelCenter.Instance.GetModel<OSRedEnvelopeModel>().JumpType = int.Parse(_tagWinSearchModel.SelectActive) + 1;
|
| | | SetJumpLogic<OpenServerActivityWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.BestXB:
|
| | |
| | | StoreFunc5 = 76,
|
| | | VipRechargeFunc1 = 77,
|
| | | VipRechargeFunc2 = 78,
|
| | | VipRechargeFunc3 = 79,//仙玉投资
|
| | | VipRechargeFunc3 = 79,//成长基金(精彩活动)
|
| | | VipRechargeFunc4 = 80,
|
| | | VipRechargeFunc5 = 81,
|
| | | FindPreciousFrameFunc1 = 82,
|
| | |
| | | MakeDrug = 138, //丹药使用
|
| | | XianBaguaIntr = 139, //仙族法宝八卦炉介绍界面
|
| | | UnionTask2 = 140, //仙盟任务界面回到主界面
|
| | | OpenServerActivityFunc2_1 =141, //活动发红包
|
| | | OpenServerActivityFunc2_2 = 142, //活动抢红包
|
| | | OpenServerActivityFunc2_1 =141, //活动发红包(精彩活动)
|
| | | OpenServerActivityFunc2_2 = 142, //活动抢红包(精彩活动)
|
| | | FirstRecharge = 143, // 首充界面
|
| | | KnapSackFunc1Type2 = 144, // 背包界面(返回)
|
| | | StrengthFunc1Type2 = 145, // 强化界面(返回)
|
| | |
| | | VipRechargeVip9 = 164, // vip9
|
| | | VipRechargeVip10 = 165, // vip10
|
| | | PlotTaskFunc3 = 166, //支线任务
|
| | | OpenServerMountRank = 167,//开服活动坐骑排行榜
|
| | | OpenServerMountRank = 167,//开服活动坐骑排行榜(精彩活动)
|
| | | AncientBattle = 168,//上古战场
|
| | | XMZZBattle = 169, //仙魔之争
|
| | | VipRechargeVip1 = 170, // vip1
|
| | | Daily_Kirin = 171, //日常任务-麒麟之府
|
| | | AttackMagicianType1 = 172, //攻击神兵
|
| | | AttackMagicianType2 = 173, //攻击神兵
|
| | | OpenServerRank = 174, //全名冲榜
|
| | | OpenServerRank = 174, //全名冲榜(精彩活动)
|
| | | Daily_BountyMission = 175, //日常任务-师门悬赏
|
| | | Daily_IceCrystal = 176, //日常任务-冰晶矿脉
|
| | | Daily_Trial = 177, //日常任务-宗门试炼
|
| | |
| | | FaBaoSoul_Wings = 195, //法宝魂-翅膀之魂
|
| | | FaBaoSoul_Suit = 196, //法宝魂-套装之魂
|
| | | FaBaoSoul_Wash = 197, //法宝魂-洗炼之魂
|
| | | ConsumreRebate = 198, //福利—消费返利界面
|
| | | OSTimeLimitGift=199, //开服活动开服特惠
|
| | | ConsumreRebate = 198, //福利—消费返利界面(精彩活动)
|
| | | OSTimeLimitGift=199, //开服活动开服特惠(精彩活动)
|
| | | WelfareFunc2Type2 = 200, //祈愿返回主界面
|
| | | LimitedTimePackage = 201, //限时礼包
|
| | | BossReborn = 202, //Boss复活
|
| | | FlashSale = 203, //开服活动-限时特惠
|
| | | LimitedTimePackage = 201, //限时礼包(精彩活动)
|
| | | BossReborn = 202, //Boss复活(精彩活动)
|
| | | FlashSale = 203, //开服活动-限时特惠(精彩活动)
|
| | | BestXB = 204, //极品寻宝
|
| | | RuneXB = 205, //符印寻宝
|
| | | XBStore = 206, //寻宝商店
|
| | |
| | |
|
| | | int mapId = 0;
|
| | | MapModel model { get { return ModelCenter.Instance.GetModel<MapModel>(); } }
|
| | | FairyGrabBossModel fairyGrabBossModel { get { return ModelCenter.Instance.GetModel<FairyGrabBossModel>(); } }
|
| | |
|
| | | protected override void BindController()
|
| | | {
|
| | |
| | | m_MapName.text = mapConfig.Name;
|
| | |
|
| | | m_MapLineSwitch.gameObject.SetActive(mapId == PlayerDatas.Instance.baseData.MapID);
|
| | | if (BossFakeLineUtility.Instance.showFakeLine)
|
| | | var grabBossLine = 0;
|
| | | fairyGrabBossModel.TryGetFairyGrabBossLine(out grabBossLine);
|
| | | if (grabBossLine != 0 && PlayerDatas.Instance.baseData.FBID == grabBossLine)
|
| | | {
|
| | | m_CurrentLine.text = Language.Get("line", 1);
|
| | | m_CurrentLine.text = Language.Get("FairyGrabBossLine");
|
| | | }
|
| | | else
|
| | | {
|
| | | m_CurrentLine.text = Language.Get("line", PlayerDatas.Instance.baseData.FBID + 1);
|
| | | if (BossFakeLineUtility.Instance.showFakeLine)
|
| | | {
|
| | | m_CurrentLine.text = Language.Get("line", 1);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_CurrentLine.text = Language.Get("line", PlayerDatas.Instance.baseData.FBID + 1);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | [SerializeField] Text m_Title;
|
| | |
|
| | | MapModel model { get { return ModelCenter.Instance.GetModel<MapModel>(); } }
|
| | | FairyGrabBossModel fairyGrabBossModel { get { return ModelCenter.Instance.GetModel<FairyGrabBossModel>(); } }
|
| | |
|
| | | MapLine line;
|
| | |
|
| | |
| | | base.Display(_data);
|
| | |
|
| | | line = (MapLine)_data;
|
| | | m_Title.text = Language.Get("line", line.lineIndex);
|
| | |
|
| | | var grabBossLine = 0;
|
| | | if (fairyGrabBossModel.TryGetFairyGrabBossLine(out grabBossLine) && line.lineIndex == grabBossLine + 1)
|
| | | {
|
| | | m_Title.text = Language.Get("FairyGrabBossLine");
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Title.text = Language.Get("line", line.lineIndex);
|
| | | }
|
| | | }
|
| | |
|
| | | public override void Dispose()
|
| | |
| | | int mapUnLockIndex = 0;
|
| | |
|
| | | PlayerTaskDatas taskModel { get { return ModelCenter.Instance.GetModel<PlayerTaskDatas>(); } }
|
| | | FairyGrabBossModel fairyGrabBossModel { get { return ModelCenter.Instance.GetModel<FairyGrabBossModel>(); } }
|
| | |
|
| | | public event Action<int> selectLocalMapEventPointEvent;
|
| | | public event Action<int> mapLinesUpdateEvent;
|
| | |
| | | BossHome = 24,
|
| | | PersonalBoss = 25,
|
| | | ElderGodArea = 26,
|
| | | FairyGrabBoss = 27,
|
| | | }
|
| | |
|
| | | public enum ActivityPrepareType
|