Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
1 文件已重命名
37个文件已修改
7个文件已删除
70个文件已添加
| | |
| | | public static void Init()
|
| | | {
|
| | | // 登记相应的数据体及对应的数据转逻辑类
|
| | | Register(typeof(HB214_tagMCCuntomFBPrizeInfo), typeof(DTCB214_tagMCCuntomFBPrizeInfo));
|
| | | Register(typeof(HA307_tagMCFairyAdventuresInfo), typeof(DTCA307_tagMCFairyAdventuresInfo));
|
| | | Register(typeof(HA306_tagMCFairyDomainInfo), typeof(DTCA306_tagMCFairyDomainInfo));
|
| | | Register(typeof(HB107_tagMCRolePointInfo), typeof(DTCB107_tagMCRolePointInfo));
|
| | | Register(typeof(HA327_tagMCRealmExpInfo), typeof(DTCA327_tagMCRealmExpInfo));
|
| | | Register(typeof(HA40C_tagGCAllFamilyBossInfo), typeof(DTCA40C_tagGCAllFamilyBossInfo));
|
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: Fish |
| | | // [ Date ]: Tuesday, April 09, 2019 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System.IO; |
| | | using System.Threading; |
| | | using System; |
| | | using UnityEngine; |
| | | |
| | | [XLua.LuaCallCSharp] |
| | | public partial class AdventureDialogueConfig |
| | | { |
| | | |
| | | public readonly int id;
|
| | | public readonly int type;
|
| | | public readonly int gear;
|
| | | public readonly int npcId;
|
| | | public readonly string[] dialogues;
|
| | | public readonly int[] speakType; |
| | | |
| | | public AdventureDialogueConfig() |
| | | { |
| | | } |
| | | |
| | | public AdventureDialogueConfig(string input) |
| | | { |
| | | try |
| | | { |
| | | var tables = input.Split('\t'); |
| | | |
| | | int.TryParse(tables[0],out id); |
| | |
|
| | | int.TryParse(tables[1],out type); |
| | |
|
| | | int.TryParse(tables[2],out gear); |
| | |
|
| | | int.TryParse(tables[3],out npcId); |
| | |
|
| | | dialogues = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
|
| | |
|
| | | string[] speakTypeStringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | speakType = new int[speakTypeStringArray.Length]; |
| | | for (int i=0;i<speakTypeStringArray.Length;i++) |
| | | { |
| | | int.TryParse(speakTypeStringArray[i],out speakType[i]); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | DebugEx.Log(ex); |
| | | } |
| | | } |
| | | |
| | | static Dictionary<string, AdventureDialogueConfig> configs = new Dictionary<string, AdventureDialogueConfig>(); |
| | | public static AdventureDialogueConfig Get(string id) |
| | | { |
| | | if (!inited) |
| | | { |
| | | Debug.Log("AdventureDialogueConfig 还未完成初始化。"); |
| | | return null; |
| | | } |
| | | |
| | | if (configs.ContainsKey(id)) |
| | | { |
| | | return configs[id]; |
| | | } |
| | | |
| | | AdventureDialogueConfig config = null; |
| | | if (rawDatas.ContainsKey(id)) |
| | | { |
| | | config = configs[id] = new AdventureDialogueConfig(rawDatas[id]); |
| | | rawDatas.Remove(id); |
| | | } |
| | | |
| | | return config; |
| | | } |
| | | |
| | | public static AdventureDialogueConfig Get(int id) |
| | | { |
| | | return Get(id.ToString()); |
| | | } |
| | | |
| | | public static List<string> GetKeys() |
| | | { |
| | | var keys = new List<string>(); |
| | | keys.AddRange(configs.Keys); |
| | | keys.AddRange(rawDatas.Keys); |
| | | return keys; |
| | | } |
| | | |
| | | public static List<AdventureDialogueConfig> GetValues() |
| | | { |
| | | var values = new List<AdventureDialogueConfig>(); |
| | | values.AddRange(configs.Values); |
| | | |
| | | var keys = new List<string>(rawDatas.Keys); |
| | | foreach (var key in keys) |
| | | { |
| | | values.Add(Get(key)); |
| | | } |
| | | |
| | | return values; |
| | | } |
| | | |
| | | public static bool Has(string id) |
| | | { |
| | | return configs.ContainsKey(id) || rawDatas.ContainsKey(id); |
| | | } |
| | | |
| | | public static bool Has(int id) |
| | | { |
| | | return Has(id.ToString()); |
| | | } |
| | | |
| | | public static bool inited { get; private set; } |
| | | protected static Dictionary<string, string> rawDatas = new Dictionary<string, string>(); |
| | | public static void Init(bool sync=false) |
| | | { |
| | | inited = false; |
| | | var path = string.Empty; |
| | | if (AssetSource.refdataFromEditor) |
| | | { |
| | | path = ResourcesPath.CONFIG_FODLER +"/AdventureDialogue.txt"; |
| | | } |
| | | else |
| | | { |
| | | path = AssetVersionUtility.GetAssetFilePath("config/AdventureDialogue.txt"); |
| | | } |
| | | |
| | | var tempConfig = new AdventureDialogueConfig(); |
| | | var preParse = tempConfig is IConfigPostProcess; |
| | | |
| | | if (sync) |
| | | { |
| | | var lines = File.ReadAllLines(path); |
| | | if (!preParse) |
| | | { |
| | | rawDatas = new Dictionary<string, string>(lines.Length - 3); |
| | | } |
| | | for (int i = 3; i < lines.Length; i++) |
| | | { |
| | | try |
| | | { |
| | | var line = lines[i]; |
| | | var index = line.IndexOf("\t"); |
| | | if (index == -1) |
| | | { |
| | | continue; |
| | | } |
| | | var id = line.Substring(0, index); |
| | | |
| | | if (preParse) |
| | | { |
| | | var config = new AdventureDialogueConfig(line); |
| | | configs[id] = config; |
| | | (config as IConfigPostProcess).OnConfigParseCompleted(); |
| | | } |
| | | else |
| | | { |
| | | rawDatas[id] = line; |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | Debug.LogError(ex); |
| | | } |
| | | } |
| | | inited = true; |
| | | } |
| | | else |
| | | { |
| | | ThreadPool.QueueUserWorkItem((object _object) => |
| | | { |
| | | var lines = File.ReadAllLines(path); |
| | | if (!preParse) |
| | | { |
| | | rawDatas = new Dictionary<string, string>(lines.Length - 3); |
| | | } |
| | | for (int i = 3; i < lines.Length; i++) |
| | | { |
| | | try |
| | | { |
| | | var line = lines[i]; |
| | | var index = line.IndexOf("\t"); |
| | | if (index == -1) |
| | | { |
| | | continue; |
| | | } |
| | | var id = line.Substring(0, index); |
| | | |
| | | if (preParse) |
| | | { |
| | | var config = new AdventureDialogueConfig(line); |
| | | configs[id] = config; |
| | | (config as IConfigPostProcess).OnConfigParseCompleted(); |
| | | } |
| | | else |
| | | { |
| | | rawDatas[id] = line; |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | Debug.LogError(ex); |
| | | } |
| | | } |
| | | |
| | | inited = true; |
| | | }); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 4bb7f23bbb7b6ad42b314de10a7abc1b |
| | | timeCreated: 1554788345 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: Fish |
| | | // [ Date ]: Thursday, February 14, 2019 |
| | | // [ Date ]: Monday, April 08, 2019 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | |
| | | public partial class DailyQuestOpenTimeConfig |
| | | { |
| | | |
| | | public readonly int ID; |
| | | public readonly string ActionName; |
| | | public readonly int OpenServerDay; |
| | | public readonly string OpenTime; |
| | | public readonly int Duration; |
| | | public readonly int DayTimes; |
| | | public readonly int DayReKind; |
| | | public readonly int WeekTimes; |
| | | public readonly int WeekReKind; |
| | | public readonly int ID;
|
| | | public readonly string ActionName;
|
| | | public readonly int OpenServerDay;
|
| | | public readonly string OpenTime;
|
| | | public readonly int Duration;
|
| | | public readonly int DayTimes;
|
| | | public readonly int DayBuyTimes;
|
| | | public readonly int BuyNeedMoney;
|
| | | public readonly int DayItemAddTimes;
|
| | | public readonly int DayItemID;
|
| | | public readonly int DayReKind;
|
| | | public readonly int WeekTimes;
|
| | | public readonly int WeekReKind;
|
| | | public readonly int OpenUI; |
| | | |
| | | public DailyQuestOpenTimeConfig() |
| | |
| | | { |
| | | var tables = input.Split('\t'); |
| | | |
| | | int.TryParse(tables[0],out ID); |
| | | |
| | | ActionName = tables[1]; |
| | | |
| | | int.TryParse(tables[2],out OpenServerDay); |
| | | |
| | | OpenTime = tables[3]; |
| | | |
| | | int.TryParse(tables[4],out Duration); |
| | | |
| | | int.TryParse(tables[5],out DayTimes); |
| | | |
| | | int.TryParse(tables[6],out DayReKind); |
| | | |
| | | int.TryParse(tables[7],out WeekTimes); |
| | | |
| | | int.TryParse(tables[8],out WeekReKind); |
| | | |
| | | int.TryParse(tables[9],out OpenUI); |
| | | int.TryParse(tables[0],out ID); |
| | |
|
| | | ActionName = tables[1];
|
| | |
|
| | | int.TryParse(tables[2],out OpenServerDay); |
| | |
|
| | | OpenTime = tables[3];
|
| | |
|
| | | int.TryParse(tables[4],out Duration); |
| | |
|
| | | int.TryParse(tables[5],out DayTimes); |
| | |
|
| | | int.TryParse(tables[6],out DayBuyTimes); |
| | |
|
| | | int.TryParse(tables[7],out BuyNeedMoney); |
| | |
|
| | | int.TryParse(tables[8],out DayItemAddTimes); |
| | |
|
| | | int.TryParse(tables[9],out DayItemID); |
| | |
|
| | | int.TryParse(tables[10],out DayReKind); |
| | |
|
| | | int.TryParse(tables[11],out WeekTimes); |
| | |
|
| | | int.TryParse(tables[12],out WeekReKind); |
| | |
|
| | | int.TryParse(tables[13],out OpenUI); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | fileFormatVersion: 2 |
| | | guid: c6f0b6d546225e442839089494e039bc |
| | | timeCreated: 1550121862 |
| | | timeCreated: 1554704148 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: Fish |
| | | // [ Date ]: Monday, April 08, 2019 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System.IO; |
| | | using System.Threading; |
| | | using System; |
| | | using UnityEngine; |
| | | |
| | | [XLua.LuaCallCSharp] |
| | | public partial class HazyRegionConfig |
| | | { |
| | | |
| | | public readonly int id;
|
| | | public readonly int incidentType;
|
| | | public readonly string name;
|
| | | public readonly int dungeonId;
|
| | | public readonly int lineId;
|
| | | public readonly int npcId;
|
| | | public readonly int crossServer;
|
| | | public readonly int point;
|
| | | public readonly int alchemyLevel;
|
| | | public readonly int[] reward;
|
| | | public readonly int[] rewardState;
|
| | | public readonly string PortraitID; |
| | | |
| | | public HazyRegionConfig() |
| | | { |
| | | } |
| | | |
| | | public HazyRegionConfig(string input) |
| | | { |
| | | try |
| | | { |
| | | var tables = input.Split('\t'); |
| | | |
| | | int.TryParse(tables[0],out id); |
| | |
|
| | | int.TryParse(tables[1],out incidentType); |
| | |
|
| | | name = tables[2];
|
| | |
|
| | | int.TryParse(tables[3],out dungeonId); |
| | |
|
| | | int.TryParse(tables[4],out lineId); |
| | |
|
| | | int.TryParse(tables[5],out npcId); |
| | |
|
| | | int.TryParse(tables[6],out crossServer); |
| | |
|
| | | int.TryParse(tables[7],out point); |
| | |
|
| | | int.TryParse(tables[8],out alchemyLevel); |
| | |
|
| | | string[] rewardStringArray = tables[9].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | reward = new int[rewardStringArray.Length]; |
| | | for (int i=0;i<rewardStringArray.Length;i++) |
| | | { |
| | | int.TryParse(rewardStringArray[i],out reward[i]); |
| | | }
|
| | |
|
| | | string[] rewardStateStringArray = tables[10].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | rewardState = new int[rewardStateStringArray.Length]; |
| | | for (int i=0;i<rewardStateStringArray.Length;i++) |
| | | { |
| | | int.TryParse(rewardStateStringArray[i],out rewardState[i]); |
| | | }
|
| | |
|
| | | PortraitID = tables[11]; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | DebugEx.Log(ex); |
| | | } |
| | | } |
| | | |
| | | static Dictionary<string, HazyRegionConfig> configs = new Dictionary<string, HazyRegionConfig>(); |
| | | public static HazyRegionConfig Get(string id) |
| | | { |
| | | if (!inited) |
| | | { |
| | | Debug.Log("HazyRegionConfig 还未完成初始化。"); |
| | | return null; |
| | | } |
| | | |
| | | if (configs.ContainsKey(id)) |
| | | { |
| | | return configs[id]; |
| | | } |
| | | |
| | | HazyRegionConfig config = null; |
| | | if (rawDatas.ContainsKey(id)) |
| | | { |
| | | config = configs[id] = new HazyRegionConfig(rawDatas[id]); |
| | | rawDatas.Remove(id); |
| | | } |
| | | |
| | | return config; |
| | | } |
| | | |
| | | public static HazyRegionConfig Get(int id) |
| | | { |
| | | return Get(id.ToString()); |
| | | } |
| | | |
| | | public static List<string> GetKeys() |
| | | { |
| | | var keys = new List<string>(); |
| | | keys.AddRange(configs.Keys); |
| | | keys.AddRange(rawDatas.Keys); |
| | | return keys; |
| | | } |
| | | |
| | | public static List<HazyRegionConfig> GetValues() |
| | | { |
| | | var values = new List<HazyRegionConfig>(); |
| | | values.AddRange(configs.Values); |
| | | |
| | | var keys = new List<string>(rawDatas.Keys); |
| | | foreach (var key in keys) |
| | | { |
| | | values.Add(Get(key)); |
| | | } |
| | | |
| | | return values; |
| | | } |
| | | |
| | | public static bool Has(string id) |
| | | { |
| | | return configs.ContainsKey(id) || rawDatas.ContainsKey(id); |
| | | } |
| | | |
| | | public static bool Has(int id) |
| | | { |
| | | return Has(id.ToString()); |
| | | } |
| | | |
| | | public static bool inited { get; private set; } |
| | | protected static Dictionary<string, string> rawDatas = new Dictionary<string, string>(); |
| | | public static void Init(bool sync=false) |
| | | { |
| | | inited = false; |
| | | var path = string.Empty; |
| | | if (AssetSource.refdataFromEditor) |
| | | { |
| | | path = ResourcesPath.CONFIG_FODLER +"/HazyRegion.txt"; |
| | | } |
| | | else |
| | | { |
| | | path = AssetVersionUtility.GetAssetFilePath("config/HazyRegion.txt"); |
| | | } |
| | | |
| | | var tempConfig = new HazyRegionConfig(); |
| | | var preParse = tempConfig is IConfigPostProcess; |
| | | |
| | | if (sync) |
| | | { |
| | | var lines = File.ReadAllLines(path); |
| | | if (!preParse) |
| | | { |
| | | rawDatas = new Dictionary<string, string>(lines.Length - 3); |
| | | } |
| | | for (int i = 3; i < lines.Length; i++) |
| | | { |
| | | try |
| | | { |
| | | var line = lines[i]; |
| | | var index = line.IndexOf("\t"); |
| | | if (index == -1) |
| | | { |
| | | continue; |
| | | } |
| | | var id = line.Substring(0, index); |
| | | |
| | | if (preParse) |
| | | { |
| | | var config = new HazyRegionConfig(line); |
| | | configs[id] = config; |
| | | (config as IConfigPostProcess).OnConfigParseCompleted(); |
| | | } |
| | | else |
| | | { |
| | | rawDatas[id] = line; |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | Debug.LogError(ex); |
| | | } |
| | | } |
| | | inited = true; |
| | | } |
| | | else |
| | | { |
| | | ThreadPool.QueueUserWorkItem((object _object) => |
| | | { |
| | | var lines = File.ReadAllLines(path); |
| | | if (!preParse) |
| | | { |
| | | rawDatas = new Dictionary<string, string>(lines.Length - 3); |
| | | } |
| | | for (int i = 3; i < lines.Length; i++) |
| | | { |
| | | try |
| | | { |
| | | var line = lines[i]; |
| | | var index = line.IndexOf("\t"); |
| | | if (index == -1) |
| | | { |
| | | continue; |
| | | } |
| | | var id = line.Substring(0, index); |
| | | |
| | | if (preParse) |
| | | { |
| | | var config = new HazyRegionConfig(line); |
| | | configs[id] = config; |
| | | (config as IConfigPostProcess).OnConfigParseCompleted(); |
| | | } |
| | | else |
| | | { |
| | | rawDatas[id] = line; |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | Debug.LogError(ex); |
| | | } |
| | | } |
| | | |
| | | inited = true; |
| | | }); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 3404c0f308cb2174bb7b93e12c3110bd |
| | | timeCreated: 1554713166 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System;
|
| | | using System.Collections.Generic;
|
| | |
|
| | | public partial class AdventureDialogueConfig : IConfigPostProcess
|
| | | {
|
| | | static Dictionary<int, AdventureDialogueConfig> adventureDialogues = new Dictionary<int, AdventureDialogueConfig>();
|
| | |
|
| | | public void OnConfigParseCompleted()
|
| | | {
|
| | | var key = type * 1000 + gear;
|
| | | adventureDialogues.Add(key, this);
|
| | | }
|
| | |
|
| | | public static AdventureDialogueConfig Get(int type, int gear)
|
| | | {
|
| | | var key = type * 1000 + gear;
|
| | | if (adventureDialogues.ContainsKey(key))
|
| | | {
|
| | | return adventureDialogues[key];
|
| | | }
|
| | | return null;
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 2d9e840934f98914f8271a7229baad8b |
| | | timeCreated: 1554789684 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | |
| | | public class CA231_tagCMClientStartCustomScene : GameNetPackBasic |
| | | { |
| | | public uint MapID;
|
| | | public ushort FuncLineID; |
| | | |
| | | |
| | | |
| | | public CA231_tagCMClientStartCustomScene() |
| | | { |
| | |
| | | } |
| | | |
| | | public override void WriteToBytes() |
| | | { |
| | | {
|
| | | WriteBytes(MapID, NetDataType.DWORD);
|
| | | WriteBytes(FuncLineID, NetDataType.WORD);
|
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // A2 33 前端退出自定义场景 #tagCMClientExitCustomScene
|
| | |
|
| | | public class CA233_tagCMClientExitCustomScene : GameNetPackBasic {
|
| | |
|
| | | public CA233_tagCMClientExitCustomScene () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xA233;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f040e374599a6384bacdea70b3860c14 |
| | | timeCreated: 1555060344 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // A5 25 购买日常活动次数 #tagCMBuyDailyActionCnt
|
| | |
|
| | | public class CA525_tagCMBuyDailyActionCnt : GameNetPackBasic {
|
| | | public uint ActionID; // ID
|
| | | public byte AddType; // 0-花仙玉 1-用物品
|
| | |
|
| | | public CA525_tagCMBuyDailyActionCnt () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xA525;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (ActionID, NetDataType.DWORD);
|
| | | WriteBytes (AddType, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 5abd0a346af49774db312d49c39a4004 |
| | | timeCreated: 1554708856 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // A5 26 寻访仙域 #tagCMVisitFairyDomain
|
| | |
|
| | | public class CA526_tagCMVisitFairyDomain : GameNetPackBasic {
|
| | | public byte Type; //0-开始寻访 1-结束寻访
|
| | |
|
| | | public CA526_tagCMVisitFairyDomain () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xA526;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (Type, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f13a5e03498d69c448f40987085005ef |
| | | timeCreated: 1554708856 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // B1 08 刷新自定义副本奖励 #tagCMRefreshCustomFBPrize
|
| | |
|
| | | public class CB108_tagCMRefreshCustomFBPrize : GameNetPackBasic {
|
| | | public uint MapID;
|
| | | public ushort FuncLineID;
|
| | |
|
| | | public CB108_tagCMRefreshCustomFBPrize () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xB108;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (MapID, NetDataType.DWORD);
|
| | | WriteBytes (FuncLineID, NetDataType.WORD);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 82b61f8b44b0c6f459ef79578d4357af |
| | | timeCreated: 1555060380 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // B1 09 结算自定义副本奖励 #tagCMGiveCustomFBPrize
|
| | |
|
| | | public class CB109_tagCMGiveCustomFBPrize : GameNetPackBasic {
|
| | | public uint MapID;
|
| | | public ushort FuncLineID;
|
| | |
|
| | | public CB109_tagCMGiveCustomFBPrize () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xB109;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (MapID, NetDataType.DWORD);
|
| | | WriteBytes (FuncLineID, NetDataType.WORD);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: d4215fa17ed261e4a866238b783b4822 |
| | | timeCreated: 1555060380 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | public class CC105_tagCMEnterCrossServer : GameNetPackBasic |
| | | { |
| | | public uint DataMapID; |
| | | public ushort LineID; |
| | | |
| | | public CC105_tagCMEnterCrossServer() |
| | | { |
| | |
| | | public override void WriteToBytes() |
| | | { |
| | | WriteBytes(DataMapID, NetDataType.DWORD); |
| | | WriteBytes(LineID, NetDataType.WORD); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Monday, April 08, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using Snxxz.UI;
|
| | | public class DTCA306_tagMCFairyDomainInfo : DtcBasic
|
| | | {
|
| | |
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | base.Done(vNetPack);
|
| | | var package = vNetPack as HA306_tagMCFairyDomainInfo;
|
| | |
|
| | | ModelCenter.Instance.GetModel<HazyRegionModel>().ReceivePackage(package);
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f2900c8af146e174eb09138dbb65c67d |
| | | timeCreated: 1554708793 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Tuesday, April 09, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using Snxxz.UI;
|
| | | public class DTCA307_tagMCFairyAdventuresInfo : DtcBasic
|
| | | {
|
| | |
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | base.Done(vNetPack);
|
| | | var package = vNetPack as HA307_tagMCFairyAdventuresInfo;
|
| | |
|
| | | ModelCenter.Instance.GetModel<HazyRegionModel>().ReceivePackage(package);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 26f2b0ac048588a4ca60fef985c49252 |
| | | timeCreated: 1554788566 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Friday, April 12, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | |
|
| | | public class DTCB214_tagMCCuntomFBPrizeInfo : DtcBasic
|
| | | {
|
| | |
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | base.Done(vNetPack);
|
| | | var package = vNetPack as HB214_tagMCCuntomFBPrizeInfo;
|
| | |
|
| | | ClientDungeonStageUtility.ReceiveCustomItems(package);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 2f01312eb80fad447b59dc1ffac96129 |
| | | timeCreated: 1555060570 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // A3 06 缥缈仙域信息 #tagMCFairyDomainInfo
|
| | |
|
| | | public class HA306_tagMCFairyDomainInfo : GameNetPackBasic {
public byte IsAll; //是否全部
|
| | | public byte State; //是否寻访中
|
| | |
|
| | | public uint VisitCnt; //寻访次数
|
| | | public ushort Energy; //体力
|
| | | public byte Count; // 信息个数
|
| | | public tagMCFairyDomainEvent[] InfoList; // 信息列表
|
| | |
|
| | | public HA306_tagMCFairyDomainInfo () {
|
| | | _cmd = (ushort)0xA306;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
TransBytes(out IsAll, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out State, vBytes, NetDataType.BYTE);
TransBytes(out VisitCnt, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out Energy, vBytes, NetDataType.WORD);
|
| | | TransBytes (out Count, vBytes, NetDataType.BYTE);
|
| | | InfoList = new tagMCFairyDomainEvent[Count];
|
| | | for (int i = 0; i < Count; i ++) {
|
| | | InfoList[i] = new tagMCFairyDomainEvent();
|
| | | TransBytes (out InfoList[i].EventID, vBytes, NetDataType.WORD);
|
| | | TransBytes (out InfoList[i].EventState, vBytes, NetDataType.BYTE);
|
| | | }
|
| | | }
|
| | |
|
| | | public struct tagMCFairyDomainEvent {
|
| | | public ushort EventID; //事件ID
|
| | | public byte EventState; //事件状态 1-未拜访 2-拜访中 3-已拜访 |
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: a1dec766a8bd13348b98571a82ce0ea2 |
| | | timeCreated: 1554708767 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // A3 07 缥缈奇遇信息 #tagMCFairyAdventuresInfo
|
| | |
|
| | | public class HA307_tagMCFairyAdventuresInfo : GameNetPackBasic {
|
| | | public byte Cnt;
|
| | | public tagMCFairyAdventuresData[] InfoList; // 信息
|
| | |
|
| | | public HA307_tagMCFairyAdventuresInfo () {
|
| | | _cmd = (ushort)0xA307;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out Cnt, vBytes, NetDataType.BYTE);
|
| | | InfoList = new tagMCFairyAdventuresData[Cnt];
|
| | | for (int i = 0; i < Cnt; i ++) {
|
| | | InfoList[i] = new tagMCFairyAdventuresData();
|
| | | TransBytes (out InfoList[i].EventID, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out InfoList[i].Gear, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out InfoList[i].Condition, vBytes, NetDataType.DWORD);
|
| | | }
|
| | | }
|
| | |
|
| | | public struct tagMCFairyAdventuresData {
|
| | | public byte EventID;
|
| | | public byte Gear; //第几档
|
| | | public uint Condition; //条件
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 299918965692bc94e99b397fd4d3c61c |
| | | timeCreated: 1554788525 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | ActionInfo[i] = new tagMCDailyActionInfo();
|
| | | TransBytes(out ActionInfo[i].ActionID, vBytes, NetDataType.DWORD);
|
| | | TransBytes(out ActionInfo[i].DayFinishCnt, vBytes, NetDataType.WORD);
|
| | | TransBytes(out ActionInfo[i].DayBuyTimes, vBytes, NetDataType.BYTE);
|
| | | TransBytes(out ActionInfo[i].DayItemTimes, vBytes, NetDataType.BYTE);
|
| | | TransBytes(out ActionInfo[i].WeekFinishCnt, vBytes, NetDataType.DWORD);
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | public uint ActionID; // ID
|
| | | public ushort DayFinishCnt; // 今日已完成次数
|
| | | public byte DayBuyTimes; //今日购买次数
|
| | | public byte DayItemTimes; //今日物品增加次数
|
| | | public uint WeekFinishCnt; // 本周已完成次数
|
| | | }
|
| | |
|
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // B2 14 自定义副本奖励信息 #tagMCCuntomFBPrizeInfo
|
| | |
|
| | | public class HB214_tagMCCuntomFBPrizeInfo : GameNetPackBasic {
|
| | | public uint MapID;
|
| | | public ushort FuncLineID;
|
| | | public byte PrizeItemCount;
|
| | | public uint[] PrizeItemIDList;
|
| | |
|
| | | public HB214_tagMCCuntomFBPrizeInfo () {
|
| | | _cmd = (ushort)0xB214;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out MapID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out FuncLineID, vBytes, NetDataType.WORD);
|
| | | TransBytes (out PrizeItemCount, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out PrizeItemIDList, vBytes, NetDataType.DWORD, PrizeItemCount);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 3c219ea0ad3685b4ea775c880d73e715 |
| | | timeCreated: 1555060501 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | public const string SoTreasureMeridian_Suffix = "SoTreasureMeridian_"; |
| | | public const string SoTreasure3D_Suffix = "SoTreasure3D_"; |
| | | public const string SoDemonDungeon_Suffix = "SoDemonDungeon_"; |
| | | public const string SoHazyMapNpc_Suffix = "SoHazyMapNpc_"; |
| | | |
| | | public static SoMap LoadSoMapObjectGenerate(int mapID) |
| | | { |
| | |
| | | |
| | | return config; |
| | | } |
| | | |
| | | public static HazyMapNpcScriptableObject LoadSoHazyMapNpc(int _mapId)
|
| | | {
|
| | | HazyMapNpcScriptableObject config = null; |
| | | if (AssetSource.refdataFromEditor) |
| | | { |
| | | #if UNITY_EDITOR |
| | | var resourcePath = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath, |
| | | "Refdata/ScriptableObject/SoHazyMapNpc/", |
| | | SoHazyMapNpc_Suffix, |
| | | _mapId, |
| | | ".asset"); |
| | | |
| | | config = AssetDatabase.LoadAssetAtPath<HazyMapNpcScriptableObject>(resourcePath); |
| | | #endif |
| | | } |
| | | else |
| | | { |
| | | var assetName = StringUtility.Contact(SoHazyMapNpc_Suffix, _mapId); |
| | | var assetInfo = new AssetInfo(bundleName, assetName); |
| | | config = AssetBundleUtility.Instance.Sync_LoadAsset(assetInfo) as HazyMapNpcScriptableObject; |
| | | } |
| | | |
| | | if (config == null) |
| | | { |
| | | } |
| | | |
| | | return config;
|
| | | } |
| | | } |
| | |
| | | CB405_tagCMSuperAtk _b405 = null;
|
| | | if (!ClientDungeonStageUtility.isClientDungeon
|
| | | && !ClientSceneManager.Instance.IsClientFightMode
|
| | | && !AdventureStage.Instance.IsInAdventureStage
|
| | | #if UNITY_EDITOR
|
| | | && !RuntimeLogUtility.TEST_CLIENT_PVP
|
| | | #endif
|
| | |
| | | {
|
| | | // 处理封魔坛英雄伤害
|
| | | FakeDemonJarDungeonStage _dungeon = StageLoad.Instance.currentStage as FakeDemonJarDungeonStage;
|
| | | ClientHazyDemonKingStage _clientHazyDemonStage = StageLoad.Instance.currentStage as ClientHazyDemonKingStage;
|
| | | if (_dungeon != null)
|
| | | {
|
| | | if (attacker.ServerInstID == PlayerDatas.Instance.PlayerId)
|
| | |
| | | _dungeon.AddHeroHurt(hurtValue);
|
| | | }
|
| | | }
|
| | | else if (_clientHazyDemonStage != null)
|
| | | {
|
| | |
|
| | | }
|
| | | else
|
| | | {
|
| | | if (attacker is GA_NpcClientFightNorm)
|
| | |
| | | || userSID != PlayerDatas.Instance.PlayerId
|
| | | || ClientDungeonStageUtility.isClientDungeon
|
| | | || ClientSceneManager.Instance.IsClientFightMode
|
| | | || AdventureStage.Instance.IsInAdventureStage
|
| | | #if UNITY_EDITOR
|
| | | || RuntimeLogUtility.TEST_CLIENT_PVP
|
| | | #endif
|
| | |
| | | {
|
| | | // Debug.LogFormat("{0} attack {1} ==================== 0", attacker.GetType().ToString(), target.GetType().ToString());
|
| | | if (!PreFightMission.Instance.IsFinished()
|
| | | || ClientSceneManager.Instance.IsClientFightMode)
|
| | | || ClientSceneManager.Instance.IsClientFightMode
|
| | | || AdventureStage.Instance.IsInAdventureStage)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | {
|
| | | if (!ClientDungeonStageUtility.isClientDungeon
|
| | | && !ClientSceneManager.Instance.IsClientFightMode
|
| | | && !AdventureStage.Instance.IsInAdventureStage
|
| | | #if UNITY_EDITOR
|
| | | && !RuntimeLogUtility.TEST_CLIENT_PVP
|
| | | #endif
|
| | |
| | | public static event UnityAction<int> OnGainStatus;
|
| | | public static event UnityAction<float> OnGainCantCastSkillStatus;
|
| | | public static event UnityAction OnReleaseCantCastSkillStatus;
|
| | | public static event UnityAction<int> onReceiveStatus;
|
| | |
|
| | | private Dictionary<uint, List<Status_Base>> m_StatusDict = null;
|
| | | private List<Status_Base> m_AllStatus = null;
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (onReceiveStatus != null)
|
| | | {
|
| | | onReceiveStatus(h0605.SkillID);
|
| | | }
|
| | | }
|
| | |
|
| | | public bool CanCastSkill(uint sid)
|
| | |
| | |
|
| | | using System;
|
| | | using UnityEngine;
|
| | |
|
| | | public abstract class Status_Base : IStatus
|
| | |
| | |
|
| | | private SFXController m_Effect;
|
| | |
|
| | | public DateTime receiveTime { get; private set; }
|
| | |
|
| | | public virtual void Init(H0605_tagObjAddBuff data)
|
| | | {
|
| | | h0605 = data;
|
| | |
|
| | | receiveTime = TimeUtility.ServerNow;
|
| | |
|
| | | m_SkillConfig = SkillConfig.Get(data.SkillID);
|
| | |
|
| | | if (m_SkillConfig == null)
|
| | |
| | |
|
| | | //s_LastStatus = moveOrStop;
|
| | |
|
| | | if (!PreFightMission.Instance.IsFinished())
|
| | | if (!PreFightMission.Instance.IsFinished()
|
| | | || AdventureStage.Instance.IsInAdventureStage)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | else if (AdventureStage.Instance.IsInAdventureStage)
|
| | | {
|
| | | NPCInteractProcessor.InvokeEvent(E_NpcType.Func, NpcConfig.NPCID, ServerInstID);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | var _curStage = StageLoad.Instance.currentStage as DungeonStage;
|
| | |
|
| | | if (AdventureStage.Instance.IsInAdventureStage)
|
| | | {
|
| | | GActor _actor = GAMgr.Instance.GetCloserNPC(_hero.Pos, NpcID);
|
| | | if (_actor != null)
|
| | | {
|
| | | MoveToExistNpc(NpcID, _actor);
|
| | | yield break;
|
| | | }
|
| | | }
|
| | |
|
| | | // 判断是否能够得到到达指定点
|
| | | // 获取NPC位置数据
|
| | | GAStaticDefine.NPCLocation _npcLocation;
|
| New file |
| | |
| | | using System.Collections; |
| | | using Snxxz.UI; |
| | | using UnityEngine.SceneManagement; |
| | | using UnityEngine; |
| | | using System;
|
| | |
|
| | | public class AdventureStage : Singleton<AdventureStage> |
| | | { |
| | | public bool IsInAdventureStage { get; private set; } |
| | | |
| | | private Vector3 m_CacheHeroPos; |
| | | private GA_NpcClientFunc m_Npc; |
| | | |
| | | public event Action onLoadAdventureStage; |
| | | public event Action onExitAdventureStage; |
| | | |
| | | HazyRegionModel hazyRegionModel { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } } |
| | | |
| | | public void Enter() |
| | | { |
| | | IsInAdventureStage = true; |
| | | m_CacheHeroPos = PlayerDatas.Instance.hero.Pos; |
| | | SnxxzGame.Instance.StartCoroutine(_Enter()); |
| | | } |
| | | |
| | | public void Exit() |
| | | { |
| | | IsInAdventureStage = false; |
| | | SnxxzGame.Instance.StartCoroutine(_Exit()); |
| | | } |
| | | |
| | | private IEnumerator _Enter() |
| | | { |
| | | WindowCenter.Instance.Open<LoadingWin>(); |
| | | if (!AssetSource.sceneFromEditor) |
| | | { |
| | | AssetBundleUtility.Instance.Sync_LoadAll("maps/map000_xsdt"); |
| | | } |
| | | var _async = SceneManager.LoadSceneAsync("Map000_Xsdt", LoadSceneMode.Additive); |
| | | yield return _async; |
| | | var _hero = PlayerDatas.Instance.hero; |
| | | if (_hero != null) |
| | | { |
| | | _hero.Pos = new Vector3(188.49f, 62.512f, 23.85f); |
| | | } |
| | | CameraController.Instance.Apply(); |
| | | yield return null; |
| | | WindowCenter.Instance.Close<LoadingWin>(); |
| | | m_Npc = GAMgr.Instance.ReqClntNoFightNpc<GA_NpcClientFunc>((uint)hazyRegionModel.GetAdventureNpcId(), E_ActorGroup.FuncNpc); |
| | | m_Npc.Pos = new Vector3(189.101f, 62.47324f, 26.147f); |
| | | NPCInteractProcessor.s_NpcInteractEvent -= OnNpcTalkEvent; |
| | | NPCInteractProcessor.s_NpcInteractEvent += OnNpcTalkEvent; |
| | | |
| | | if (onLoadAdventureStage != null)
|
| | | {
|
| | | onLoadAdventureStage();
|
| | | } |
| | | } |
| | | |
| | | private IEnumerator _Exit() |
| | | { |
| | | NPCInteractProcessor.s_NpcInteractEvent -= OnNpcTalkEvent; |
| | | GAMgr.Instance.ServerDie(m_Npc.ServerInstID); |
| | | GAMgr.Instance.Release(m_Npc); |
| | | |
| | | WindowCenter.Instance.Open<LoadingWin>();
|
| | | WindowCenter.Instance.Close<MainInterfaceWin>(); |
| | | var _async = SceneManager.UnloadSceneAsync("Map000_Xsdt"); |
| | | yield return _async; |
| | | if (!AssetSource.sceneFromEditor) |
| | | { |
| | | AssetBundleUtility.Instance.UnloadAssetBundle("maps/map000_xsdt", true, false); |
| | | } |
| | | var _hero = PlayerDatas.Instance.hero; |
| | | if (_hero != null) |
| | | { |
| | | _hero.Pos = m_CacheHeroPos; |
| | | } |
| | | CameraController.Instance.Apply(); |
| | | yield return null;
|
| | | WindowCenter.Instance.Open<MainInterfaceWin>(); |
| | | WindowCenter.Instance.Close<LoadingWin>();
|
| | | |
| | | if (onExitAdventureStage != null)
|
| | | {
|
| | | onExitAdventureStage();
|
| | | } |
| | | } |
| | | |
| | | private void OnNpcTalkEvent(E_NpcType type, int npcid, uint sid) |
| | | { |
| | | if (E_NpcType.Func == type) |
| | | { |
| | | if (m_Npc != null) |
| | | { |
| | | if (m_Npc.NpcConfig.NPCID == npcid |
| | | && m_Npc.ServerInstID == sid) |
| | | { |
| | | if (!WindowCenter.Instance.IsOpen<HazyRegionDialogueWin>())
|
| | | {
|
| | | hazyRegionModel.StartAdventureDialogue(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 7fb6ffd2c7112ef42bc89374308b6762 |
| | | timeCreated: 1554777545 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using System.Collections; |
| | | using System;
|
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | |
| | | |
| | | public static bool isClientDungeon { get; private set; } |
| | | public static ushort clientMapId { get; private set; } |
| | | |
| | | public static event Action<HB214_tagMCCuntomFBPrizeInfo> onReceiveCustomDropItme; |
| | | |
| | | public static void Init() |
| | | { |
| | |
| | | clientMapId = mapId; |
| | | } |
| | | |
| | | public static void RequestClientDropItem(int mapId, int lineId)//模拟的真实地图id以及线路id
|
| | | {
|
| | | var pak = new CB108_tagCMRefreshCustomFBPrize();
|
| | | pak.MapID = (uint)mapId;
|
| | | pak.FuncLineID = (ushort)lineId;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | |
|
| | | public static void RequestSettleClientDungeon(int mapId, int lineId)
|
| | | {
|
| | | var pak = new CB109_tagCMGiveCustomFBPrize();
|
| | | pak.MapID = (uint)mapId;
|
| | | pak.FuncLineID = (ushort)lineId;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | } |
| | | |
| | | public static void RequestStartClientDungeon(int mapId,int lineId)
|
| | | {
|
| | | var pak = new CA231_tagCMClientStartCustomScene();
|
| | | pak.MapID = (uint)mapId;
|
| | | pak.FuncLineID = (ushort)lineId;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | } |
| | | |
| | | public static void RequestExitClientDungeon()
|
| | | {
|
| | | var pak = new CA233_tagCMClientExitCustomScene();
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | } |
| | | |
| | | public static void ReceiveCustomItems(HB214_tagMCCuntomFBPrizeInfo package)
|
| | | {
|
| | | if (onReceiveCustomDropItme != null)
|
| | | {
|
| | | onReceiveCustomDropItme(package);
|
| | | }
|
| | | } |
| | | |
| | | private static void Reset() |
| | | { |
| | | isClientDungeon = false; |
| | |
| | | case DemonJarModel.DEMONJAR_MAPID:
|
| | | case 31140:
|
| | | case JadeDynastyBossModel.JADEDYNASTY_MAP:
|
| | | case HazyDemonKingModel.Client_MapID:
|
| | | WindowCenter.Instance.Open<DungeonPickUpItemCoolDownWin>();
|
| | | break;
|
| | | case FairyLeagueModel.FAIRY_LEAGUE_DUNGEON:
|
| | |
| | | WindowCenter.Instance.Open<DungeonStageTimeWin>();
|
| | | break;
|
| | | }
|
| | |
|
| | | if (ModelCenter.Instance.GetModel<HazyDemonKingModel>().IsInDungeon)
|
| | | {
|
| | | WindowCenter.Instance.Open<HazyDemonKingDungeonWin>();
|
| | | }
|
| | |
|
| | | if (ModelCenter.Instance.GetModel<HazyGrassModel>().IsInDungeon)
|
| | | {
|
| | | WindowCenter.Instance.Open<HazyGrassDungeonWin>();
|
| | | }
|
| | |
|
| | | // 等待处理开启自动战斗
|
| | | DungeonModel _dungeonModel = ModelCenter.Instance.GetModel<DungeonModel>();
|
| | | if (PlayerDatas.Instance.baseData.MapID == 52020
|
| | |
| | | break; |
| | | case DemonJarModel.DEMONJAR_SINGLEMAPID: |
| | | stage = stageGameObject.AddComponent<FakeDemonJarDungeonStage>(); |
| | | break;
|
| | | case HazyDemonKingModel.Client_MapID:
|
| | | stage = stageGameObject.AddComponent<ClientHazyDemonKingStage>(); |
| | | break;
|
| | | case HazyGrassModel.Client_FairyGrassMapID:
|
| | | case HazyGrassModel.Client_ReikiGrassMapID:
|
| | | stage = stageGameObject.AddComponent<ClientHazyGrassStage>(); |
| | | break; |
| | | default: |
| | | stage = stageGameObject.AddComponent<DungeonStage>(); |
| | |
| | | PlayerDatas.Instance.fairyData.OnRefreshFairyBoss += CheckActivity;
|
| | | StageLoad.Instance.onStageLoadFinish += OnStageLoadFinish;
|
| | | NewBieCenter.Instance.guideCompletedEvent += GuideCompletedEvent;
|
| | | AdventureStage.Instance.onLoadAdventureStage += OnLoadAdventureStageFinish;
|
| | |
|
| | | var _funcCfg = FuncConfigConfig.Get("SpecialActivitys");
|
| | | var _json = LitJson.JsonMapper.ToObject(_funcCfg.Numerical1);
|
| | |
| | | fairyLeagueModel.onFairyLeagueBattleEvent -= CheckActivity;
|
| | | fairyLeagueModel.OnRefreshFairyLeagueEvent -= CheckActivity;
|
| | | PlayerDatas.Instance.fairyData.OnRefreshFairyBoss -= CheckActivity;
|
| | | AdventureStage.Instance.onLoadAdventureStage -= OnLoadAdventureStageFinish;
|
| | | }
|
| | |
|
| | | IEnumerator Co_GuideComplete()
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void OnLoadAdventureStageFinish()
|
| | | {
|
| | | if (AdventureStage.Instance.IsInAdventureStage)
|
| | | {
|
| | | mainStage = false;
|
| | | activityNotifies.Clear();
|
| | | if (WindowCenter.Instance.IsOpen<ActivityNotifyWin>())
|
| | | {
|
| | | WindowCenter.Instance.Close<ActivityNotifyWin>();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | IEnumerator Co_StageLoad()
|
| | | {
|
| | | yield return null;
|
| | |
| | |
|
| | | private void CheckActivity()
|
| | | {
|
| | | if (!mainStage || !(StageLoad.Instance.currentStage is DungeonStage))
|
| | | if (!mainStage || !(StageLoad.Instance.currentStage is DungeonStage)
|
| | | || AdventureStage.Instance.IsInAdventureStage)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | [SerializeField] Button closeBtn;
|
| | | [SerializeField] FunctionButton arenaFunc;
|
| | | [SerializeField] FunctionButton bossFunc;
|
| | | [SerializeField] FunctionButton m_HazyRegion;
|
| | | [SerializeField] FunctionButtonGroup funcGroup;
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | |
| | | rightBtn.AddListener(ClickRight);
|
| | | arenaFunc.AddListener(ClickArenaFunc);
|
| | | bossFunc.AddListener(ClickBossFunc);
|
| | | m_HazyRegion.AddListener(OpenHazyRegion);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | |
| | | {
|
| | | CloseSubWindows();
|
| | | WindowCenter.Instance.Open<CrossServerBossWin>();
|
| | | functionOrder = bossFunc.order;
|
| | | }
|
| | |
|
| | | private void ClickArenaFunc()
|
| | | {
|
| | | CloseSubWindows();
|
| | | WindowCenter.Instance.Open<CrossServerOneVsOneWin>();
|
| | | functionOrder = arenaFunc.order;
|
| | | }
|
| | |
|
| | | private void OpenHazyRegion()
|
| | | {
|
| | | CloseSubWindows();
|
| | | WindowCenter.Instance.Open<HazyRegionWin>();
|
| | | functionOrder = m_HazyRegion.order;
|
| | | }
|
| | |
|
| | | private void ClickRight()
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public struct DailyQuestTimes
|
| | | {
|
| | | public int completeTimes;
|
| | | public int dayBuyTimes;
|
| | | public int dayUseItemTimes;
|
| | | }
|
| | |
|
| | | public class DailyQuestOpenTime
|
| | | {
|
| | | public int id;
|
| | |
| | | Dictionary<int, int> dungeonToDailyQuestTable = new Dictionary<int, int>();
|
| | | Dictionary<int, int> dailyActionToDailyQuestTable = new Dictionary<int, int>();
|
| | | List<DailyQuestActiveValueReward> dailyQuestActiveValueRewards = new List<DailyQuestActiveValueReward>();
|
| | | Dictionary<int, int> dailyQuestCompletedTimes = new Dictionary<int, int>();//除了副本的其他任务放在这里
|
| | | Dictionary<int, DailyQuestTimes> dailyQuestTimes = new Dictionary<int, DailyQuestTimes>();//除了副本的其他任务放在这里
|
| | | Dictionary<int, DailyQuestOpenTime> dailyQuestOpenTimes = new Dictionary<int, DailyQuestOpenTime>();
|
| | | Dictionary<int, Dictionary<int, List<int>>> questCalendar = new Dictionary<int, Dictionary<int, List<int>>>();
|
| | |
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | public bool TryGetDailyQuestTimes(int _id, out DailyQuestTimes _dailyQuestTime)
|
| | | {
|
| | | _dailyQuestTime = default(DailyQuestTimes);
|
| | | var config = DailyQuestConfig.Get(_id);
|
| | | if (config != null && config.RelatedType == 1)
|
| | | {
|
| | | return dailyQuestTimes.TryGetValue(config.RelatedID, out _dailyQuestTime);
|
| | | }
|
| | | else
|
| | | {
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | | public bool IsDailyQuestUnLock(int _dailyQuestId)
|
| | | {
|
| | | var config = DailyQuestConfig.Get(_dailyQuestId);
|
| | |
| | | {
|
| | | case 11:
|
| | | return Math.Max(dailyQuestOpenTime.DayTimes, GetDailyQuestCompletedTimes(_dailyQuestId));
|
| | | case 25:
|
| | | if (dailyQuestTimes.ContainsKey(config.RelatedID))
|
| | | {
|
| | | return dailyQuestOpenTime.DayTimes + dailyQuestTimes[config.RelatedID].dayBuyTimes
|
| | | + dailyQuestTimes[config.RelatedID].dayUseItemTimes;
|
| | | }
|
| | | else
|
| | | {
|
| | | return dailyQuestOpenTime.DayTimes;
|
| | | }
|
| | | default:
|
| | | return dailyQuestOpenTime.DayReKind > 0 ? dailyQuestOpenTime.DayTimes : dailyQuestOpenTime.WeekTimes;
|
| | | }
|
| | |
| | | switch (config.RelatedType)
|
| | | {
|
| | | case 1:
|
| | | if (dailyQuestCompletedTimes.ContainsKey(config.RelatedID))
|
| | | if (dailyQuestTimes.ContainsKey(config.RelatedID))
|
| | | {
|
| | | return dailyQuestCompletedTimes[config.RelatedID];
|
| | | return dailyQuestTimes[config.RelatedID].completeTimes;
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | |
|
| | | public int GetDailyQuestCompletedNums(int relatedID)
|
| | | {
|
| | | if (dailyQuestCompletedTimes.ContainsKey(relatedID))
|
| | | if (dailyQuestTimes.ContainsKey(relatedID))
|
| | | {
|
| | | return dailyQuestCompletedTimes[relatedID];
|
| | | return dailyQuestTimes[relatedID].completeTimes;
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | var dailyAction = _serverInfo.ActionInfo[i];
|
| | | if (dailyAction.DayFinishCnt > 0)
|
| | | {
|
| | | dailyQuestCompletedTimes[(int)dailyAction.ActionID] = dailyAction.DayFinishCnt;
|
| | | dailyQuestTimes[(int)dailyAction.ActionID] = new DailyQuestTimes()
|
| | | {
|
| | | completeTimes = dailyAction.DayFinishCnt,
|
| | | dayBuyTimes = dailyAction.DayBuyTimes,
|
| | | dayUseItemTimes = dailyAction.DayItemTimes,
|
| | | };
|
| | | }
|
| | | else
|
| | | {
|
| | | dailyQuestCompletedTimes[(int)dailyAction.ActionID] = (int)dailyAction.WeekFinishCnt;
|
| | | dailyQuestTimes[(int)dailyAction.ActionID] = new DailyQuestTimes()
|
| | | {
|
| | | completeTimes = (int)dailyAction.WeekFinishCnt,
|
| | | };
|
| | | }
|
| | |
|
| | | if (dailyActionToDailyQuestTable.ContainsKey((int)dailyAction.ActionID))
|
| | |
| | | switch (config.RelatedID)
|
| | | {
|
| | | case 11:
|
| | | var dailyQuestOpenTime = DailyQuestOpenTimeConfig.Get(config.RelatedID);
|
| | | if (completedTimes >= dailyQuestOpenTime.DayTimes + GeneralDefine.runeTowerSweepBuyTimes)
|
| | | {
|
| | | return DailyQuestState.Completed;
|
| | | }
|
| | | else
|
| | | {
|
| | | return DailyQuestState.CanBuyTimes;
|
| | | var dailyQuestOpenTime = DailyQuestOpenTimeConfig.Get(config.RelatedID);
|
| | | if (completedTimes >= dailyQuestOpenTime.DayTimes + GeneralDefine.runeTowerSweepBuyTimes)
|
| | | {
|
| | | return DailyQuestState.Completed;
|
| | | }
|
| | | else
|
| | | {
|
| | | return DailyQuestState.CanBuyTimes;
|
| | | }
|
| | | }
|
| | | case 19:
|
| | | return DailyQuestState.Normal;
|
| | | case 25:
|
| | | {
|
| | | var dailyQuestOpenTime = DailyQuestOpenTimeConfig.Get(config.RelatedID);
|
| | | if (completedTimes >= dailyQuestOpenTime.DayTimes +
|
| | | dailyQuestOpenTime.DayBuyTimes + dailyQuestOpenTime.DayItemAddTimes)
|
| | | {
|
| | | return DailyQuestState.Completed;
|
| | | }
|
| | | else
|
| | | {
|
| | | return DailyQuestState.CanBuyTimes;
|
| | | }
|
| | | }
|
| | | default:
|
| | | return DailyQuestState.Completed;
|
| | | }
|
| | |
| | | WindowCenter.Instance.Close<DailyQuestWin>();
|
| | | WindowCenter.Instance.Open<LootPreciousFrameWin>(false, 1);
|
| | | break;
|
| | | case DailyQuestType.HazyRegion:
|
| | | WindowCenter.Instance.Close<DailyQuestWin>();
|
| | | WindowCenter.Instance.Open<CrossServerWin>(false, 2);
|
| | | break;
|
| | | default:
|
| | | CSharpCallLua.GotoLuaDailyQuest(_id);
|
| | | break;
|
| | |
| | | public int wheel;
|
| | | public Dictionary<string, AssistPlayer> helpPlayer;
|
| | | public int memberCnt;
|
| | | public uint ownerID;
|
| | | public string ownerName;
|
| | |
|
| | | public long totalExp
|
| | | {
|
| | |
| | | {
|
| | | if (_ok)
|
| | | {
|
| | | if (dataMapId == CrossServerBossModel.DATA_MAPID)
|
| | | switch (dataMapId)
|
| | | {
|
| | | var crossServerBossModel = ModelCenter.Instance.GetModel<CrossServerBossModel>();
|
| | | crossServerBossModel.RequestExit();
|
| | | }
|
| | | else
|
| | | {
|
| | | model.ExitCurrentDungeon();
|
| | | case CrossServerBossModel.DATA_MAPID:
|
| | | var crossServerBossModel = ModelCenter.Instance.GetModel<CrossServerBossModel>();
|
| | | crossServerBossModel.RequestExit();
|
| | | break;
|
| | | case HazyDemonKingModel.Client_MapID:
|
| | | ModelCenter.Instance.GetModel<HazyDemonKingModel>().RequestExitClientDungeon();
|
| | | break;
|
| | | case HazyGrassModel.Client_FairyGrassMapID:
|
| | | case HazyGrassModel.Client_ReikiGrassMapID:
|
| | | ModelCenter.Instance.GetModel<HazyGrassModel>().RequestExitClientDungeon();
|
| | | break;
|
| | | default:
|
| | | model.ExitCurrentDungeon();
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | public event Action<DungeonCoolDownType> dungeonCoolDownEvent;
|
| | | public event Action dungeonBeginCoolDownEndEvent;
|
| | | public event Action updateMissionEvent;
|
| | | public event Action onDungeonResultEvent;
|
| | | public event Action<int> dungeonStageChangeEvent;
|
| | | public event Action getDungeonResultEvent;
|
| | | public event Action dungeonEnterCoolDownUpdate;
|
| | |
| | | WindowCenter.Instance.Open<GatherSoulDungeonHintWin>();
|
| | | }
|
| | | break;
|
| | | case HazyGrassModel.ReikiGrassMapId:
|
| | | case HazyGrassModel.FairyGrassMapId:
|
| | | if (!WindowCenter.Instance.IsOpen<HazyGrassDungeonWin>())
|
| | | {
|
| | | WindowCenter.Instance.Open<HazyGrassDungeonWin>();
|
| | | }
|
| | | break;
|
| | | default:
|
| | | if (GetDungeonHintId(mapId, lineId) != 0)
|
| | | {
|
| | |
| | | public void ProcessResult(string _msg)
|
| | | {
|
| | | m_DungeonResult = LitJson.JsonMapper.ToObject<DungeonResult>(_msg);
|
| | | if (m_DungeonResult.isSweep == 1)
|
| | |
|
| | | if (AdventureStage.Instance.IsInAdventureStage)
|
| | | {
|
| | | WindowCenter.Instance.Open<DungeonAdventureVictoryWin>();
|
| | | }
|
| | | else if (m_DungeonResult.isSweep == 1)
|
| | | {
|
| | | switch (m_DungeonResult.dataMapID)
|
| | | {
|
| | |
| | | case RidingPetBossModel.RIDINGPETBOSS_MAP:
|
| | | WindowCenter.Instance.Open<RidingPetBossVictoryWin>();
|
| | | break;
|
| | | case 22030:
|
| | | case 32030:
|
| | | case HazyDemonKingModel.Client_MapID:
|
| | | WindowCenter.Instance.Open<HazyDemonKingVictoryWin>();
|
| | | break;
|
| | | default:
|
| | | WindowCenter.Instance.Open<DungeonVictoryWin>();
|
| | | break;
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (onDungeonResultEvent != null)
|
| | | {
|
| | | onDungeonResultEvent();
|
| | | }
|
| | | }
|
| | |
|
| | | public int GetDungeonHintId(int _dataMapId, int _lineId)
|
| New file |
| | |
| | | using System;
|
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class DungeonReturnBloodBehaviour : MonoBehaviour
|
| | | {
|
| | | [SerializeField] Button m_ReturnBlood;
|
| | |
|
| | | private void Awake()
|
| | | {
|
| | | m_ReturnBlood.AddListener(OnReturnBlood);
|
| | | }
|
| | |
|
| | | private void OnReturnBlood()
|
| | | {
|
| | |
|
| | | }
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 26e87c51a6c12d44ba94735d7e5bf5a1 |
| | | timeCreated: 1555038168 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | [SerializeField] Text descText; |
| | | [SerializeField] List<Text> m_TargetDescs; |
| | | [SerializeField] List<Text> m_TargetNums; |
| | | private int currentDungeonId=0; |
| | | private int currentDungeonId = 0; |
| | | |
| | | DungeonModel m_Model; |
| | | DungeonModel model { |
| | | get { |
| | | DungeonModel model
|
| | | { |
| | | get
|
| | | { |
| | | return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<DungeonModel>()); |
| | | } |
| | | } |
| | |
| | | var weel = Mathf.Clamp(model.mission.wheel, 1, int.MaxValue) - 1;
|
| | | descText.text = config.Info.Length > weel ? config.Info[weel] : config.Info[0];
|
| | | break;
|
| | | case HazyGrassModel.FairyGrassMapId:
|
| | | case HazyGrassModel.ReikiGrassMapId:
|
| | | break;
|
| | | default:
|
| | | descText.text = config.Info.Length > step ? config.Info[step] : config.Info[0];
|
| | | break;
|
| | | } |
| | | } |
| | | |
| | | private void GetTargetInfo(int _index,string desc,int _targetValue,int _targetStep,int _targetType,int npcId=0) |
| | | private void GetTargetInfo(int _index, string desc, int _targetValue, int _targetStep, int _targetType, int npcId = 0) |
| | | { |
| | | m_TargetDescs[_index].text = desc; |
| | | m_TargetNums[_index].text = string.Empty; |
| | | switch ((DungeonTargetType)_targetType) { |
| | | switch ((DungeonTargetType)_targetType)
|
| | | { |
| | | case DungeonTargetType.NPC: |
| | | int killCnt = 0; |
| | | if (npcId != 0) { |
| | | if (npcId != 0)
|
| | | { |
| | | var npcConfig = NPCConfig.Get(npcId); |
| | | desc = desc.Replace("@NPCName@", npcConfig.charName); |
| | | if (model.mission.npc != null) { |
| | | for (int i = 0; i < model.mission.npc.Length; i++) { |
| | | if (model.mission.npc != null)
|
| | | { |
| | | for (int i = 0; i < model.mission.npc.Length; i++)
|
| | | { |
| | | var npcInfo = model.mission.npc[i]; |
| | | if (npcInfo.NPCID == npcId) { |
| | | if (npcInfo.NPCID == npcId)
|
| | | { |
| | | killCnt = npcInfo.killCnt; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (_targetValue > 0) { |
| | | m_TargetNums[_index].text= StringUtility.Contact(killCnt, "/", _targetValue); |
| | | if (_targetValue > 0)
|
| | | { |
| | | m_TargetNums[_index].text = StringUtility.Contact(killCnt, "/", _targetValue); |
| | | break; |
| | | } |
| | | m_TargetNums[_index].text = killCnt.ToString(); |
| | | break; |
| | | case DungeonTargetType.Exp: |
| | | if (_targetValue > 0) { |
| | | m_TargetNums[_index].text=StringUtility.Contact(UIHelper.ReplaceLargeNum((ulong)model.mission.totalExp), "/", UIHelper.ReplaceLargeNum((ulong)_targetValue)); |
| | | if (_targetValue > 0)
|
| | | { |
| | | m_TargetNums[_index].text = StringUtility.Contact(UIHelper.ReplaceLargeNum((ulong)model.mission.totalExp), "/", UIHelper.ReplaceLargeNum((ulong)_targetValue)); |
| | | break; |
| | | } |
| | | m_TargetNums[_index].text = StringUtility.Contact(UIHelper.ReplaceLargeNum((ulong)model.mission.totalExp), |
| | | model.mission.isFullExp == 1 ? StringUtility.Contact(" ", Language.Get("FullExp")) : string.Empty); |
| | | break; |
| | | case DungeonTargetType.Score: |
| | | if (_targetValue > 0) { |
| | | m_TargetNums[_index].text= StringUtility.Contact(model.mission.score, "/", _targetValue); |
| | | if (_targetValue > 0)
|
| | | { |
| | | m_TargetNums[_index].text = StringUtility.Contact(model.mission.score, "/", _targetValue); |
| | | break; |
| | | } |
| | | m_TargetNums[_index].text = model.mission.score.ToString(); |
| | | break; |
| | | case DungeonTargetType.Money: |
| | | if (_targetValue > 0) { |
| | | if (_targetValue > 0)
|
| | | { |
| | | m_TargetNums[_index].text = StringUtility.Contact(model.mission.money, "/", _targetValue); |
| | | break; |
| | | } |
| | | m_TargetNums[_index].text = model.mission.money.ToString(); |
| | | break; |
| | | case DungeonTargetType.Wave: |
| | | if (_targetValue > 0) { |
| | | if (_targetValue > 0)
|
| | | { |
| | | m_TargetNums[_index].text = StringUtility.Contact(model.mission.wheel, "/", _targetValue); |
| | | break; |
| | | } |
| | | m_TargetNums[_index].text = model.mission.wheel.ToString(); |
| | | break; |
| | | case DungeonTargetType.NpcTotal: |
| | | if (_targetValue > 0) { |
| | | if (_targetValue > 0)
|
| | | { |
| | | m_TargetNums[_index].text = StringUtility.Contact(model.mission.npcTotal, "/", _targetValue); |
| | | break; |
| | | } |
| | | m_TargetNums[_index].text = model.mission.npcTotal.ToString(); |
| | | break; |
| | | case DungeonTargetType.Stage: |
| | | if (_targetValue > 0) { |
| | | if (_targetValue > 0)
|
| | | { |
| | | m_TargetNums[_index].text = StringUtility.Contact(model.mission.step, "/", _targetValue); |
| | | break; |
| | | } |
| | |
| | | var property = levelUpProperties[star]; |
| | | behaviour.gameObject.SetActive(true); |
| | | behaviour.text = string.Format("【{0}星】{1}", star, PlayerPropertyConfig.GetFullDescription(property)); |
| | | behaviour.color = UIHelper.GetUIColor(nextStar >= star ? TextColType.Green : TextColType.Gray); |
| | | behaviour.color = UIHelper.GetUIColor(currentStar >= star ? TextColType.Green : TextColType.Gray); |
| | | } |
| | | else |
| | | { |
| File was renamed from Core/NetworkPackage/DTCFile/ServerPack/HAF_Merge.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 71e878ac60c49ad4f964dd2dbc725739 |
| | | guid: 3a97466d4874bbc4385441a3ac16b0df |
| | | folderAsset: yes |
| | | timeCreated: 1547643019 |
| | | timeCreated: 1554358777 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| New file |
| | |
| | | using Snxxz.UI;
|
| | | using System;
|
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public class ClientHazyDemonKingStage : DungeonStage
|
| | | {
|
| | | static readonly Vector3 playerBornPosition = new Vector3(10, 6.38f, 6.67f);
|
| | | static readonly Vector3 bossBornPosition = new Vector3(8.35f, 6.37f, 9.7f);
|
| | |
|
| | | static GA_NpcClientFightBoss clientFightBoss = null;
|
| | |
|
| | | float totalTime = 20f;
|
| | | float timer = 0f;
|
| | | DateTime playerAtkTime = DateTime.Now;
|
| | | Clock pickItemClock = null;
|
| | |
|
| | | float stepTimer = 0f;
|
| | |
|
| | | float existTime = 10f;
|
| | |
|
| | | bool pickAllDropItem = false;
|
| | |
|
| | | int itemCount = 0;
|
| | |
|
| | | Step m_Step = Step.Fight;
|
| | | Step step
|
| | | {
|
| | | get { return m_Step; }
|
| | | set
|
| | | {
|
| | | if (m_Step != value)
|
| | | {
|
| | | m_Step = value;
|
| | | switch (m_Step)
|
| | | {
|
| | | case Step.Fight:
|
| | | stepTimer = 0f;
|
| | | break;
|
| | | case Step.PickItem:
|
| | | stepTimer = 5f;
|
| | | break;
|
| | | case Step.Settle:
|
| | | stepTimer = 0f;
|
| | | break;
|
| | | case Step.Exit:
|
| | | stepTimer = 0f;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | HazyDemonKingModel model { get { return ModelCenter.Instance.GetModel<HazyDemonKingModel>(); } }
|
| | | HazyRegionModel hazyRegionModel { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | |
|
| | | public override void Initialize()
|
| | | {
|
| | | base.Initialize();
|
| | |
|
| | | timer = 0f;
|
| | | playerAtkTime = DateTime.MinValue;
|
| | | m_Step = Step.None;
|
| | | pickAllDropItem = false;
|
| | | itemCount = 0;
|
| | |
|
| | | DTC0403_tagPlayerLoginLoadOK.mapInitOkEvent += OnReconnected;
|
| | | AttackHandler.OnAttackTarget += OnPlayerAttack; |
| | | ClientDungeonStageUtility.onReceiveCustomDropItme += OnReceiveCustomDropItme; |
| | | dungeonModel.onDungeonResultEvent += OnDungeonResultEvent; |
| | | ClientDropItemUtility.OnItemPickup += OnItemPickup; |
| | | }
|
| | |
|
| | | protected override void OnStageLoadFinish()
|
| | | {
|
| | | base.OnStageLoadFinish();
|
| | |
|
| | | InitializePlayer();
|
| | | InitializeBoss();
|
| | |
|
| | | step = Step.Fight;
|
| | | }
|
| | |
|
| | | public static uint GetClientBossSid()
|
| | | {
|
| | | if (clientFightBoss != null)
|
| | | {
|
| | | return clientFightBoss.ServerInstID;
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | void InitializePlayer()
|
| | | {
|
| | | var hero = PlayerDatas.Instance.hero;
|
| | | hero.Pos = playerBornPosition;
|
| | | CameraController.Instance.Apply();
|
| | | }
|
| | |
|
| | | void InitializeBoss()
|
| | | {
|
| | | if (clientFightBoss != null)
|
| | | {
|
| | | clientFightBoss.ActorInfo.serverDie = true;
|
| | | GAMgr.Instance.ServerDie(clientFightBoss.ServerInstID);
|
| | | GAMgr.Instance.Release(clientFightBoss);
|
| | | clientFightBoss = null;
|
| | | }
|
| | |
|
| | | var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
|
| | | var npcId = NPCConfig.Get(config.npcId);
|
| | |
|
| | | clientFightBoss = GAMgr.Instance.ReqClntFightNpc<GA_NpcClientFightBoss>((uint)config.npcId, E_ActorGroup.Enemy);
|
| | | clientFightBoss.Pos = bossBornPosition;
|
| | | clientFightBoss.LockTargetSID = PlayerDatas.Instance.PlayerId;
|
| | | }
|
| | |
|
| | | private void OnPlayerAttack(uint _attackerId, uint _victimId, byte _type, uint _damage)
|
| | | {
|
| | | if (clientFightBoss == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (_victimId == clientFightBoss.ServerInstID)
|
| | | {
|
| | | var progress = Mathf.Clamp01(1 - timer / totalTime);
|
| | | var hp = (ulong)(clientFightBoss.ActorInfo.RealMaxHp * progress);
|
| | |
|
| | | TargetBriefInfo.OnRefreshBossLifeBar(_victimId, clientFightBoss.NpcConfig.NPCID,
|
| | | hp, clientFightBoss.ActorInfo.RealMaxHp);
|
| | |
|
| | | playerAtkTime = DateTime.Now;
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnReceiveCustomDropItme(HB214_tagMCCuntomFBPrizeInfo package)
|
| | | {
|
| | | step = Step.PickItem;
|
| | | if (package.PrizeItemCount <= 0)
|
| | | {
|
| | | pickAllDropItem = true;
|
| | | }
|
| | | else
|
| | | {
|
| | | itemCount = package.PrizeItemCount;
|
| | | int[] items = new int[itemCount];
|
| | | for (int i = 0; i < itemCount; i++)
|
| | | {
|
| | | items[i] = (int)package.PrizeItemIDList[i];
|
| | | }
|
| | | ClientDropItemUtility.Instance.Drop(bossBornPosition, items);
|
| | |
|
| | | dungeonModel.UpdateCoolDown(DungeonCoolDownType.PickUpTime, 30 * 1000);
|
| | |
|
| | | if (pickItemClock != null)
|
| | | {
|
| | | Clock.Stop(pickItemClock);
|
| | | pickItemClock = null;
|
| | | }
|
| | | pickItemClock = Clock.AlarmAfter(30, OnPickUpItemLimit);
|
| | | }
|
| | | }
|
| | |
|
| | | void OnPickUpItemLimit()
|
| | | {
|
| | | pickAllDropItem = true;
|
| | | }
|
| | |
|
| | | private void OnItemPickup(int itemId)
|
| | | {
|
| | | itemCount--;
|
| | | if (itemCount == 0)
|
| | | {
|
| | | pickAllDropItem = true;
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnDungeonResultEvent()
|
| | | {
|
| | | step = Step.Settle;
|
| | | dungeonModel.UpdateCoolDown(DungeonCoolDownType.LeaveMap, 10 * 1000);
|
| | | }
|
| | |
|
| | | protected override void OnUpdate()
|
| | | {
|
| | | base.OnUpdate();
|
| | |
|
| | | if (timer < totalTime)
|
| | | {
|
| | | if ((DateTime.Now - playerAtkTime).TotalSeconds < 1f)
|
| | | {
|
| | | timer += Time.deltaTime;
|
| | | if (timer >= totalTime)
|
| | | {
|
| | | OnBossDie();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | switch (step)
|
| | | {
|
| | | case Step.Fight:
|
| | | if (clientFightBoss == null)
|
| | | {
|
| | | stepTimer += Time.deltaTime;
|
| | | if (stepTimer > 5f)
|
| | | {
|
| | | stepTimer = 0f;
|
| | | RequestDropItem();
|
| | | }
|
| | | }
|
| | | break;
|
| | | case Step.PickItem:
|
| | | if (pickAllDropItem)
|
| | | {
|
| | | stepTimer += Time.deltaTime;
|
| | | if (stepTimer >= 5f)
|
| | | {
|
| | | RequestSettle();
|
| | | stepTimer = 0f;
|
| | | }
|
| | | }
|
| | | break;
|
| | | case Step.Settle:
|
| | | stepTimer += Time.deltaTime;
|
| | | if (stepTimer >= existTime)
|
| | | {
|
| | | step = Step.Exit;
|
| | | model.RequestExitClientDungeon();
|
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | void OnBossDie()
|
| | | {
|
| | | if (clientFightBoss != null)
|
| | | {
|
| | | clientFightBoss.ActorInfo.serverDie = true;
|
| | | GAMgr.Instance.ServerDie(clientFightBoss.ServerInstID);
|
| | | clientFightBoss.Die();
|
| | | clientFightBoss = null;
|
| | | }
|
| | |
|
| | | RequestDropItem();
|
| | | }
|
| | |
|
| | | void RequestDropItem()
|
| | | {
|
| | | var incidentId = hazyRegionModel.processingIncidentId;
|
| | | var config = HazyRegionConfig.Get(incidentId);
|
| | | ClientDungeonStageUtility.RequestClientDropItem(config.dungeonId, config.lineId);
|
| | | }
|
| | |
|
| | | void RequestSettle()
|
| | | {
|
| | | var incidentId = hazyRegionModel.processingIncidentId;
|
| | | var config = HazyRegionConfig.Get(incidentId);
|
| | | ClientDungeonStageUtility.RequestSettleClientDungeon(config.dungeonId, config.lineId);
|
| | | }
|
| | |
|
| | | private void OnReconnected()
|
| | | {
|
| | | var incidentId = hazyRegionModel.processingIncidentId;
|
| | | var config = HazyRegionConfig.Get(incidentId);
|
| | | ClientDungeonStageUtility.RequestStartClientDungeon(config.dungeonId, config.lineId);
|
| | | }
|
| | |
|
| | | public override void UnInitialize()
|
| | | {
|
| | | base.UnInitialize();
|
| | |
|
| | | if (clientFightBoss != null)
|
| | | {
|
| | | clientFightBoss.ActorInfo.serverDie = true;
|
| | | GAMgr.Instance.ServerDie(clientFightBoss.ServerInstID);
|
| | | GAMgr.Instance.Release(clientFightBoss);
|
| | | clientFightBoss = null;
|
| | | }
|
| | |
|
| | | if (pickItemClock != null)
|
| | | {
|
| | | Clock.Stop(pickItemClock);
|
| | | pickItemClock = null;
|
| | | }
|
| | |
|
| | | DTC0403_tagPlayerLoginLoadOK.mapInitOkEvent -= OnReconnected;
|
| | | AttackHandler.OnAttackTarget -= OnPlayerAttack;
|
| | | ClientDungeonStageUtility.onReceiveCustomDropItme -= OnReceiveCustomDropItme;
|
| | | dungeonModel.onDungeonResultEvent -= OnDungeonResultEvent;
|
| | | ClientDropItemUtility.OnItemPickup -= OnItemPickup; |
| | | }
|
| | |
|
| | | #if UNITY_EDITOR
|
| | | private void OnGUI()
|
| | | {
|
| | | if (GUILayout.Button("Exit"))
|
| | | {
|
| | | model.RequestExitClientDungeon();
|
| | | }
|
| | | }
|
| | | #endif
|
| | |
|
| | | public enum Step
|
| | | {
|
| | | None,
|
| | | Fight,
|
| | | PickItem,
|
| | | Settle,
|
| | | Exit
|
| | | }
|
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6426fe00cafdfd84cbc249ce70caccc4 |
| | | timeCreated: 1554976847 |
| | | 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; |
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class ClientHazyGrassStage : DungeonStage
|
| | | {
|
| | | static readonly Vector3 PlayerBornPosition = new Vector3(17.25f, 5.12f, 3.70f);
|
| | |
|
| | | static List<HazyMapNpcScriptableObject.NpcInfo> s_NpcInfos = new List<HazyMapNpcScriptableObject.NpcInfo>();
|
| | | static Dictionary<Vector3, GA_NpcClientCollect> s_CollectNpcs = new Dictionary<Vector3, GA_NpcClientCollect>();
|
| | | static Dictionary<uint, Vector3> s_Sid2NpcPos = new Dictionary<uint, Vector3>();
|
| | | static Dictionary<uint, int> s_Sid2NpcIds = new Dictionary<uint, int>();
|
| | |
|
| | | static int grassRefreshCount = 0;
|
| | |
|
| | | bool mapLoadFinish = false;
|
| | |
|
| | | HazyGrassModel model { get { return ModelCenter.Instance.GetModel<HazyGrassModel>(); } }
|
| | |
|
| | | public override void Initialize()
|
| | | {
|
| | | base.Initialize();
|
| | |
|
| | | s_NpcInfos.Clear();
|
| | | s_Sid2NpcIds.Clear();
|
| | | s_Sid2NpcPos.Clear();
|
| | |
|
| | | mapLoadFinish = false;
|
| | |
|
| | | grassRefreshCount = 0;
|
| | |
|
| | | UnloadAllNpc();
|
| | |
|
| | | GA_NpcClientCollect.OnCollectFinished += OnCollectFinished;
|
| | | }
|
| | |
|
| | | protected override void OnStageLoadFinish()
|
| | | {
|
| | | base.OnStageLoadFinish();
|
| | |
|
| | | mapLoadFinish = true;
|
| | | model.RefreshGrassBornTime(TimeUtility.ServerNow);
|
| | |
|
| | | InitialPlayer();
|
| | | InitializeNpc();
|
| | | }
|
| | |
|
| | | protected override void OnUpdate()
|
| | | {
|
| | | base.OnUpdate();
|
| | |
|
| | | if (mapLoadFinish)
|
| | | {
|
| | | var used = Mathf.Max(0, (int)(TimeUtility.ServerNow - model.grassBornTime).TotalSeconds);
|
| | | var count = used / model.grassRefreshSeconds;
|
| | | if (count != grassRefreshCount)
|
| | | {
|
| | | RebornCollectedNpc();
|
| | | grassRefreshCount = count;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public override void UnInitialize()
|
| | | {
|
| | | base.UnInitialize();
|
| | |
|
| | | UnloadAllNpc();
|
| | |
|
| | | GA_NpcClientCollect.OnCollectFinished -= OnCollectFinished;
|
| | | }
|
| | |
|
| | | private void OnCollectFinished(uint _sid)
|
| | | {
|
| | | if (s_Sid2NpcIds.ContainsKey(_sid))
|
| | | {
|
| | | var npcId = s_Sid2NpcIds[_sid];
|
| | | Debug.Log("采集了Npc:--" + npcId);
|
| | | }
|
| | |
|
| | | if (s_Sid2NpcPos.ContainsKey(_sid))
|
| | | {
|
| | | var pos = s_Sid2NpcPos[_sid];
|
| | | if (s_CollectNpcs.ContainsKey(pos))
|
| | | {
|
| | | s_CollectNpcs.Remove(pos);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | void InitializeNpc()
|
| | | {
|
| | | s_NpcInfos.Clear();
|
| | |
|
| | | var config = ScriptableObjectLoader.LoadSoHazyMapNpc(ClientDungeonStageUtility.clientMapId);
|
| | | var npcInfos = config.GetAllNpcInfos();
|
| | | if (npcInfos != null)
|
| | | {
|
| | | s_NpcInfos.AddRange(npcInfos);
|
| | | RebornCollectedNpc();
|
| | | }
|
| | | }
|
| | |
|
| | | void InitialPlayer()
|
| | | {
|
| | | var hero = PlayerDatas.Instance.hero;
|
| | | hero.Pos = PlayerBornPosition;
|
| | | CameraController.Instance.Apply();
|
| | | }
|
| | |
|
| | | void RebornCollectedNpc()
|
| | | {
|
| | | foreach (var npcInfo in s_NpcInfos)
|
| | | {
|
| | | switch (npcInfo.npcType)
|
| | | {
|
| | | case E_NpcType.Collect:
|
| | | GA_NpcClientCollect _npc = null;
|
| | | if (!s_CollectNpcs.TryGetValue(npcInfo.position, out _npc)
|
| | | || _npc == null || _npc.ActorInfo.serverDie)
|
| | | {
|
| | | _npc = GAMgr.Instance.ReqClntNoFightNpc<GA_NpcClientCollect>((uint)npcInfo.npcId,
|
| | | E_ActorGroup.FuncNpc);
|
| | | if (_npc != null)
|
| | | {
|
| | | _npc.Pos = npcInfo.position;
|
| | | s_CollectNpcs[npcInfo.position] = _npc;
|
| | |
|
| | | s_Sid2NpcIds[_npc.ServerInstID] = npcInfo.npcId;
|
| | | s_Sid2NpcPos[_npc.ServerInstID] = npcInfo.position;
|
| | | }
|
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | void UnloadAllNpc()
|
| | | {
|
| | | foreach (var _npc in s_CollectNpcs.Values)
|
| | | {
|
| | | if (_npc != null)
|
| | | {
|
| | | _npc.KillerServerInstID = PlayerDatas.Instance.PlayerId; |
| | | _npc.ActorInfo.serverDie = true; |
| | | GAMgr.Instance.ServerDie(_npc.ServerInstID); |
| | | GAMgr.Instance.Release(_npc);
|
| | | }
|
| | | }
|
| | | s_CollectNpcs.Clear();
|
| | | }
|
| | |
|
| | | #if UNITY_EDITOR
|
| | | private void OnGUI()
|
| | | {
|
| | | if (GUILayout.Button("Exit"))
|
| | | {
|
| | | model.RequestExitClientDungeon();
|
| | | }
|
| | | }
|
| | | #endif
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 19b261054bba1d549bd299402cfb6d5a |
| | | timeCreated: 1555038314 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Tuesday, April 09, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class DungeonAdventureVictoryWin : Window
|
| | | {
|
| | | [SerializeField] Transform m_ContainerPoivt;
|
| | | [SerializeField] DemonJarRewardBehaviour[] m_Items;
|
| | | [SerializeField] Button m_Exit;
|
| | | [SerializeField] Text m_ExitTimer;
|
| | |
|
| | | const float totalTime = 5f;
|
| | | float timer = 0f;
|
| | | float clockTimer = 0f;
|
| | |
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_Exit.AddListener(ExitDungeon);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | m_ContainerPoivt.gameObject.SetActive(false);
|
| | | timer = 0f;
|
| | | clockTimer = 0f;
|
| | | }
|
| | |
|
| | | protected override void OnActived()
|
| | | {
|
| | | base.OnActived();
|
| | | StartCoroutine(Co_DelayDisplay());
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | AdventureStage.Instance.Exit();
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | | #endregion
|
| | |
|
| | | protected override void LateUpdate()
|
| | | {
|
| | | clockTimer += Time.deltaTime;
|
| | | if (clockTimer >= 0.5f)
|
| | | {
|
| | | clockTimer = 0f;
|
| | | var seconds = Mathf.CeilToInt(totalTime - timer);
|
| | | DrawExitTimer(seconds);
|
| | | }
|
| | |
|
| | | timer += Time.deltaTime;
|
| | | if (timer >= totalTime)
|
| | | {
|
| | | Close();
|
| | | }
|
| | | }
|
| | |
|
| | | IEnumerator Co_DelayDisplay()
|
| | | {
|
| | | yield return WaitingForSecondConst.WaitMS500;
|
| | | Display();
|
| | | }
|
| | |
|
| | | void Display()
|
| | | {
|
| | | m_ContainerPoivt.gameObject.SetActive(true);
|
| | | DisplayExit();
|
| | | DisplayItems();
|
| | | }
|
| | |
|
| | | void DisplayExit()
|
| | | {
|
| | | m_Exit.gameObject.SetActive(true);
|
| | | var seconds = Mathf.CeilToInt(totalTime - timer);
|
| | | DrawExitTimer(seconds);
|
| | | }
|
| | |
|
| | | void DrawExitTimer(int seconds)
|
| | | {
|
| | | m_ExitTimer.text = Language.Get("DungeonVictoryWin_Btn_Exit_1", Mathf.Clamp(seconds, 0, int.MaxValue));
|
| | | }
|
| | |
|
| | | void DisplayItems()
|
| | | {
|
| | | var result = dungeonModel.dungeonResult;
|
| | | for (int i = 0; i < m_Items.Length; i++)
|
| | | {
|
| | | if (result.itemInfo != null && i < result.itemInfo.Length)
|
| | | {
|
| | | var serverItem = result.itemInfo[i];
|
| | | m_Items[i].gameObject.SetActive(true);
|
| | | m_Items[i].Display(new Item(serverItem.ItemID, serverItem.Count));
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Items[i].gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void ExitDungeon()
|
| | | {
|
| | | Close();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 116e810bc1fe9954d815c4fd53536e7e |
| | | timeCreated: 1554791976 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Wednesday, April 10, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class HazyAdventureHintWin : Window
|
| | | {
|
| | | [SerializeField] Text m_AdventureName;
|
| | | [SerializeField] Text m_Progress;
|
| | |
|
| | | HazyRegionModel model { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | model.onHazyRegionIncidentRefresh += OnHazyRegionIncidentRefresh;
|
| | |
|
| | | Display();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | model.onHazyRegionIncidentRefresh -= OnHazyRegionIncidentRefresh;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | | #endregion
|
| | |
|
| | | void Display()
|
| | | {
|
| | | var config = AdventureDialogueConfig.Get(model.adventureDialogueId);
|
| | | if (config != null)
|
| | | {
|
| | | var npcConfig = NPCConfig.Get(config.npcId);
|
| | | m_AdventureName.text = string.Format("与{0}对话:", npcConfig.charName);
|
| | | }
|
| | |
|
| | | HazyRegionModel.Incident incident;
|
| | |
|
| | | var completed = false;
|
| | |
|
| | | if (model.TryGetIncident(model.processingIncidentId, out incident))
|
| | | {
|
| | | completed = incident.state == HazyRegionModel.IncidentState.Complete;
|
| | | }
|
| | |
|
| | | m_Progress.text = StringUtility.Contact(completed ? 1 : 0, "/", 1);
|
| | | }
|
| | |
|
| | | private void OnHazyRegionIncidentRefresh()
|
| | | {
|
| | | Display();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1420ea56c96d7a142a0b5037cc30f7cb |
| | | timeCreated: 1554878168 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Wednesday, April 10, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class HazyDemonKingDungeonWin : Window
|
| | | {
|
| | | [SerializeField] CyclicScroll m_CyclicScroll;
|
| | | [SerializeField] Text m_MyAtkTargetName;
|
| | |
|
| | | [SerializeField] Transform m_ContainerInvincibleBuff;
|
| | | [SerializeField] SmoothSlider m_BuffSlider;
|
| | |
|
| | |
|
| | | DateTime invincibleBuffEndTime = DateTime.Now;
|
| | | uint invincibleLastTime = 0;
|
| | |
|
| | | uint myAtkSid = 0;
|
| | |
|
| | | List<uint> playerIds = new List<uint>();
|
| | | List<uint> clonePlayerIds = new List<uint>();
|
| | |
|
| | | HazyDemonKingModel model { get { return ModelCenter.Instance.GetModel<HazyDemonKingModel>(); } }
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | Display();
|
| | |
|
| | | model.onPlayerInfoRefresh += OnPlayerInfoRefresh;
|
| | | StatusMgr.onReceiveStatus += OnReceiveStatus;
|
| | | GlobalTimeEvent.Instance.secondEvent += PerSecond;
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | m_CyclicScroll.Dispose();
|
| | | model.onPlayerInfoRefresh -= OnPlayerInfoRefresh;
|
| | | StatusMgr.onReceiveStatus -= OnReceiveStatus;
|
| | | GlobalTimeEvent.Instance.secondEvent -= PerSecond;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void LateUpdate()
|
| | | {
|
| | | if (TimeUtility.ServerNow < invincibleBuffEndTime)
|
| | | {
|
| | | m_BuffSlider.delay = 0.2f;
|
| | | DisplayInvincibleProgress();
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | void Display()
|
| | | {
|
| | | DisplayPlayers();
|
| | | DisplayMyTargetName();
|
| | | DisplayInvincibleBuff();
|
| | | }
|
| | |
|
| | | void DisplayPlayers()
|
| | | {
|
| | | playerIds.Clear();
|
| | | clonePlayerIds.Clear();
|
| | | playerIds.AddRange(model.GetPlayerIds());
|
| | | playerIds.Sort(Compare);
|
| | | clonePlayerIds.AddRange(playerIds);
|
| | |
|
| | | m_CyclicScroll.Init(playerIds);
|
| | | }
|
| | |
|
| | | void DisplayInvincibleBuff()
|
| | | {
|
| | | var actors = GAMgr.Instance.GetTypeList(E_ActorClassType.NpcFightBoss);
|
| | | bool existInvincibleBuff = false;
|
| | |
|
| | | Status_Base status_Base = null;
|
| | |
|
| | | if (actors != null && actors.Count > 0)
|
| | | {
|
| | | var serverInstId = (actors[0] as GA_NpcFightBoss).ServerInstID;
|
| | | existInvincibleBuff = StatusMgr.Instance.IsExist(serverInstId, model.invincibleBuffId);
|
| | |
|
| | | if (existInvincibleBuff)
|
| | | {
|
| | | status_Base = StatusMgr.Instance.Get(serverInstId, model.invincibleBuffId);
|
| | | }
|
| | | }
|
| | |
|
| | | m_ContainerInvincibleBuff.gameObject.SetActive(existInvincibleBuff);
|
| | |
|
| | | if (existInvincibleBuff && status_Base != null)
|
| | | {
|
| | | invincibleBuffEndTime = status_Base.receiveTime.AddTicks(status_Base.h0605.LastTime * TimeSpan.TicksPerMillisecond);
|
| | | invincibleLastTime = status_Base.h0605.LastTime;
|
| | | }
|
| | | m_BuffSlider.delay = 0f;
|
| | | DisplayInvincibleProgress();
|
| | | }
|
| | |
|
| | | void DisplayInvincibleProgress()
|
| | | {
|
| | | var milliSeconds = Mathf.CeilToInt((float)(invincibleBuffEndTime - TimeUtility.ServerNow).TotalMilliseconds);
|
| | | if (invincibleLastTime == 0)
|
| | | {
|
| | | invincibleLastTime = (uint)milliSeconds;
|
| | | }
|
| | | var progress = Mathf.Clamp01(1 - (float)milliSeconds / invincibleLastTime);
|
| | | m_BuffSlider.value = progress;
|
| | | }
|
| | |
|
| | | private void OnPlayerInfoRefresh()
|
| | | {
|
| | | DisplayPlayers();
|
| | | }
|
| | |
|
| | | private void OnReceiveStatus(int buffId)
|
| | | {
|
| | | if (buffId == model.invincibleBuffId)
|
| | | {
|
| | | DisplayInvincibleBuff();
|
| | | }
|
| | | }
|
| | |
|
| | | private void PerSecond()
|
| | | {
|
| | | if (clonePlayerIds.Count > 0)
|
| | | {
|
| | | clonePlayerIds.Sort(Compare);
|
| | | }
|
| | |
|
| | | if (clonePlayerIds.Count == playerIds.Count)
|
| | | {
|
| | | for (int i = 0; i < clonePlayerIds.Count; i++)
|
| | | {
|
| | | if (clonePlayerIds[i] != playerIds[i])
|
| | | {
|
| | | DisplayPlayers();
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | var _sid = model.GetPlayerAtkTarget(PlayerDatas.Instance.PlayerId);
|
| | | if (_sid != myAtkSid)
|
| | | {
|
| | | DisplayMyTargetName();
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayMyTargetName()
|
| | | {
|
| | | m_MyAtkTargetName.text = string.Empty;
|
| | |
|
| | | myAtkSid = model.GetPlayerAtkTarget(PlayerDatas.Instance.PlayerId);
|
| | | var actor = GAMgr.Instance.GetBySID(myAtkSid);
|
| | |
|
| | | if (actor != null)
|
| | | {
|
| | | if (actor is GA_NpcClientFightBoss)
|
| | | {
|
| | | m_MyAtkTargetName.text = (actor as GA_NpcClientFightBoss).NpcConfig.charName;
|
| | | }
|
| | | else if (actor is GA_NpcFightBoss)
|
| | | {
|
| | | m_MyAtkTargetName.text = (actor as GA_NpcFightBoss).NpcConfig.charName;
|
| | | }
|
| | | else if (actor is GA_Player)
|
| | | {
|
| | | m_MyAtkTargetName.text = UIHelper.ServerStringTrim((actor as GA_Player).ActorInfo.PlayerName);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | int Compare(uint lhs, uint rhs)
|
| | | {
|
| | | var lhs_bossBelong = model.IsExistBelongTo(lhs);
|
| | | var rhs_bossBelong = model.IsExistBelongTo(rhs);
|
| | | if (lhs_bossBelong != rhs_bossBelong)
|
| | | {
|
| | | return -lhs_bossBelong.CompareTo(rhs_bossBelong);
|
| | | }
|
| | | var playerId = PlayerDatas.Instance.baseData.PlayerID;
|
| | | var lhs_atkself = model.GetPlayerAtkTarget(lhs) == playerId;
|
| | | var rhs_atkself = model.GetPlayerAtkTarget(rhs) == playerId;
|
| | | if (lhs_atkself != rhs_atkself)
|
| | | {
|
| | | return -lhs_atkself.CompareTo(rhs_atkself);
|
| | | }
|
| | | return 0;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: d8e0f4c916a141d4a85759d2fce71ed5 |
| | | timeCreated: 1554881621 |
| | | 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; |
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class HazyDemonKingModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | {
|
| | | Dictionary<uint, HazyDemonKingPlayerInfo> m_PlayerInfos = new Dictionary<uint, HazyDemonKingPlayerInfo>();
|
| | |
|
| | | public bool IsInDungeon { get; private set; }
|
| | |
|
| | | public int invincibleBuffId { get; private set; }
|
| | |
|
| | | public const int Client_MapID = 2000;
|
| | |
|
| | | public event Action onPlayerInfoRefresh;
|
| | |
|
| | | HazyRegionModel hazyRegionModel { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | | StageLoad.Instance.onStageLoadFinish += OnStageLoadFinish;
|
| | | GlobalTimeEvent.Instance.secondEvent += PerSecond;
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | m_PlayerInfos.Clear();
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | | {
|
| | | StageLoad.Instance.onStageLoadFinish -= OnStageLoadFinish;
|
| | | GlobalTimeEvent.Instance.secondEvent -= PerSecond;
|
| | | }
|
| | |
|
| | | private void OnStageLoadFinish()
|
| | | {
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | |
|
| | | IsInDungeon = false;
|
| | | if (IsInDemonKingDungeon(mapId))
|
| | | {
|
| | | IsInDungeon = true;
|
| | | RefreshAroundPlayer();
|
| | | }
|
| | | }
|
| | |
|
| | | private void PerSecond()
|
| | | {
|
| | | if (IsInDungeon)
|
| | | {
|
| | | var requireRefreshPlayer = false;
|
| | | var actors = GAMgr.Instance.GetGroupList(E_ActorGroup.Player);
|
| | | if ((actors != null && actors.Count != m_PlayerInfos.Count)
|
| | | || (actors == null && m_PlayerInfos.Count != 0))
|
| | | {
|
| | | requireRefreshPlayer = true;
|
| | | }
|
| | | else if (actors != null)
|
| | | {
|
| | | foreach (var actor in actors)
|
| | | {
|
| | | var player = actor as GA_Player;
|
| | | if (!m_PlayerInfos.ContainsKey(player.ServerInstID))
|
| | | {
|
| | | requireRefreshPlayer = true;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | var playerId = PlayerDatas.Instance.PlayerId;
|
| | | if (IsExistBelongTo(playerId))
|
| | | {
|
| | | if (!m_PlayerInfos.ContainsKey(playerId))
|
| | | {
|
| | | requireRefreshPlayer = true;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (m_PlayerInfos.ContainsKey(playerId))
|
| | | {
|
| | | requireRefreshPlayer = true;
|
| | | }
|
| | | }
|
| | |
|
| | | if (requireRefreshPlayer)
|
| | | {
|
| | | RefreshAroundPlayer();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void RefreshAroundPlayer()
|
| | | {
|
| | | m_PlayerInfos.Clear();
|
| | | var actors = GAMgr.Instance.GetGroupList(E_ActorGroup.Player);
|
| | | if (actors != null)
|
| | | {
|
| | | foreach (var actor in actors)
|
| | | {
|
| | | var player = actor as GA_Player;
|
| | | if (!m_PlayerInfos.ContainsKey(player.ServerInstID))
|
| | | {
|
| | | m_PlayerInfos.Add(player.ServerInstID, new HazyDemonKingPlayerInfo()
|
| | | {
|
| | | job = player.ActorInfo.Job,
|
| | | hp = player.ActorInfo.RealHp,
|
| | | maxHp = player.ActorInfo.RealMaxHp,
|
| | | playerName = UIHelper.ServerStringTrim(player.ActorInfo.PlayerName),
|
| | | });
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | var playerId = PlayerDatas.Instance.PlayerId;
|
| | | if (IsExistBelongTo(playerId))
|
| | | {
|
| | | if (!m_PlayerInfos.ContainsKey(playerId))
|
| | | {
|
| | | var hero = PlayerDatas.Instance.hero;
|
| | | m_PlayerInfos.Add(playerId, new HazyDemonKingPlayerInfo()
|
| | | {
|
| | | job = PlayerDatas.Instance.baseData.Job,
|
| | | hp = hero.ActorInfo.RealHp,
|
| | | maxHp = hero.ActorInfo.RealMaxHp,
|
| | | playerName = PlayerDatas.Instance.baseData.PlayerName,
|
| | | });
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (m_PlayerInfos.ContainsKey(playerId))
|
| | | {
|
| | | m_PlayerInfos.Remove(playerId);
|
| | | }
|
| | | }
|
| | |
|
| | | if (onPlayerInfoRefresh != null)
|
| | | {
|
| | | onPlayerInfoRefresh();
|
| | | }
|
| | | }
|
| | |
|
| | | public bool IsInDemonKingDungeon(int mapId)
|
| | | {
|
| | | if (mapId == Client_MapID)
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
|
| | | var configs = HazyRegionConfig.GetValues();
|
| | | foreach (var config in configs)
|
| | | {
|
| | | if (config.incidentType == (int)HazyRegionIncidentType.Boss
|
| | | && config.dungeonId == mapId)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool TryGetPlayerInfo(uint playerId, out HazyDemonKingPlayerInfo playerInfo)
|
| | | {
|
| | | return m_PlayerInfos.TryGetValue(playerId, out playerInfo);
|
| | | }
|
| | |
|
| | | public ICollection<uint> GetPlayerIds()
|
| | | {
|
| | | return m_PlayerInfos.Keys;
|
| | | }
|
| | |
|
| | | public void SendSelectAtkTarget(uint serverInstId)
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | public uint GetPlayerAtkTarget(uint serverInstId)
|
| | | {
|
| | | if (ClientDungeonStageUtility.clientMapId == Client_MapID)
|
| | | {
|
| | | return ClientHazyDemonKingStage.GetClientBossSid();
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | public bool IsExistBelongTo(uint playerId)
|
| | | {
|
| | | if (playerId == PlayerDatas.Instance.PlayerId
|
| | | && ClientDungeonStageUtility.clientMapId == Client_MapID)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | return StatusMgr.Instance.IsExistBossBelong(playerId);
|
| | | }
|
| | |
|
| | | public void RequestEnterClientDungeon()
|
| | | {
|
| | | var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
|
| | |
|
| | | MapTransferUtility.Instance.Clear();
|
| | | ClientDungeonStageUtility.SetClientDungeon(true, Client_MapID);
|
| | | ClientDungeonStageUtility.RequestStartClientDungeon(config.dungeonId, config.lineId);
|
| | | CrossServerLogin.Instance.SetWaitForLoginCrossServerState(false);
|
| | | StageLoad.Instance.PushSceneLoadCommand(new StageLoad.StageLoadCommand()
|
| | | {
|
| | | toMapId = Client_MapID,
|
| | | toLineId = 0,
|
| | | needEmpty = true,
|
| | | needLoadResource = true,
|
| | | serverType = ServerType.Main,
|
| | | isClientLoadMap = true
|
| | | });
|
| | |
|
| | | PlayerDatas.Instance.baseData.mainServerMapIdRecord = PlayerDatas.Instance.baseData.MapID;
|
| | | PlayerDatas.Instance.baseData.MapID = Client_MapID;
|
| | | var attackMode = new C030A_tagCChangeAttackMode();
|
| | | attackMode.Mode = (byte)E_AttackMode.Peace;
|
| | | GameNetSystem.Instance.PushPackage(attackMode, ServerType.Main);
|
| | | }
|
| | |
|
| | | public void RequestExitClientDungeon()
|
| | | {
|
| | | ClientDungeonStageUtility.SetClientDungeon(false, 0);
|
| | | ClientDungeonStageUtility.RequestExitClientDungeon();
|
| | | PlayerDatas.Instance.extersion.pkState = 0;
|
| | | ModelCenter.Instance.GetModel<DungeonModel>().ResetBufData();
|
| | |
|
| | | PlayerDatas.Instance.baseData.MapID = PlayerDatas.Instance.baseData.mainServerMapIdRecord;
|
| | | StageLoad.Instance.PushSceneLoadCommand(new StageLoad.StageLoadCommand()
|
| | | {
|
| | | toMapId = PlayerDatas.Instance.baseData.MapID,
|
| | | toLineId = 0,
|
| | | needEmpty = true,
|
| | | needLoadResource = true,
|
| | | serverType = ServerType.Main,
|
| | | isClientLoadMap = true
|
| | | });
|
| | | }
|
| | | }
|
| | |
|
| | | public struct HazyDemonKingPlayerInfo
|
| | | {
|
| | | public string playerName;
|
| | | public int job;
|
| | | public ulong hp;
|
| | | public ulong maxHp;
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 8122b2ce152c76143afa0f42beab82ae |
| | | timeCreated: 1554860554 |
| | | 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 HazyDemonKingPlayerBehaviour : ScrollItem
|
| | | {
|
| | | [SerializeField] Transform m_ContainerOwn;
|
| | | [SerializeField] ImageEx m_HeadIcon;
|
| | | [SerializeField] Text m_PlayerName;
|
| | | [SerializeField] SmoothSlider m_HpSlider;
|
| | |
|
| | | [SerializeField] Transform m_ContainerFightState;
|
| | | [SerializeField] Image m_FightSign;
|
| | | [SerializeField] Text m_AtkState;
|
| | | [SerializeField] Button m_SelectAtk;
|
| | |
|
| | | bool dirty = false;
|
| | |
|
| | | bool bossBelongTo = false;
|
| | | int hpPer = 0;
|
| | | int atkState = 0;
|
| | |
|
| | | uint playerId = 0;
|
| | |
|
| | | HazyDemonKingModel model { get { return ModelCenter.Instance.GetModel<HazyDemonKingModel>(); } }
|
| | |
|
| | | public override void Display(object _data)
|
| | | {
|
| | | base.Display(_data);
|
| | |
|
| | | playerId = (uint)_data;
|
| | |
|
| | | dirty = false;
|
| | |
|
| | | Initialized();
|
| | |
|
| | | DisplayBase();
|
| | | DisplayPlayerInfo();
|
| | |
|
| | | GlobalTimeEvent.Instance.secondEvent -= PerSecond;
|
| | | GlobalTimeEvent.Instance.secondEvent += PerSecond;
|
| | |
|
| | | m_SelectAtk.SetListener(SelectAtk);
|
| | | }
|
| | |
|
| | | private void PerSecond()
|
| | | {
|
| | | if (dirty)
|
| | | {
|
| | | DisplayPlayerInfo();
|
| | | dirty = false;
|
| | | }
|
| | | }
|
| | |
|
| | | private void Initialized()
|
| | | {
|
| | | RefreshBossBelongTo();
|
| | |
|
| | | hpPer = 0;
|
| | | GActor actor = GAMgr.Instance.GetBySID(playerId);
|
| | | if (actor != null)
|
| | | {
|
| | | var player = actor as GActorPlayerBase;
|
| | | hpPer = Mathf.CeilToInt((float)player.ActorInfo.RealHp / player.ActorInfo.RealMaxHp * 100f);
|
| | | }
|
| | | else
|
| | | {
|
| | | HazyDemonKingPlayerInfo playerInfo;
|
| | | if (model.TryGetPlayerInfo(playerId, out playerInfo))
|
| | | {
|
| | | hpPer = Mathf.CeilToInt((float)playerInfo.hp / playerInfo.maxHp * 100f);
|
| | | }
|
| | | }
|
| | |
|
| | | RefreshAtkState();
|
| | | }
|
| | |
|
| | | void DisplayBase()
|
| | | {
|
| | | HazyDemonKingPlayerInfo playerInfo;
|
| | | if (model.TryGetPlayerInfo(playerId, out playerInfo))
|
| | | {
|
| | | m_HeadIcon.SetSprite(GeneralDefine.GetOtherJobHeadPortrait(playerInfo.job, 0));
|
| | | m_PlayerName.text = playerInfo.playerName;
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayPlayerInfo()
|
| | | {
|
| | | m_ContainerOwn.gameObject.SetActive(bossBelongTo);
|
| | | m_HeadIcon.gray = hpPer == 0;
|
| | | m_HpSlider.value = hpPer / 100f;
|
| | |
|
| | | m_ContainerFightState.gameObject.SetActive(playerId != PlayerDatas.Instance.PlayerId);
|
| | |
|
| | | if (playerId != PlayerDatas.Instance.PlayerId)
|
| | | {
|
| | | switch (atkState)
|
| | | {
|
| | | case 0:
|
| | | m_FightSign.SetSprite("HazyFightState_Red");
|
| | | m_AtkState.text = "战斗中";
|
| | | m_AtkState.color = UIHelper.GetUIColor(TextColType.Red, true);
|
| | | break;
|
| | | case 1:
|
| | | m_FightSign.SetSprite("HazyFightState_White");
|
| | | m_AtkState.text = "反击";
|
| | | m_AtkState.color = UIHelper.GetUIColor(TextColType.Red, true);
|
| | | break;
|
| | | case 2:
|
| | | m_FightSign.SetSprite("HazyFightState_White");
|
| | | m_AtkState.text = "攻击";
|
| | | m_AtkState.color = UIHelper.GetUIColor(TextColType.NavyBrown, true);
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void SelectAtk()
|
| | | {
|
| | | model.SendSelectAtkTarget(playerId);
|
| | | }
|
| | |
|
| | | void LateUpdate()
|
| | | {
|
| | | if (RefreshBossBelongTo())
|
| | | {
|
| | | dirty = true;
|
| | | }
|
| | |
|
| | | if (RefreshHpPer())
|
| | | {
|
| | | dirty = true;
|
| | | }
|
| | |
|
| | | if (RefreshAtkState())
|
| | | {
|
| | | dirty = true;
|
| | | }
|
| | | }
|
| | |
|
| | | bool RefreshBossBelongTo()
|
| | | {
|
| | | if (bossBelongTo != model.IsExistBelongTo(playerId))
|
| | | {
|
| | | bossBelongTo = model.IsExistBelongTo(playerId);
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | bool RefreshHpPer()
|
| | | {
|
| | | GActor actor = GAMgr.Instance.GetBySID(playerId);
|
| | | if (actor != null)
|
| | | {
|
| | | var player = actor as GActorPlayerBase;
|
| | | var per = Mathf.CeilToInt((float)player.ActorInfo.RealHp / player.ActorInfo.RealMaxHp * 100f);
|
| | | if (hpPer != per)
|
| | | {
|
| | | hpPer = per;
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | bool RefreshAtkState()
|
| | | {
|
| | | var _state = 0;
|
| | | var myPlayerId = PlayerDatas.Instance.baseData.PlayerID;
|
| | | var atkTargetId = model.GetPlayerAtkTarget(playerId);
|
| | | var myAtkTargetId = model.GetPlayerAtkTarget(myPlayerId);
|
| | | if (myAtkTargetId == playerId)
|
| | | {
|
| | | _state = 0;
|
| | | }
|
| | | else if (atkTargetId == myPlayerId)
|
| | | {
|
| | | _state = 1;
|
| | | }
|
| | | else
|
| | | {
|
| | | _state = 2;
|
| | | }
|
| | |
|
| | | if (_state != atkState)
|
| | | {
|
| | | atkState = _state;
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public override void Dispose()
|
| | | {
|
| | | base.Dispose();
|
| | |
|
| | | GlobalTimeEvent.Instance.secondEvent -= PerSecond;
|
| | | }
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6abbedbcf5140d04a986b79c4e3eb7d6 |
| | | timeCreated: 1554882000 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Friday, April 12, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class HazyDemonKingVictoryWin : Window
|
| | | {
|
| | | [SerializeField] Transform m_ContainerPoivt;
|
| | | [SerializeField] Text m_PlayerName;
|
| | | [SerializeField] ScrollRect m_RewardsScroll;
|
| | | [SerializeField] Text m_ExitTimer;
|
| | | [SerializeField] HorizontalLayoutGroup m_RewardLayout;
|
| | | [SerializeField] ButtonEx m_Exit;
|
| | |
|
| | | List<DemonJarRewardBehaviour> m_Items = new List<DemonJarRewardBehaviour>();
|
| | |
|
| | | float timer = 0f;
|
| | |
|
| | | DungeonModel model { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_Exit.AddListener(ExitDungeon);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | timer = 0f;
|
| | | m_ContainerPoivt.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | protected override void OnActived()
|
| | | {
|
| | | base.OnActived();
|
| | | var config = DungeonOpenTimeConfig.Get(PlayerDatas.Instance.baseData.MapID);
|
| | | StartCoroutine(Co_DelayDisplay(config.DelayTime * 0.001f));
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void LateUpdate()
|
| | | {
|
| | | base.LateUpdate();
|
| | |
|
| | | var endTime = model.GetCoolDownEndTime(DungeonCoolDownType.LeaveMap);
|
| | | if (endTime > TimeUtility.ServerNow)
|
| | | {
|
| | | timer -= Time.deltaTime;
|
| | | if (timer < 0f)
|
| | | {
|
| | | timer = 1f;
|
| | | var seconds = (endTime - TimeUtility.ServerNow).TotalSeconds;
|
| | | m_ExitTimer.text = Language.Get("DungeonVictoryWin_Btn_Exit_1", Mathf.Clamp((int)seconds, 0, int.MaxValue));
|
| | | }
|
| | |
|
| | | if (!m_ExitTimer.gameObject.activeInHierarchy)
|
| | | {
|
| | | m_ExitTimer.gameObject.SetActive(true);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (m_ExitTimer.gameObject.activeInHierarchy)
|
| | | {
|
| | | m_ExitTimer.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | IEnumerator Co_DelayDisplay(float _delay)
|
| | | {
|
| | | yield return new WaitForSeconds(_delay);
|
| | |
|
| | | var endTime = model.GetCoolDownEndTime(DungeonCoolDownType.LeaveMap);
|
| | | var seconds = (endTime - TimeUtility.ServerNow).TotalSeconds;
|
| | | timer = 0f;
|
| | | m_ExitTimer.text = Language.Get("DungeonVictoryWin_Btn_Exit_1", Mathf.Clamp((int)seconds, 0, int.MaxValue));
|
| | | m_ExitTimer.gameObject.SetActive(true);
|
| | | m_ContainerPoivt.gameObject.SetActive(true);
|
| | |
|
| | | DisplayRewards();
|
| | | DisplayBelongTo();
|
| | | }
|
| | |
|
| | | private void DisplayRewards()
|
| | | {
|
| | | var serverItems = model.dungeonResult.itemInfo;
|
| | | var items = new List<Item>();
|
| | |
|
| | | var itemCount = 0;
|
| | |
|
| | | if (serverItems != null)
|
| | | {
|
| | | for (int i = 0; i < serverItems.Length; i++)
|
| | | {
|
| | | items.Add(new Item(serverItems[i].ItemID, serverItems[i].Count));
|
| | | }
|
| | |
|
| | | itemCount = serverItems.Length;
|
| | | }
|
| | |
|
| | |
|
| | | GenerateRewardBehaviour(m_RewardsScroll.content, items.Count);
|
| | |
|
| | | if (itemCount < 6)
|
| | | {
|
| | | m_RewardLayout.childAlignment = TextAnchor.MiddleCenter;
|
| | | (m_RewardLayout.transform as RectTransform).pivot = new Vector2(0.5f, 0.5f);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_RewardLayout.childAlignment = TextAnchor.MiddleLeft;
|
| | | (m_RewardLayout.transform as RectTransform).pivot = new Vector2(0, 0.5f);
|
| | | }
|
| | |
|
| | | for (int i = 0; i < m_Items.Count; i++)
|
| | | {
|
| | | var behaviour = m_Items[i];
|
| | | if (i < items.Count)
|
| | | {
|
| | | behaviour.gameObject.SetActive(true);
|
| | | behaviour.Display(items[i]);
|
| | | }
|
| | | else
|
| | | {
|
| | | behaviour.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayBelongTo()
|
| | | {
|
| | | m_PlayerName.text = UIHelper.ServerStringTrim(model.dungeonResult.ownerName);
|
| | | }
|
| | |
|
| | | private void ExitDungeon()
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.MapID == HazyDemonKingModel.Client_MapID)
|
| | | {
|
| | | ModelCenter.Instance.GetModel<HazyDemonKingModel>().RequestExitClientDungeon();
|
| | | }
|
| | | else
|
| | | {
|
| | | model.ExitCurrentDungeon();
|
| | | }
|
| | | }
|
| | |
|
| | | private void GenerateRewardBehaviour(RectTransform _parent, int _needCount)
|
| | | {
|
| | | var nowCount = m_Items.Count;
|
| | | var dif = _needCount - nowCount;
|
| | | if (dif > 0)
|
| | | {
|
| | | for (int i = 0; i < dif; i++)
|
| | | {
|
| | | var instance = UIUtility.CreateWidget("DemonJarRewardBehaviour", "DemonJarRewardBehaviour");
|
| | | var behaviour = instance.GetComponent<DemonJarRewardBehaviour>();
|
| | | m_Items.Add(behaviour);
|
| | | instance.transform.SetParentEx(_parent, Vector3.zero, Vector3.zero, Vector3.one);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 755ec5b8ac83ebe45884700b3ef99683 |
| | | timeCreated: 1555054379 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Monday, April 15, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class HazyGrassDungeonWin : Window
|
| | | {
|
| | | [SerializeField] DungeonTargetBehaviour m_DungeonTarget;
|
| | | [SerializeField] Text m_BasicGrassCount;
|
| | | [SerializeField] Text m_FairyGrassCount;
|
| | | [SerializeField] Text m_BasicGrassRefreshTime;
|
| | | [SerializeField] Text m_FairyGrassRefreshTime;
|
| | |
|
| | | DungeonModel model { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | | HazyRegionModel hazyRegionModel { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
|
| | | HazyGrassModel hazyGrassModel { get { return ModelCenter.Instance.GetModel<HazyGrassModel>(); } }
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | Display();
|
| | |
|
| | | GlobalTimeEvent.Instance.secondEvent += PerSecond;
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | GlobalTimeEvent.Instance.secondEvent -= PerSecond;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | | #endregion
|
| | |
|
| | | private void PerSecond()
|
| | | {
|
| | | DisplayGrassRefreshTime();
|
| | | }
|
| | |
|
| | | void Display()
|
| | | {
|
| | | if (ClientDungeonStageUtility.isClientDungeon)
|
| | | {
|
| | | var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
|
| | | m_DungeonTarget.Init(config.dungeonId);
|
| | | }
|
| | | else
|
| | | {
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | m_DungeonTarget.Init(mapId);
|
| | | }
|
| | |
|
| | | DisplayGrassRefreshTime();
|
| | | }
|
| | |
|
| | | void DisplayGrassCount()
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | void DisplayGrassRefreshTime()
|
| | | {
|
| | | var used = Mathf.Max(0, (int)(TimeUtility.ServerNow - hazyGrassModel.grassBornTime).TotalSeconds);
|
| | | var refreshSeconds = hazyGrassModel.grassRefreshSeconds - used % hazyGrassModel.grassRefreshSeconds;
|
| | | m_BasicGrassRefreshTime.text = string.Format("基础草丛{0}后刷新", TimeUtility.SecondsToMS(refreshSeconds));
|
| | | m_FairyGrassRefreshTime.text = string.Format("灵草丛{0}后刷新", TimeUtility.SecondsToMS(refreshSeconds));
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: b4aee95f31119204f92589ee74cb04e5 |
| | | timeCreated: 1555293316 |
| | | 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; |
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class HazyGrassModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | {
|
| | | public const int ReikiGrassMapId = 32040;
|
| | | public const int FairyGrassMapId = 32050;
|
| | | public const int Client_ReikiGrassMapID = 3240;
|
| | | public const int Client_FairyGrassMapID = 3250;
|
| | |
|
| | | public bool IsInDungeon { get; private set; }
|
| | |
|
| | | public int grassRefreshSeconds { get; private set; }
|
| | |
|
| | | public DateTime grassBornTime { get; private set; }
|
| | |
|
| | | HazyRegionModel hazyRegionModel { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | | ParseConfig();
|
| | |
|
| | | StageLoad.Instance.onStageLoadFinish += OnStageLoadFinish;
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | | {
|
| | | StageLoad.Instance.onStageLoadFinish -= OnStageLoadFinish;
|
| | | }
|
| | |
|
| | | void ParseConfig()
|
| | | {
|
| | | grassRefreshSeconds = 20;
|
| | | }
|
| | |
|
| | | private void OnStageLoadFinish()
|
| | | {
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | |
|
| | | IsInDungeon = false;
|
| | | if (IsInGrassDungeon(mapId))
|
| | | {
|
| | | IsInDungeon = true;
|
| | | }
|
| | | }
|
| | |
|
| | | public bool IsInGrassDungeon(int mapId)
|
| | | {
|
| | | if (mapId == Client_ReikiGrassMapID
|
| | | || mapId == Client_FairyGrassMapID)
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
|
| | | var configs = HazyRegionConfig.GetValues();
|
| | | foreach (var config in configs)
|
| | | {
|
| | | if ((config.incidentType == (int)HazyRegionIncidentType.FairyGrass
|
| | | || config.incidentType == (int)HazyRegionIncidentType.ReikiGrass)
|
| | | && config.dungeonId == mapId)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public int GetClientMapId(int incidentId)
|
| | | {
|
| | | var config = HazyRegionConfig.Get(incidentId);
|
| | | switch ((HazyRegionIncidentType)config.incidentType)
|
| | | {
|
| | | case HazyRegionIncidentType.FairyGrass:
|
| | | return Client_FairyGrassMapID;
|
| | | case HazyRegionIncidentType.ReikiGrass:
|
| | | return Client_ReikiGrassMapID;
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | public void RefreshGrassBornTime()
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | public void RefreshGrassBornTime(DateTime _time)
|
| | | {
|
| | | grassBornTime = _time;
|
| | | }
|
| | |
|
| | | public void RequestEnterClientDungeon()
|
| | | {
|
| | | var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
|
| | |
|
| | | var mapId = GetClientMapId(hazyRegionModel.processingIncidentId);
|
| | |
|
| | | MapTransferUtility.Instance.Clear();
|
| | | ClientDungeonStageUtility.SetClientDungeon(true, (ushort)mapId);
|
| | | ClientDungeonStageUtility.RequestStartClientDungeon(config.dungeonId, config.lineId);
|
| | | CrossServerLogin.Instance.SetWaitForLoginCrossServerState(false);
|
| | | StageLoad.Instance.PushSceneLoadCommand(new StageLoad.StageLoadCommand()
|
| | | {
|
| | | toMapId = mapId,
|
| | | toLineId = 0,
|
| | | needEmpty = true,
|
| | | needLoadResource = true,
|
| | | serverType = ServerType.Main,
|
| | | isClientLoadMap = true
|
| | | });
|
| | |
|
| | | PlayerDatas.Instance.baseData.mainServerMapIdRecord = PlayerDatas.Instance.baseData.MapID;
|
| | | PlayerDatas.Instance.baseData.MapID = (ushort)mapId;
|
| | | var attackMode = new C030A_tagCChangeAttackMode();
|
| | | attackMode.Mode = (byte)E_AttackMode.Peace;
|
| | | GameNetSystem.Instance.PushPackage(attackMode, ServerType.Main);
|
| | | }
|
| | |
|
| | | public void RequestExitClientDungeon()
|
| | | {
|
| | | ClientDungeonStageUtility.SetClientDungeon(false, 0);
|
| | | ClientDungeonStageUtility.RequestExitClientDungeon();
|
| | | PlayerDatas.Instance.extersion.pkState = 0;
|
| | | ModelCenter.Instance.GetModel<DungeonModel>().ResetBufData();
|
| | |
|
| | | PlayerDatas.Instance.baseData.MapID = PlayerDatas.Instance.baseData.mainServerMapIdRecord;
|
| | | StageLoad.Instance.PushSceneLoadCommand(new StageLoad.StageLoadCommand()
|
| | | {
|
| | | toMapId = PlayerDatas.Instance.baseData.MapID,
|
| | | toLineId = 0,
|
| | | needEmpty = true,
|
| | | needLoadResource = true,
|
| | | serverType = ServerType.Main,
|
| | | isClientLoadMap = true
|
| | | });
|
| | | }
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: c0449f2089c64ff4f9b5b0e23a535dd0 |
| | | timeCreated: 1555038542 |
| | | 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 System; |
| | | #if UNITY_EDITOR |
| | | using UnityEditor; |
| | | #endif |
| | | public class HazyMapNpcScriptableObject : ScriptableObject
|
| | | { |
| | | [SerializeField] NpcInfo[] m_MapNpcInfos; |
| | | |
| | | public NpcInfo[] GetAllNpcInfos()
|
| | | {
|
| | | return m_MapNpcInfos;
|
| | | }
|
| | |
|
| | | #if UNITY_EDITOR
|
| | | public void Save(int index, Vector3 position)
|
| | | {
|
| | | if (m_MapNpcInfos != null && index < m_MapNpcInfos.Length)
|
| | | {
|
| | | m_MapNpcInfos[index] = new NpcInfo()
|
| | | {
|
| | | npcId = m_MapNpcInfos[index].npcId,
|
| | | npcType = m_MapNpcInfos[index].npcType,
|
| | | position = position,
|
| | | };
|
| | | }
|
| | | }
|
| | | #endif
|
| | |
|
| | | [Serializable]
|
| | | public struct NpcInfo
|
| | | {
|
| | | public int npcId;
|
| | | public E_NpcType npcType;
|
| | | public Vector3 position;
|
| | | }
|
| | | }
|
| | |
|
| | | #if UNITY_EDITOR
|
| | | [CustomEditor(typeof(HazyMapNpcScriptableObject))]
|
| | | public class HazyMapNpcInspector : Editor
|
| | | {
|
| | | [SerializeField] int index = 0;
|
| | |
|
| | | public override void OnInspectorGUI()
|
| | | {
|
| | | var npcConfig = target as HazyMapNpcScriptableObject;
|
| | |
|
| | | index = EditorGUILayout.IntField("Index", index);
|
| | |
|
| | | var dropRect = GUILayoutUtility.GetRect(0f, 100f, GUILayout.ExpandWidth(true));
|
| | | var style = new GUIStyle(GUI.skin.box);
|
| | | style.normal.textColor = Color.white;
|
| | | style.alignment = TextAnchor.MiddleCenter;
|
| | | GUI.Box(dropRect, "拖动物体至此可赋值位置", style);
|
| | |
|
| | | if (dropRect.Contains(Event.current.mousePosition))
|
| | | {
|
| | | switch (Event.current.type)
|
| | | {
|
| | | case EventType.DragUpdated:
|
| | | DragAndDrop.activeControlID = GUIUtility.GetControlID(FocusType.Passive);
|
| | | DragAndDrop.visualMode = DragAndDropVisualMode.Copy;
|
| | | break;
|
| | | case EventType.DragPerform:
|
| | | DragAndDrop.activeControlID = GUIUtility.GetControlID(FocusType.Passive);
|
| | | DragAndDrop.AcceptDrag();
|
| | | Event.current.Use();
|
| | |
|
| | | if (DragAndDrop.objectReferences != null && DragAndDrop.objectReferences.Length > 0)
|
| | | {
|
| | | var obj = DragAndDrop.objectReferences[0];
|
| | | if(obj is GameObject)
|
| | | {
|
| | | var go = obj as GameObject;
|
| | | npcConfig.Save(index, go.transform.position);
|
| | | }
|
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | base.OnInspectorGUI();
|
| | | }
|
| | |
|
| | | [MenuItem("策划工具/生成缥缈仙域Npc配置")] |
| | | static void Create()
|
| | | {
|
| | | var _config = CreateInstance<HazyMapNpcScriptableObject>();
|
| | | string _path = StringUtility.Contact("Assets/ResourcesOut/Refdata/ScriptableObject/SoHazyMapNpc/",
|
| | | "SoHazyMapNpc_",
|
| | | ".asset");
|
| | | AssetDatabase.CreateAsset(_config, _path);
|
| | | AssetDatabase.Refresh();
|
| | | ProjectWindowUtil.ShowCreatedAsset(_config);
|
| | | }
|
| | | }
|
| | | #endif |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 35925d9830d8dd44a802f58110441d91 |
| | | timeCreated: 1555147634 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Monday, April 08, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class HazyRegionBuyTimesWin : Window
|
| | | {
|
| | | [SerializeField] Text m_BuyTimes;
|
| | | [SerializeField] Text m_Money;
|
| | | [SerializeField] Button m_Buy;
|
| | |
|
| | | [SerializeField] Transform m_ContainerUseItem;
|
| | | [SerializeField] Text m_UseItemTimes;
|
| | | [SerializeField] ItemBehaviour m_Item;
|
| | | [SerializeField] Button m_Use;
|
| | |
|
| | | [SerializeField] Button m_Close;
|
| | |
|
| | | HazyRegionModel model { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
|
| | | PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
| | | DailyQuestModel dailyQuestModel { get { return ModelCenter.Instance.GetModel<DailyQuestModel>(); } }
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_Close.AddListener(CloseClick);
|
| | | m_Buy.AddListener(OnBuyTimes);
|
| | | m_Use.AddListener(OnUseItem);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | dailyQuestModel.dailyQuestProgressUpdateEvent += DailyQuestProgressUpdateEvent;
|
| | | packModel.refreshItemCountEvent += RefreshItemCountEvent;
|
| | |
|
| | | Display();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | dailyQuestModel.dailyQuestProgressUpdateEvent -= DailyQuestProgressUpdateEvent;
|
| | | packModel.refreshItemCountEvent -= RefreshItemCountEvent;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | | #endregion
|
| | |
|
| | | void Display()
|
| | | {
|
| | | DisplayMoney();
|
| | | DisplayTimes();
|
| | | DisplayItem();
|
| | | }
|
| | |
|
| | | void DisplayMoney()
|
| | | {
|
| | | var config = DailyQuestConfig.Get((int)DailyQuestType.HazyRegion);
|
| | | var dailyQuestOpenTime = DailyQuestOpenTimeConfig.Get(config.RelatedID);
|
| | | m_Money.text = Language.Get("HazyRegionBuyTimesCost", dailyQuestOpenTime.BuyNeedMoney);
|
| | | }
|
| | |
|
| | | void DisplayTimes()
|
| | | {
|
| | | DailyQuestTimes dailyQuestTimes;
|
| | |
|
| | | var dayUseItemTimes = 0;
|
| | | var dayBuyTimes = 0;
|
| | |
|
| | | if (dailyQuestModel.TryGetDailyQuestTimes((int)DailyQuestType.HazyRegion, out dailyQuestTimes))
|
| | | {
|
| | | dayUseItemTimes = dailyQuestTimes.dayUseItemTimes;
|
| | | dayBuyTimes = dailyQuestTimes.dayBuyTimes;
|
| | | }
|
| | |
|
| | | var config = DailyQuestConfig.Get((int)DailyQuestType.HazyRegion);
|
| | | var dailyQuestOpenTime = DailyQuestOpenTimeConfig.Get(config.RelatedID);
|
| | |
|
| | | var times = Mathf.Clamp(dailyQuestOpenTime.DayBuyTimes - dayBuyTimes, 0, dailyQuestOpenTime.DayBuyTimes);
|
| | | var label = UIHelper.AppendColor(times == 0 ? TextColType.Red : TextColType.Green, times.ToString(), true);
|
| | | m_BuyTimes.text = StringUtility.Contact(label, "/", dailyQuestOpenTime.DayBuyTimes);
|
| | |
|
| | | if (dailyQuestOpenTime.DayItemID != 0)
|
| | | {
|
| | | times = Mathf.Clamp(dailyQuestOpenTime.DayItemAddTimes - dayUseItemTimes, 0, dailyQuestOpenTime.DayItemAddTimes);
|
| | | label = UIHelper.AppendColor(times == 0 ? TextColType.Red : TextColType.Green, times.ToString(), true);
|
| | |
|
| | | m_UseItemTimes.text = StringUtility.Contact(label, "/", dailyQuestOpenTime.DayItemAddTimes);
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayItem()
|
| | | {
|
| | | var config = DailyQuestConfig.Get((int)DailyQuestType.HazyRegion);
|
| | | var dailyQuestOpenTime = DailyQuestOpenTimeConfig.Get(config.RelatedID);
|
| | |
|
| | | m_ContainerUseItem.gameObject.SetActive(dailyQuestOpenTime.DayItemID != 0);
|
| | | if (dailyQuestOpenTime.DayItemID != 0)
|
| | | {
|
| | | m_Item.SetItem(dailyQuestOpenTime.DayItemID, 1);
|
| | | }
|
| | | }
|
| | |
|
| | | private void DailyQuestProgressUpdateEvent(int id)
|
| | | {
|
| | | var config = DailyQuestConfig.Get((int)DailyQuestType.HazyRegion);
|
| | | if (config != null && id == config.RelatedID)
|
| | | {
|
| | | DisplayTimes();
|
| | | }
|
| | | }
|
| | |
|
| | | private void RefreshItemCountEvent(PackType packType, int index, int itemId)
|
| | | {
|
| | | if (packType == PackType.Item)
|
| | | {
|
| | | var config = DailyQuestConfig.Get((int)DailyQuestType.HazyRegion);
|
| | | if (config != null)
|
| | | {
|
| | | var dailyQuestOpenTime = DailyQuestOpenTimeConfig.Get(config.RelatedID);
|
| | | if (dailyQuestOpenTime != null && dailyQuestOpenTime.DayItemID == itemId)
|
| | | {
|
| | | DisplayItem();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnUseItem()
|
| | | {
|
| | | DailyQuestTimes dailyQuestTimes;
|
| | |
|
| | | var dayUseItemTimes = 0;
|
| | |
|
| | | if (dailyQuestModel.TryGetDailyQuestTimes((int)DailyQuestType.HazyRegion, out dailyQuestTimes))
|
| | | {
|
| | | dayUseItemTimes = dailyQuestTimes.dayUseItemTimes;
|
| | | }
|
| | |
|
| | | var config = DailyQuestConfig.Get((int)DailyQuestType.HazyRegion);
|
| | | var dailyQuestOpenTime = DailyQuestOpenTimeConfig.Get(config.RelatedID);
|
| | | if (dayUseItemTimes >= dailyQuestOpenTime.DayItemAddTimes)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (!model.TryAddTimes())
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | var itemCount = packModel.GetItemCountByID(PackType.Item, dailyQuestOpenTime.DayItemID);
|
| | | if (itemCount <= 0)
|
| | | {
|
| | | ModelCenter.Instance.GetModel<GetItemPathModel>().SetChinItemModel(dailyQuestOpenTime.DayItemID);
|
| | | return;
|
| | | }
|
| | |
|
| | | var pak = new CA525_tagCMBuyDailyActionCnt();
|
| | | pak.AddType = 1;
|
| | | pak.ActionID = (uint)config.RelatedID;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | |
|
| | | private void OnBuyTimes()
|
| | | {
|
| | | DailyQuestTimes dailyQuestTimes;
|
| | |
|
| | | var dayBuyTimes = 0;
|
| | |
|
| | | if (dailyQuestModel.TryGetDailyQuestTimes((int)DailyQuestType.HazyRegion, out dailyQuestTimes))
|
| | | {
|
| | | dayBuyTimes = dailyQuestTimes.dayBuyTimes;
|
| | | }
|
| | |
|
| | | var config = DailyQuestConfig.Get((int)DailyQuestType.HazyRegion);
|
| | | var dailyQuestOpenTime = DailyQuestOpenTimeConfig.Get(config.RelatedID);
|
| | | if (dayBuyTimes >= dailyQuestOpenTime.DayBuyTimes)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (!model.TryAddTimes())
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (PlayerDatas.Instance.baseData.diamond < dailyQuestOpenTime.BuyNeedMoney)
|
| | | {
|
| | | WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | return;
|
| | | }
|
| | |
|
| | | var pak = new CA525_tagCMBuyDailyActionCnt();
|
| | | pak.AddType = 0;
|
| | | pak.ActionID = (uint)config.RelatedID;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 363f96dff81ee0342ad58f7d09951215 |
| | | timeCreated: 1554705839 |
| | | 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; |
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class HazyRegionCyclicScroll : CyclicScroll
|
| | | {
|
| | | [SerializeField] float m_FadeInTime = 0.2f;
|
| | |
|
| | | bool m_IsPlaying = false;
|
| | | public bool IsPlaying
|
| | | {
|
| | | get { return m_IsPlaying; }
|
| | | private set
|
| | | {
|
| | | m_IsPlaying = value;
|
| | | this.enabled = !m_IsPlaying;
|
| | | }
|
| | | }
|
| | |
|
| | | Coroutine m_Coroutine = null;
|
| | |
|
| | | public override void Init<T>(List<T> _datas, bool _stepByStep = false)
|
| | | {
|
| | | base.Init(_datas, _stepByStep);
|
| | | IsPlaying = false;
|
| | |
|
| | | if (m_Coroutine != null)
|
| | | {
|
| | | StopCoroutine(m_Coroutine);
|
| | | m_Coroutine = null;
|
| | | }
|
| | | }
|
| | |
|
| | | public void DisplayAnimation()
|
| | | {
|
| | | IsPlaying = true;
|
| | |
|
| | | m_Coroutine = StartCoroutine(Co_DisplayAnimation());
|
| | | }
|
| | |
|
| | | IEnumerator Co_DisplayAnimation()
|
| | | {
|
| | | for (int i = 0; i < infiniteItems.Count; i++)
|
| | | {
|
| | | var behaviour = infiniteItems[i] as HazyRegionIncidentBehaviour;
|
| | | behaviour.alphaTween.SetStartState();
|
| | | }
|
| | |
|
| | | var width = content.sizeDelta.x;
|
| | |
|
| | | var time = 0f;
|
| | |
|
| | | for (int i = 0; i < infiniteItems.Count; i++)
|
| | | {
|
| | | var behaviour = infiniteItems[i] as HazyRegionIncidentBehaviour;
|
| | | behaviour.linerMove.duration = behaviour.alphaTween.duration;
|
| | | var fromX = content.anchoredPosition.x + width / 2 + m_BoundOffset.left + cellSize.x;
|
| | | behaviour.linerMove.from = content.anchoredPosition.SetX(fromX);
|
| | | var toX = content.anchoredPosition.x - width / 2 + m_BoundOffset.left
|
| | | + cellSize.x / 2 + i * (cellSize.x + spacing.x);
|
| | | behaviour.linerMove.to = content.anchoredPosition.SetX(toX);
|
| | | behaviour.alphaTween.Play();
|
| | | behaviour.linerMove.Begin();
|
| | | yield return WaitingForSecondConst.GetWaitForSeconds(m_FadeInTime);
|
| | | time = behaviour.alphaTween.duration - m_FadeInTime;
|
| | | }
|
| | |
|
| | | time = Mathf.Max(0, time);
|
| | |
|
| | | yield return WaitingForSecondConst.GetWaitForSeconds(time);
|
| | |
|
| | | IsPlaying = false;
|
| | | }
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 30deeab42abedf7458bea9c513ed31b8 |
| | | timeCreated: 1554359458 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Tuesday, April 09, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class HazyRegionDialogueWin : Window
|
| | | {
|
| | | [SerializeField] Button m_Skip;
|
| | | [SerializeField] Button m_EmptyAccepter;
|
| | |
|
| | | [SerializeField] Transform m_ContainerNpc;
|
| | | [SerializeField] RawImage m_RawNpc;
|
| | | [SerializeField] Text m_NpcName;
|
| | | [SerializeField] Text m_NpcDialogue;
|
| | |
|
| | | [SerializeField] Transform m_ContainerPlayer;
|
| | | [SerializeField] RawImage m_RawPlayer;
|
| | | [SerializeField] Text m_PlayerName;
|
| | | [SerializeField] Text m_PlayerDialogue;
|
| | |
|
| | | int dialogueIndex = 0;
|
| | |
|
| | | public static int adventureDialogueId = 0;
|
| | |
|
| | | HazyRegionModel model { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_EmptyAccepter.AddListener(OnClickEmpty);
|
| | | m_Skip.AddListener(OnSkip);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | dialogueIndex = 0;
|
| | | DisplayDialogue();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | |
|
| | | }
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | if (!WindowCenter.Instance.IsOpen<MainInterfaceWin>())
|
| | | {
|
| | | WindowCenter.Instance.Open<MainInterfaceWin>();
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void LateUpdate()
|
| | | {
|
| | | GA_Hero _hero = PlayerDatas.Instance.hero;
|
| | | if (_hero == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (_hero.LockTarget == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | float _chkDistSqrt = MathUtility.DistanceSqrtXZ(_hero.Pos, _hero.LockTarget.Pos);
|
| | | if (_chkDistSqrt > Mathf.Pow(GeneralDefine.FarawayNpcDist, 2))
|
| | | {
|
| | | _hero.LockTarget = null;
|
| | | Close();
|
| | | }
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | private void DisplayDialogue()
|
| | | {
|
| | | var config = AdventureDialogueConfig.Get(adventureDialogueId);
|
| | |
|
| | | var speakType = config.speakType[dialogueIndex];
|
| | |
|
| | | m_ContainerNpc.gameObject.SetActive(speakType == 0);
|
| | | m_ContainerPlayer.gameObject.SetActive(speakType == 1);
|
| | |
|
| | | switch (speakType)
|
| | | {
|
| | | case 1:
|
| | | var job = PlayerDatas.Instance.baseData.Job;
|
| | | UI3DModelExhibition.Instance.ShowPlayer(m_RawPlayer, job, true);
|
| | | m_PlayerName.text = PlayerDatas.Instance.baseData.PlayerName;
|
| | | m_PlayerDialogue.text = Language.Get(config.dialogues[dialogueIndex]);
|
| | | break;
|
| | | case 0:
|
| | | var npcId = config.npcId;
|
| | | var npcConfig = NPCConfig.Get(npcId);
|
| | | m_NpcName.text = npcConfig.charName;
|
| | | m_NpcDialogue.text = Language.Get(config.dialogues[dialogueIndex]);
|
| | | var data = new UI3DNPCExhibitionData()
|
| | | {
|
| | | npcId = npcId,
|
| | | isDialogue = true,
|
| | | };
|
| | | UI3DModelExhibition.Instance.ShowNPC(m_RawNpc, data);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnSkip()
|
| | | {
|
| | | Close();
|
| | | model.SendSwitchAdventureState(model.processingIncidentId, 3);
|
| | | }
|
| | |
|
| | | private void OnClickEmpty()
|
| | | {
|
| | | var config = AdventureDialogueConfig.Get(adventureDialogueId);
|
| | |
|
| | | if (dialogueIndex < config.dialogues.Length - 1)
|
| | | {
|
| | | dialogueIndex += 1;
|
| | | DisplayDialogue();
|
| | | }
|
| | | else
|
| | | {
|
| | | Close();
|
| | | model.SendSwitchAdventureState(model.processingIncidentId, 3);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: d898556f396977c41b6231935e4fd466 |
| | | timeCreated: 1554779979 |
| | | 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 HazyRegionEntrancePanel : MonoBehaviour
|
| | | {
|
| | | [SerializeField] Text m_OpenTime;
|
| | |
|
| | | [SerializeField] Transform m_ContainerTimes;
|
| | | [SerializeField] Text m_Times;
|
| | | [SerializeField] Button m_BuyTimes;
|
| | |
|
| | | [SerializeField] Button m_Goto;
|
| | | [SerializeField] Text m_GotoLabel;
|
| | |
|
| | | HazyRegionModel model { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
|
| | | DailyQuestModel dailyQuestModel { get { return ModelCenter.Instance.GetModel<DailyQuestModel>(); } }
|
| | |
|
| | | private void Awake()
|
| | | {
|
| | | m_BuyTimes.AddListener(BuyTimes);
|
| | | m_Goto.AddListener(Goto);
|
| | | }
|
| | |
|
| | | public void Display()
|
| | | {
|
| | | dailyQuestModel.dailyQuestProgressUpdateEvent += DailyQuestProgressUpdateEvent;
|
| | | model.onHazyRegionIncidentRefresh += OnHazyRegionIncidentRefresh;
|
| | |
|
| | | DisplayOpenTime();
|
| | | DisplayTimes();
|
| | | DisplayButtonState();
|
| | | }
|
| | |
|
| | | void DisplayTimes()
|
| | | {
|
| | | m_ContainerTimes.gameObject.SetActive(!model.InFakeHazyRegion);
|
| | |
|
| | | if (!model.InFakeHazyRegion)
|
| | | {
|
| | | var config = DailyQuestConfig.Get((int)DailyQuestType.HazyRegion);
|
| | | var dailyQuestOpenTime = DailyQuestOpenTimeConfig.Get(config.RelatedID);
|
| | | var limitTimes = dailyQuestOpenTime.DayTimes;
|
| | |
|
| | | var totalTimes = dailyQuestModel.GetDailyQuestTotalTimes((int)DailyQuestType.HazyRegion);
|
| | | var completedTimes = dailyQuestModel.GetDailyQuestCompletedTimes((int)DailyQuestType.HazyRegion);
|
| | | var times = Mathf.Clamp(totalTimes - completedTimes, 0, limitTimes);
|
| | | m_Times.text = StringUtility.Contact(times, "/", limitTimes);
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayOpenTime()
|
| | | {
|
| | | m_OpenTime.gameObject.SetActive(!model.InFakeHazyRegion);
|
| | | if (!model.InFakeHazyRegion)
|
| | | {
|
| | | DailyQuestOpenTime dailyQuestOpenTime;
|
| | | if (dailyQuestModel.TryGetOpenTime((int)DailyQuestType.HazyRegion, out dailyQuestOpenTime))
|
| | | {
|
| | | HourMinute hourMinute;
|
| | | if (dailyQuestOpenTime.TryGetNextOpenTime(out hourMinute))
|
| | | {
|
| | | var timeLabel = string.Format("{0}:{1}——{2}:{3}", hourMinute.hourBegin.ToString("D2"),
|
| | | hourMinute.minuteBegin.ToString("D2"), hourMinute.hourEnd.ToString("D2"),
|
| | | hourMinute.minuteEnd.ToString("D2"));
|
| | | timeLabel = UIHelper.AppendColor(TextColType.Green, timeLabel);
|
| | | m_OpenTime.text = string.Format("每日{0}可进行寻访", timeLabel);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayButtonState()
|
| | | {
|
| | | bool allowClick = !model.InFakeHazyRegion || model.satisfyFakeOpen;
|
| | | m_Goto.SetColorful(m_GotoLabel, allowClick);
|
| | | }
|
| | |
|
| | | private void Goto()
|
| | | {
|
| | | var error = 0;
|
| | | if (TryOpenHazyReion(out error))
|
| | | {
|
| | | model.SendOpenHazyRegion();
|
| | | }
|
| | | else
|
| | | {
|
| | | HandleErrorMessage(error);
|
| | | }
|
| | | }
|
| | |
|
| | | private void BuyTimes()
|
| | | {
|
| | | var questState = dailyQuestModel.GetQuestState((int)DailyQuestType.HazyRegion);
|
| | | if (questState == DailyQuestModel.DailyQuestState.OutTime)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (!model.TryAddTimes())
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | WindowCenter.Instance.Open<HazyRegionBuyTimesWin>();
|
| | | }
|
| | |
|
| | | bool TryOpenHazyReion(out int error)
|
| | | {
|
| | | error = 0;
|
| | | if (model.InFakeHazyRegion)
|
| | | {
|
| | | if (model.satisfyFakeOpen)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | else
|
| | | {
|
| | | error = 4;
|
| | | return false;
|
| | | }
|
| | | }
|
| | | var questState = dailyQuestModel.GetQuestState((int)DailyQuestType.HazyRegion);
|
| | | if (questState != DailyQuestModel.DailyQuestState.Normal)
|
| | | {
|
| | | switch (questState)
|
| | | {
|
| | | case DailyQuestModel.DailyQuestState.OutTime:
|
| | | error = 1;
|
| | | break;
|
| | | case DailyQuestModel.DailyQuestState.CanBuyTimes:
|
| | | error = 2;
|
| | | break;
|
| | | case DailyQuestModel.DailyQuestState.Completed:
|
| | | error = 3;
|
| | | break;
|
| | | }
|
| | | return false;
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | | void HandleErrorMessage(int error)
|
| | | {
|
| | | switch (error)
|
| | | {
|
| | | case 1:
|
| | | DailyQuestOpenTime dailyQuestOpenTime;
|
| | | if (dailyQuestModel.TryGetOpenTime((int)DailyQuestType.HazyRegion, out dailyQuestOpenTime))
|
| | | {
|
| | | HourMinute hourMinute;
|
| | | if (dailyQuestOpenTime.TryGetTodayNearestOpenTime(out hourMinute))
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("OpenHazyRegionError_1",
|
| | | hourMinute.hourBegin.ToString("D2"),
|
| | | hourMinute.hourEnd.ToString("D2"));
|
| | | }
|
| | | }
|
| | | break;
|
| | | case 2:
|
| | | WindowCenter.Instance.Open<HazyRegionBuyTimesWin>();
|
| | | break;
|
| | | case 3:
|
| | | SysNotifyMgr.Instance.ShowTip("OpenHazyRegionError_3");
|
| | | break;
|
| | | case 4:
|
| | | SysNotifyMgr.Instance.ShowTip("OpenHazyRegionError_4");
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | public void Dispose()
|
| | | {
|
| | | dailyQuestModel.dailyQuestProgressUpdateEvent -= DailyQuestProgressUpdateEvent;
|
| | | model.onHazyRegionIncidentRefresh -= OnHazyRegionIncidentRefresh;
|
| | | }
|
| | |
|
| | | private void OnHazyRegionIncidentRefresh()
|
| | | {
|
| | | DisplayButtonState();
|
| | | }
|
| | |
|
| | | private void DailyQuestProgressUpdateEvent(int id)
|
| | | {
|
| | | var config = DailyQuestConfig.Get((int)DailyQuestType.HazyRegion);
|
| | | if (config != null && id == config.RelatedID)
|
| | | {
|
| | | DisplayTimes();
|
| | | }
|
| | | }
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 26db086140cb95e499e2b42014fcb6f4 |
| | | timeCreated: 1554371363 |
| | | 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 HazyRegionIncidentBehaviour : ScrollItem
|
| | | {
|
| | | [SerializeField] UIAlphaTween m_AlphaTween;
|
| | | [SerializeField] UILinerMove m_LinerMove;
|
| | | [SerializeField] Text m_IncidentTitle;
|
| | | [SerializeField] Text m_DepletionPoint;
|
| | | [SerializeField] Image m_Icon;
|
| | |
|
| | | [SerializeField] Transform m_ContainerCrossServer;
|
| | |
|
| | | [SerializeField] Transform m_ContainerItem;
|
| | | [SerializeField] ItemBehaviour[] m_Items;
|
| | | [SerializeField] Text[] m_ItemDescriptions;
|
| | |
|
| | | [SerializeField] Transform m_ContainerProcessing;
|
| | | [SerializeField] Transform m_ContainerCompleted;
|
| | |
|
| | | [SerializeField] Transform m_ContainerSelect;
|
| | | [SerializeField] Button m_Select;
|
| | |
|
| | | [Header("Boss")]
|
| | | [SerializeField] Transform m_ContainerBoss;
|
| | | [SerializeField] Text m_BossName;
|
| | | [SerializeField] Text m_PlayerCount;
|
| | | [SerializeField] Text m_RebornTime;
|
| | |
|
| | | public UIAlphaTween alphaTween { get { return m_AlphaTween; } }
|
| | | public UILinerMove linerMove { get { return m_LinerMove; } }
|
| | |
|
| | | HazyRegionModel model { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
|
| | |
|
| | | int incidentId = 0;
|
| | |
|
| | | HazyRegionIncidentType incidentType = HazyRegionIncidentType.Adventure;
|
| | |
|
| | | private void Awake()
|
| | | {
|
| | | m_Select.SetListener(OnSelect);
|
| | | }
|
| | |
|
| | | public override void Display(object _data)
|
| | | {
|
| | | base.Display(_data);
|
| | |
|
| | | incidentId = (int)_data;
|
| | | var config = HazyRegionConfig.Get(incidentId);
|
| | | incidentType = (HazyRegionIncidentType)config.incidentType;
|
| | |
|
| | | DisplayBase();
|
| | | DisplayItems();
|
| | | DisplayState();
|
| | | DisplaySelect();
|
| | | DisplayBoss();
|
| | |
|
| | | model.selectIncidentRefresh -= SelectIncidentRefresh;
|
| | | model.selectIncidentRefresh += SelectIncidentRefresh;
|
| | | model.onHazyRegionIncidentRefresh -= OnHazyRegionIncidentRefresh;
|
| | | model.onHazyRegionIncidentRefresh += OnHazyRegionIncidentRefresh;
|
| | | }
|
| | |
|
| | | void DisplayBase()
|
| | | {
|
| | | var config = HazyRegionConfig.Get(incidentId);
|
| | | m_DepletionPoint.text = string.Format("消耗体力: ", config.point);
|
| | | m_IncidentTitle.text = config.name;
|
| | | m_Icon.SetSprite(config.PortraitID);
|
| | | m_Icon.SetNativeSize();
|
| | | m_ContainerCrossServer.gameObject.SetActive(config.crossServer == 1);
|
| | | }
|
| | |
|
| | | void DisplayItems()
|
| | | {
|
| | | var config = HazyRegionConfig.Get(incidentId);
|
| | | for (int i = 0; i < m_Items.Length; i++)
|
| | | {
|
| | | if (config.reward != null && i < config.reward.Length)
|
| | | {
|
| | | m_Items[i].gameObject.SetActive(true);
|
| | | m_Items[i].SetItem(config.reward[i], 1);
|
| | | m_ItemDescriptions[i].gameObject.SetActive(true);
|
| | | m_ItemDescriptions[i].text = config.rewardState[i] == 0 ? string.Empty :
|
| | | Language.Get(StringUtility.Contact("HazyRegionItemState_", config.rewardState[i]));
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Items[i].gameObject.SetActive(false);
|
| | | m_ItemDescriptions[i].gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayBoss()
|
| | | {
|
| | | m_ContainerBoss.gameObject.SetActive(incidentType == HazyRegionIncidentType.Boss);
|
| | | var config = HazyRegionConfig.Get(incidentId);
|
| | | if (incidentType == HazyRegionIncidentType.Boss)
|
| | | {
|
| | | var npcConfig = NPCConfig.Get(config.npcId);
|
| | | m_BossName.text = npcConfig.charName;
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayState()
|
| | | {
|
| | | HazyRegionModel.Incident incident;
|
| | | if (model.TryGetIncident(incidentId, out incident))
|
| | | {
|
| | | m_ContainerCompleted.gameObject.SetActive(incident.state == HazyRegionModel.IncidentState.Complete);
|
| | | m_ContainerProcessing.gameObject.SetActive(incident.state == HazyRegionModel.IncidentState.Processing);
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplaySelect()
|
| | | {
|
| | | m_ContainerSelect.gameObject.SetActive(incidentId == model.selectIncident);
|
| | | }
|
| | |
|
| | | private void SelectIncidentRefresh()
|
| | | {
|
| | | DisplaySelect();
|
| | | }
|
| | |
|
| | | private void OnHazyRegionIncidentRefresh()
|
| | | {
|
| | | DisplayState();
|
| | | }
|
| | |
|
| | | private void OnSelect()
|
| | | {
|
| | | model.selectIncident = incidentId;
|
| | | }
|
| | |
|
| | | public override void Dispose()
|
| | | {
|
| | | base.Dispose();
|
| | | model.selectIncidentRefresh -= SelectIncidentRefresh;
|
| | | model.onHazyRegionIncidentRefresh -= OnHazyRegionIncidentRefresh;
|
| | | }
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f157de73adafe7e40943853257e03a6d |
| | | timeCreated: 1554360030 |
| | | 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 HazyRegionIncidentPanel : MonoBehaviour
|
| | | {
|
| | | [SerializeField] HazyRegionCyclicScroll m_CyclicScroll;
|
| | | [SerializeField] Transform m_ContainerPoint;
|
| | | [SerializeField] Slider m_Slider;
|
| | | [SerializeField] Text m_Point;
|
| | | [SerializeField] Button m_Back;
|
| | | [SerializeField] Button m_Goto;
|
| | |
|
| | | List<int> incidents = new List<int>();
|
| | |
|
| | | HazyRegionModel model { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
|
| | |
|
| | | private void Awake()
|
| | | {
|
| | | m_Back.AddListener(OnBack);
|
| | | m_Goto.AddListener(Goto);
|
| | | }
|
| | |
|
| | | public void Display()
|
| | | {
|
| | | DisplayPoint();
|
| | | DisplayIncidents();
|
| | | DisplayBackButton();
|
| | | }
|
| | |
|
| | | void DisplayIncidents()
|
| | | {
|
| | | incidents.Clear();
|
| | | incidents.AddRange(model.GetAllIncidents());
|
| | | incidents.Sort(Compare);
|
| | |
|
| | | if (incidents.Count > 0)
|
| | | {
|
| | | model.selectIncident = incidents[0];
|
| | | }
|
| | |
|
| | | m_CyclicScroll.Init(incidents);
|
| | |
|
| | | if (model.requireIncidentAnimation)
|
| | | {
|
| | | m_CyclicScroll.DisplayAnimation();
|
| | | model.requireIncidentAnimation = false;
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayPoint()
|
| | | {
|
| | | m_ContainerPoint.gameObject.SetActive(!model.InFakeHazyRegion);
|
| | |
|
| | | if (!model.InFakeHazyRegion)
|
| | | {
|
| | | var point = Mathf.Min(model.point, model.limitPoint);
|
| | | m_Point.text = StringUtility.Contact(point, "/", model.limitPoint);
|
| | | m_Slider.value = Mathf.Clamp01((float)point / model.limitPoint);
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayBackButton()
|
| | | {
|
| | | m_Back.gameObject.SetActive(!model.InFakeHazyRegion);
|
| | | }
|
| | |
|
| | | int Compare(int lhs, int rhs)
|
| | | {
|
| | | var lhs_config = HazyRegionConfig.Get(lhs);
|
| | | var rhs_config = HazyRegionConfig.Get(rhs);
|
| | | if (lhs_config.incidentType != rhs_config.incidentType)
|
| | | {
|
| | | return lhs_config.incidentType.CompareTo(rhs_config.incidentType);
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | private void OnBack()
|
| | | {
|
| | | if (model.IsIncidentDungeon())
|
| | | {
|
| | |
|
| | | return;
|
| | | }
|
| | |
|
| | | var state = 0;
|
| | |
|
| | | bool allComplete = true;
|
| | | int minpoint = int.MaxValue;
|
| | |
|
| | | foreach (var id in incidents)
|
| | | {
|
| | | HazyRegionModel.Incident incident;
|
| | | if (model.TryGetIncident(id, out incident))
|
| | | {
|
| | | if (incident.state == HazyRegionModel.IncidentState.Processing)
|
| | | {
|
| | | state = 2;
|
| | | allComplete = false;
|
| | | break;
|
| | | }
|
| | | if(incident.state != HazyRegionModel.IncidentState.Complete)
|
| | | {
|
| | | allComplete = false;
|
| | | }
|
| | | var config = HazyRegionConfig.Get(id);
|
| | | if (minpoint > config.point)
|
| | | {
|
| | | minpoint = config.point;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (state == 0 && !allComplete && model.point >= minpoint)
|
| | | {
|
| | | state = 1;
|
| | | }
|
| | |
|
| | | switch (state)
|
| | | {
|
| | | case 1:
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get(""), (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | model.SendBackHazyRegion();
|
| | | }
|
| | | });
|
| | | break;
|
| | | case 2:
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get(""), (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | model.SendBackHazyRegion();
|
| | | }
|
| | | });
|
| | | break;
|
| | | default:
|
| | | model.SendBackHazyRegion();
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | private void Goto()
|
| | | {
|
| | | var error = 0;
|
| | | if (!model.TryGotoIncident(model.selectIncident, out error))
|
| | | {
|
| | | model.DisplayErrorRemind(error);
|
| | | }
|
| | | else
|
| | | {
|
| | | model.SendGotoIncident(model.selectIncident);
|
| | | }
|
| | | }
|
| | |
|
| | | public void Dispose()
|
| | | {
|
| | | m_CyclicScroll.Dispose();
|
| | | }
|
| | |
|
| | | #if UNITY_EDITOR
|
| | | void OnGUI()
|
| | | {
|
| | | if (GUILayout.Button("Back"))
|
| | | {
|
| | | OnBack();
|
| | | }
|
| | | }
|
| | | #endif
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: cdcd39451a860ce4692d08aab3ae1afb |
| | | timeCreated: 1554371897 |
| | | 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 System.Text;
|
| | | using UnityEngine; |
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class HazyRegionModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | {
|
| | | Dictionary<int, Incident> m_Incidents = new Dictionary<int, Incident>();
|
| | | Dictionary<int, AdventureInfo> m_AdventureInfos = new Dictionary<int, AdventureInfo>();
|
| | |
|
| | | public int limitPoint { get; private set; }
|
| | | public int point { get; private set; }
|
| | | public int processingIncidentId { get; private set; }
|
| | | public int adventureDialogueId { get; private set; }
|
| | | public bool playing { get; private set; }
|
| | | public bool satisfyFakeOpen { get; private set; }
|
| | | public int hazyRegionOpenTimes { get; private set; }
|
| | | public int fakeOpenTimes { get; private set; }
|
| | | public bool isServerPrepare { get; private set; }
|
| | | public bool requireIncidentAnimation { get; set; }
|
| | |
|
| | | int m_SelectIncident;
|
| | | public int selectIncident
|
| | | {
|
| | | get { return m_SelectIncident; }
|
| | | set
|
| | | {
|
| | | if (m_SelectIncident != value)
|
| | | {
|
| | | m_SelectIncident = value;
|
| | | if (selectIncidentRefresh != null)
|
| | | {
|
| | | selectIncidentRefresh();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public bool InFakeHazyRegion
|
| | | {
|
| | | get { return hazyRegionOpenTimes <= fakeOpenTimes; }
|
| | | }
|
| | |
|
| | | int cacheMapId = 0;
|
| | |
|
| | | public event Action selectIncidentRefresh;
|
| | | public event Action<int> onHazyRegionStateRefresh; //0-结束拜访 1-开始拜访 2-强制刷新
|
| | | public event Action onHazyRegionIncidentRefresh;
|
| | |
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | | DailyQuestModel dailyQuestModel { get { return ModelCenter.Instance.GetModel<DailyQuestModel>(); } }
|
| | | HazyDemonKingModel hazyDemonKingModel { get { return ModelCenter.Instance.GetModel<HazyDemonKingModel>(); } }
|
| | | HazyGrassModel hazyGrassModel { get { return ModelCenter.Instance.GetModel<HazyGrassModel>(); } }
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | | ParseConfig();
|
| | |
|
| | | StageLoad.Instance.onStageLoadFinish += OnStageLoadFinish;
|
| | | AdventureStage.Instance.onLoadAdventureStage += OnLoadAdventureStage;
|
| | | AdventureStage.Instance.onExitAdventureStage += OnExitAdventureStage;
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | isServerPrepare = false;
|
| | | point = 0;
|
| | | playing = false;
|
| | | hazyRegionOpenTimes = 0;
|
| | | m_Incidents.Clear();
|
| | | m_AdventureInfos.Clear();
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | isServerPrepare = true;
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | | {
|
| | | StageLoad.Instance.onStageLoadFinish -= OnStageLoadFinish;
|
| | | AdventureStage.Instance.onExitAdventureStage -= OnExitAdventureStage;
|
| | | AdventureStage.Instance.onLoadAdventureStage -= OnLoadAdventureStage;
|
| | | }
|
| | |
|
| | | private void OnLoadAdventureStage()
|
| | | {
|
| | | WindowCenter.Instance.Open<HazyAdventureHintWin>();
|
| | | }
|
| | |
|
| | | private void OnExitAdventureStage()
|
| | | {
|
| | | SnxxzGame.Instance.StartCoroutine(Co_TryOpenHazyRegionWin());
|
| | | WindowCenter.Instance.Close<HazyAdventureHintWin>();
|
| | | }
|
| | |
|
| | | private void OnStageLoadFinish()
|
| | | {
|
| | | if (!(StageLoad.Instance.currentStage is DungeonStage))
|
| | | {
|
| | | cacheMapId = 0;
|
| | | }
|
| | | else
|
| | | {
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | if (!MapUtility.IsDungeon(mapId))
|
| | | {
|
| | | if (IsIncidentDungeon(cacheMapId))
|
| | | {
|
| | | SnxxzGame.Instance.StartCoroutine(Co_TryOpenHazyRegionWin());
|
| | | }
|
| | | }
|
| | | cacheMapId = mapId;
|
| | | }
|
| | | }
|
| | |
|
| | | IEnumerator Co_TryOpenHazyRegionWin()
|
| | | {
|
| | | yield return WaitingForSecondConst.WaitMS1000;
|
| | | if (NewBieCenter.Instance.inGuiding ||
|
| | | ModelCenter.Instance.GetModel<TreasureModel>().newGotShowing)
|
| | | {
|
| | | yield break;
|
| | | }
|
| | | if (WindowCenter.Instance.IsOpen<MainInterfaceWin>())
|
| | | {
|
| | | WindowCenter.Instance.Open<CrossServerWin>(false, 2);
|
| | | }
|
| | | }
|
| | |
|
| | | void ParseConfig()
|
| | | {
|
| | | var funcConfig = FuncConfigConfig.Get("ImmortalDomainStrength");
|
| | | limitPoint = int.Parse(funcConfig.Numerical1);
|
| | |
|
| | | funcConfig = FuncConfigConfig.Get("FakeImmortalCount");
|
| | | fakeOpenTimes = int.Parse(funcConfig.Numerical1);
|
| | | }
|
| | |
|
| | | public bool TryGetIncident(int id, out Incident incident)
|
| | | {
|
| | | return m_Incidents.TryGetValue(id, out incident);
|
| | | }
|
| | |
|
| | | public bool TryGotoIncident(int id, out int error)
|
| | | {
|
| | | error = 0;
|
| | | var config = HazyRegionConfig.Get(id);
|
| | | if (config == null)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | if (!TryGotoDungeon(id, out error))
|
| | | {
|
| | | return false;
|
| | | }
|
| | | Incident incident;
|
| | | if (TryGetIncident(id, out incident))
|
| | | {
|
| | | if (incident.state != IncidentState.Processing)
|
| | | {
|
| | | switch (incident.state)
|
| | | {
|
| | | case IncidentState.UnStart:
|
| | | if (!InFakeHazyRegion && point < config.point)
|
| | | {
|
| | | error = 3;
|
| | | return false;
|
| | | }
|
| | | break;
|
| | | case IncidentState.Complete:
|
| | | error = 4;
|
| | | return false;
|
| | | }
|
| | | }
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | | public bool TryGotoDungeon(int id, out int error)
|
| | | {
|
| | | error = 0;
|
| | | if (CrossServerUtility.IsCrossServer())
|
| | | {
|
| | | error = 1;
|
| | | return false;
|
| | | }
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | if (MapUtility.IsDungeon(mapId))
|
| | | {
|
| | | error = 2;
|
| | | return false;
|
| | | }
|
| | | if (AdventureStage.Instance.IsInAdventureStage)
|
| | | {
|
| | | error = 2;
|
| | | return false;
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | | public bool TryAddTimes()
|
| | | {
|
| | | var config = DailyQuestConfig.Get((int)DailyQuestType.HazyRegion);
|
| | | var dailyQuestOpenTime = DailyQuestOpenTimeConfig.Get(config.RelatedID);
|
| | | var limitTimes = dailyQuestOpenTime.DayTimes;
|
| | |
|
| | | var totalTimes = dailyQuestModel.GetDailyQuestTotalTimes((int)DailyQuestType.HazyRegion);
|
| | | var completedTimes = dailyQuestModel.GetDailyQuestCompletedTimes((int)DailyQuestType.HazyRegion);
|
| | | var times = Mathf.Clamp(totalTimes - completedTimes, 0, limitTimes);
|
| | |
|
| | | if (times >= limitTimes)
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
|
| | | return true;
|
| | | }
|
| | |
|
| | | public bool TryGetAdventureInfo(int id, out AdventureInfo adventureInfo)
|
| | | {
|
| | | return m_AdventureInfos.TryGetValue(id, out adventureInfo);
|
| | | }
|
| | |
|
| | | public ICollection<int> GetAllIncidents()
|
| | | {
|
| | | return m_Incidents.Keys;
|
| | | }
|
| | |
|
| | | public int GetIncidentId(int mapId, int lineId)
|
| | | {
|
| | | var configs = HazyRegionConfig.GetValues();
|
| | | foreach (var config in configs)
|
| | | {
|
| | | if (config.dungeonId == mapId && config.lineId == lineId)
|
| | | {
|
| | | return config.id;
|
| | | }
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | public int GetAdventureNpcId()
|
| | | {
|
| | | var dialogueConfig = AdventureDialogueConfig.Get(adventureDialogueId);
|
| | | if (dialogueConfig != null)
|
| | | {
|
| | | return dialogueConfig.npcId;
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | public bool IsIncidentDungeon(int mapId)
|
| | | {
|
| | | if (mapId == 0)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | if (mapId == HazyDemonKingModel.Client_MapID
|
| | | || mapId == HazyGrassModel.Client_FairyGrassMapID
|
| | | || mapId == HazyGrassModel.Client_ReikiGrassMapID)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | var configs = HazyRegionConfig.GetValues();
|
| | | foreach (var config in configs)
|
| | | {
|
| | | if (config.dungeonId == mapId)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool IsIncidentDungeon()
|
| | | {
|
| | | if (AdventureStage.Instance.IsInAdventureStage)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | if (IsIncidentDungeon(PlayerDatas.Instance.baseData.MapID))
|
| | | {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public void DisplayErrorRemind(int error)
|
| | | {
|
| | | switch (error)
|
| | | {
|
| | | default:
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | public void StartAdventureDialogue()
|
| | | {
|
| | | WindowCenter.Instance.Close<MainInterfaceWin>();
|
| | | HazyRegionDialogueWin.adventureDialogueId = adventureDialogueId;
|
| | | WindowCenter.Instance.Open<HazyRegionDialogueWin>();
|
| | | }
|
| | |
|
| | | void InitializeAdventure()
|
| | | {
|
| | | var config = HazyRegionConfig.Get(processingIncidentId);
|
| | | if (config != null)
|
| | | {
|
| | | var gear = 0;
|
| | | AdventureInfo adventureInfo;
|
| | | if (TryGetAdventureInfo(processingIncidentId, out adventureInfo))
|
| | | {
|
| | | switch (config.lineId)
|
| | | {
|
| | | case 1:
|
| | | gear = PlayerDatas.Instance.baseData.LV >= adventureInfo.condition ? adventureInfo.gear : 0;
|
| | | break;
|
| | | case 2:
|
| | | gear = PlayerDatas.Instance.baseData.realmLevel >= adventureInfo.condition ? adventureInfo.gear : 0;
|
| | | break;
|
| | | case 3:
|
| | | gear = PlayerDatas.Instance.baseData.FightPoint >= adventureInfo.condition ? adventureInfo.gear : 0;
|
| | | break;
|
| | | case 4:
|
| | | gear = PlayerDatas.Instance.extersion.luckValue >= adventureInfo.condition ? adventureInfo.gear : 0;
|
| | | break;
|
| | | }
|
| | | }
|
| | | var dialogueConfig = AdventureDialogueConfig.Get(config.lineId, gear);
|
| | | if (dialogueConfig != null)
|
| | | {
|
| | | adventureDialogueId = dialogueConfig.id;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void SendGotoIncident(int id)
|
| | | {
|
| | | processingIncidentId = id;
|
| | |
|
| | | var config = HazyRegionConfig.Get(id);
|
| | | switch ((HazyRegionIncidentType)config.incidentType)
|
| | | {
|
| | | case HazyRegionIncidentType.Adventure:
|
| | | InitializeAdventure();
|
| | |
|
| | | WindowCenter.Instance.CloseAll(WindowCenter.CloseAllIgnoreType.BaseAndCustom);
|
| | |
|
| | | AdventureStage.Instance.Enter();
|
| | |
|
| | | Incident incident;
|
| | | if(TryGetIncident(id,out incident))
|
| | | {
|
| | | if (incident.state == IncidentState.UnStart)
|
| | | {
|
| | | SendSwitchAdventureState(id, 2);
|
| | | }
|
| | | }
|
| | | break;
|
| | | case HazyRegionIncidentType.Boss:
|
| | | if (InFakeHazyRegion)
|
| | | {
|
| | | hazyDemonKingModel.RequestEnterClientDungeon();
|
| | | }
|
| | | else
|
| | | {
|
| | | SendGotoIncidentDungeon(config);
|
| | | }
|
| | | break;
|
| | | case HazyRegionIncidentType.FairyGrass:
|
| | | case HazyRegionIncidentType.ReikiGrass:
|
| | | if (InFakeHazyRegion)
|
| | | {
|
| | | hazyGrassModel.RequestEnterClientDungeon();
|
| | | }
|
| | | else
|
| | | {
|
| | | SendGotoIncidentDungeon(config);
|
| | | }
|
| | | break;
|
| | | case HazyRegionIncidentType.Precious:
|
| | | SendGotoIncidentDungeon(config);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | void SendGotoIncidentDungeon(HazyRegionConfig config)
|
| | | {
|
| | | if (config.crossServer == 1)
|
| | | {
|
| | | var pak = new CC105_tagCMEnterCrossServer();
|
| | | pak.DataMapID = (uint)config.dungeonId;
|
| | | pak.LineID = (ushort)config.lineId;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | | else
|
| | | {
|
| | | dungeonModel.SingleChallenge(config.dungeonId, config.lineId);
|
| | | }
|
| | | }
|
| | |
|
| | | public void SendBackHazyRegion()
|
| | | {
|
| | | var pak = new CA526_tagCMVisitFairyDomain();
|
| | | pak.Type = 1;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | |
|
| | | public void SendOpenHazyRegion()
|
| | | {
|
| | | var pak = new CA526_tagCMVisitFairyDomain();
|
| | | pak.Type = 0;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | |
|
| | | public void SendSwitchAdventureState(int id, int state)
|
| | | {
|
| | | var pak = new CA504_tagCMPlayerGetReward();
|
| | | pak.RewardType = (byte)GotServerRewardType.Def_RewardType_FairyAdventuresAward;
|
| | | pak.DataEx = (uint)id;
|
| | | pak.DataExStr = state.ToString();
|
| | | pak.DataExStrLen = (byte)Encoding.UTF8.GetBytes(pak.DataExStr).Length;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | |
|
| | | public void ReceivePackage(HA306_tagMCFairyDomainInfo package)
|
| | | {
|
| | | var preplaying = playing;
|
| | |
|
| | | playing = package.State == 1;
|
| | |
|
| | | satisfyFakeOpen = package.State == 2;
|
| | |
|
| | | hazyRegionOpenTimes = (int)package.VisitCnt;
|
| | |
|
| | | point = package.Energy;
|
| | |
|
| | | if (package.IsAll == 1)
|
| | | {
|
| | | m_Incidents.Clear();
|
| | | }
|
| | |
|
| | | for (int i = 0; i < package.Count; i++)
|
| | | {
|
| | | var data = package.InfoList[i];
|
| | | m_Incidents[data.EventID] = new Incident()
|
| | | {
|
| | | id = data.EventID,
|
| | | state = (IncidentState)data.EventState,
|
| | | };
|
| | | }
|
| | |
|
| | | if (onHazyRegionIncidentRefresh != null)
|
| | | {
|
| | | onHazyRegionIncidentRefresh();
|
| | | }
|
| | |
|
| | | if (isServerPrepare)
|
| | | {
|
| | | if (preplaying != playing)
|
| | | {
|
| | | if (onHazyRegionStateRefresh != null)
|
| | | {
|
| | | onHazyRegionStateRefresh(playing ? 1 : 0);
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (onHazyRegionStateRefresh != null)
|
| | | {
|
| | | onHazyRegionStateRefresh(2);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void ReceivePackage(HA307_tagMCFairyAdventuresInfo package)
|
| | | {
|
| | | m_AdventureInfos.Clear();
|
| | | for (int i = 0; i < package.Cnt; i++)
|
| | | {
|
| | | var data = package.InfoList[i];
|
| | |
|
| | | m_AdventureInfos[data.EventID] = new AdventureInfo()
|
| | | {
|
| | | gear = data.Gear,
|
| | | condition = (int)data.Condition,
|
| | | };
|
| | | }
|
| | | }
|
| | |
|
| | | public enum IncidentState
|
| | | {
|
| | | UnStart = 1,
|
| | | Processing = 2,
|
| | | Complete = 3,
|
| | | }
|
| | |
|
| | | public struct Incident
|
| | | {
|
| | | public int id;
|
| | | public IncidentState state;
|
| | | }
|
| | |
|
| | | public struct AdventureInfo
|
| | | {
|
| | | public int gear;
|
| | | public int condition;
|
| | | }
|
| | | }
|
| | |
|
| | | public enum HazyRegionIncidentType
|
| | | {
|
| | | Adventure,
|
| | | Precious,
|
| | | FairyGrass,
|
| | | Boss,
|
| | | ReikiGrass,
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 850cb668290bbf34fb0e2882c56defb9 |
| | | timeCreated: 1554358789 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Thursday, April 04, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class HazyRegionWin : Window
|
| | | {
|
| | | [SerializeField] HazyRegionEntrancePanel m_EntrancePanel;
|
| | | [SerializeField] HazyRegionIncidentPanel m_IncidentPanel;
|
| | |
|
| | | [SerializeField] ScaleTween m_BottomScaleTween;
|
| | | [SerializeField] UIAlphaTween m_AlphaTween;
|
| | |
|
| | | HazyRegionStage m_Stage = HazyRegionStage.Entrance;
|
| | | HazyRegionStage stage
|
| | | {
|
| | | get { return m_Stage; }
|
| | | set
|
| | | {
|
| | | if (m_Stage != value)
|
| | | {
|
| | | switch (m_Stage)
|
| | | {
|
| | | case HazyRegionStage.Entrance:
|
| | | //CloseHazyRegionEntrance();
|
| | | break;
|
| | | case HazyRegionStage.Playing:
|
| | | CloseHazyRegionIncident();
|
| | | break;
|
| | | }
|
| | |
|
| | | m_Stage = value;
|
| | |
|
| | | switch (m_Stage)
|
| | | {
|
| | | case HazyRegionStage.Entrance:
|
| | | OpenHazyRegionEntrance();
|
| | | break;
|
| | | case HazyRegionStage.Playing:
|
| | | StartEntranceAnimation();
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | HazyRegionModel model { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnActived()
|
| | | {
|
| | | base.OnActived();
|
| | |
|
| | | Display();
|
| | |
|
| | | model.onHazyRegionStateRefresh += OnHazyRegionStateRefresh;
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | if (model.InFakeHazyRegion && stage == HazyRegionStage.Playing)
|
| | | {
|
| | | StartCoroutine(Co_VerifyCompleteAllIncidents());
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | m_EntrancePanel.Dispose();
|
| | | m_IncidentPanel.Dispose();
|
| | |
|
| | | StopAllCoroutines();
|
| | |
|
| | | model.onHazyRegionStateRefresh -= OnHazyRegionStateRefresh;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | | #endregion
|
| | |
|
| | | void Display()
|
| | | {
|
| | | m_EntrancePanel.gameObject.SetActive(false);
|
| | | m_IncidentPanel.gameObject.SetActive(false);
|
| | |
|
| | | m_Stage = model.playing ? HazyRegionStage.Playing : HazyRegionStage.Entrance;
|
| | |
|
| | | switch (stage)
|
| | | {
|
| | | case HazyRegionStage.Entrance:
|
| | | OpenHazyRegionEntrance();
|
| | | break;
|
| | | case HazyRegionStage.Playing:
|
| | | OpenHazyRegionIncident();
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | void OpenHazyRegionEntrance()
|
| | | {
|
| | | m_EntrancePanel.gameObject.SetActive(true);
|
| | | m_BottomScaleTween.Stop();
|
| | | m_BottomScaleTween.SetStartState();
|
| | | m_AlphaTween.SetStartState();
|
| | | m_EntrancePanel.Dispose();
|
| | | m_EntrancePanel.Display();
|
| | | }
|
| | |
|
| | | void OpenHazyRegionIncident()
|
| | | {
|
| | | m_IncidentPanel.gameObject.SetActive(true);
|
| | | m_IncidentPanel.Dispose();
|
| | | m_IncidentPanel.Display();
|
| | | }
|
| | |
|
| | | void CloseHazyRegionIncident()
|
| | | {
|
| | | m_IncidentPanel.Dispose();
|
| | | m_IncidentPanel.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | void CloseHazyRegionEntrance()
|
| | | {
|
| | | m_EntrancePanel.Dispose();
|
| | | m_EntrancePanel.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | void StartEntranceAnimation()
|
| | | {
|
| | | m_BottomScaleTween.Play();
|
| | | m_AlphaTween.Play();
|
| | | StartCoroutine(Co_EntranceAnimation());
|
| | | }
|
| | |
|
| | | IEnumerator Co_EntranceAnimation()
|
| | | {
|
| | | yield return WaitingForSecondConst.GetWaitForSeconds(m_AlphaTween.duration * 0.5f);
|
| | | CloseHazyRegionEntrance();
|
| | | yield return WaitingForSecondConst.GetWaitForSeconds(m_AlphaTween.duration * 0.2f);
|
| | | model.requireIncidentAnimation = true;
|
| | | OpenHazyRegionIncident();
|
| | | }
|
| | |
|
| | | private void OnHazyRegionStateRefresh(int state)
|
| | | {
|
| | | if (state == 2)
|
| | | {
|
| | | if ((model.playing && stage != HazyRegionStage.Playing)
|
| | | || (!model.playing && stage != HazyRegionStage.Entrance))
|
| | | {
|
| | | Display();
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | stage = state == 0 ? HazyRegionStage.Entrance : HazyRegionStage.Playing;
|
| | | }
|
| | | }
|
| | |
|
| | | IEnumerator Co_VerifyCompleteAllIncidents()
|
| | | {
|
| | | yield return WaitingForSecondConst.WaitMS500;
|
| | |
|
| | | var allComplete = true;
|
| | | var incidents = model.GetAllIncidents();
|
| | | if (incidents != null)
|
| | | {
|
| | | foreach (var id in incidents)
|
| | | {
|
| | | HazyRegionModel.Incident incident;
|
| | | if (model.TryGetIncident(id, out incident))
|
| | | {
|
| | | if (incident.state != HazyRegionModel.IncidentState.Complete)
|
| | | {
|
| | | allComplete = false;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (allComplete)
|
| | | {
|
| | | model.SendBackHazyRegion();
|
| | | }
|
| | | }
|
| | |
|
| | | enum HazyRegionStage
|
| | | {
|
| | | Entrance,
|
| | | Playing,
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 9f6e51c1812470a46b101b0af440843d |
| | | timeCreated: 1554360355 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | |
|
| | | private bool IsDungeon()
|
| | | {
|
| | | if (AdventureStage.Instance.IsInAdventureStage)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | var mapConfig = MapConfig.Get(mapId);
|
| | | return mapConfig != null && mapConfig.MapFBType != 0;
|
| | |
| | | itemCell.button.RemoveAllListeners(); |
| | | itemCell.button.AddListener(() => |
| | | { |
| | | ItemAttrData attrData = new ItemAttrData(item.id, false, (ulong)item.count); |
| | | ItemAttrData attrData = new ItemAttrData(item.id, true, (ulong)item.count); |
| | | itemTipsModel.SetItemTipsModel(attrData); |
| | | }); |
| | | } |
| | |
| | | RegisterModel<ReikiRootModel>();
|
| | | RegisterModel<AuctionNewGetShowModel>();
|
| | | RegisterModel<DungeonNuwaModel>();
|
| | | RegisterModel<HazyRegionModel>();
|
| | | RegisterModel<HazyDemonKingModel>();
|
| | | RegisterModel<HazyGrassModel>();
|
| | | inited = true;
|
| | | }
|
| | |
|
| | |
| | | && !IsOpen("DefaultDialogueBoxWin")
|
| | | && !IsOpen("DialogueDuidanceWin")
|
| | | && !IsOpen("TaskBoxBGMWin")
|
| | | && !IsOpen("WelcomeWin");
|
| | | && !IsOpen("WelcomeWin")
|
| | | && !IsOpen("HazyRegionDialogueWin");
|
| | |
|
| | | if (exceptOpen != IsOpen("MainInterfaceWin"))
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | [XLua.LuaCallCSharp]
|
| | | public static void SetColorful(this Button _btn, Text _btnTxt, bool _colorful)
|
| | | {
|
| | | if (_btn != null)
|
| | | {
|
| | | var imageEx = _btn.image as ImageEx;
|
| | | if (imageEx != null)
|
| | | {
|
| | | imageEx.gray = !_colorful;
|
| | | }
|
| | | }
|
| | | if (_btnTxt != null)
|
| | | {
|
| | | _btnTxt.color = UIHelper.GetUIColor(_colorful ? TextColType.NavyBrown : TextColType.White);
|
| | | _btnTxt.color = _btnTxt.color.SetA(_colorful ? 1 : 0.5f);
|
| | | }
|
| | | }
|
| | |
|
| | | [XLua.LuaCallCSharp]
|
| | | public static void SetInteractable(this Button _btn, Text _btnText, bool _interactable)
|
| | | {
|
| | | if (_btn != null)
|
| | |
| | | normalTasks.Add(new ConfigInitTask("LegendPropertyValueConfig", () => { LegendPropertyValueConfig.Init(); }, () => { return LegendPropertyValueConfig.inited; })); |
| | | normalTasks.Add(new ConfigInitTask("LegendPropertyConfig", () => { LegendPropertyConfig.Init(); }, () => { return LegendPropertyConfig.inited; })); |
| | | normalTasks.Add(new ConfigInitTask("EquipSuitNameConfig", () => { EquipSuitNameConfig.Init(); }, () => { return EquipSuitNameConfig.inited; }));
|
| | | normalTasks.Add(new ConfigInitTask("ReikiRootConfig", () => { ReikiRootConfig.Init(); }, () => { return ReikiRootConfig.inited; })); |
| | | normalTasks.Add(new ConfigInitTask("ReikiRootConfig", () => { ReikiRootConfig.Init(); }, () => { return ReikiRootConfig.inited; }));
|
| | | normalTasks.Add(new ConfigInitTask("HazyRegionConfig", () => { HazyRegionConfig.Init(); }, () => { return HazyRegionConfig.inited; }));
|
| | | normalTasks.Add(new ConfigInitTask("AdventureDialogueConfig", () => { AdventureDialogueConfig.Init(); }, () => { return AdventureDialogueConfig.inited; })); |
| | | } |
| | | |
| | | static List<ConfigInitTask> doingTasks = new List<ConfigInitTask>(); |
| | |
| | | GatherSoulDungeon = 30,
|
| | | CrossServerPk = 31,
|
| | | AllianceBoss = 32,
|
| | | RidingPetActivity = 34
|
| | | RidingPetActivity = 34,
|
| | | HazyRegion = 35,
|
| | | //JadeDynastyBoss = 32,--诛仙功能暂时关闭
|
| | | //JadeDynastyTower = 33,
|
| | | }
|
| | |
| | | Def_RewardType_NewFairyCParty = 24, // 新仙界盛典全民来嗨24
|
| | | Def_RewardType_FeastWeekPartyAct = 25, //领取节日巡礼活动奖励25
|
| | | Def_RewardType_FeastWeekPartyPoint = 26, //领取节日巡礼积分奖励26
|
| | | Def_RewardType_FairyAdventuresAward = 27,//缥缈奇遇
|
| | | }
|
| | |
|
| | | public enum MapType
|