9948 子 【BT0.1】【主干】天星塔修改 / 【BT0.1】【主干】天星塔修改
# Conflicts:
# Core/GameEngine/DataToCtl/PackageRegedit.cs
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: Fish |
| | | // [ Date ]: Wednesday, May 15, 2019 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System.IO; |
| | | using System.Threading; |
| | | using System; |
| | | using UnityEngine; |
| | | |
| | | |
| | | public partial class SkyTowerConfig |
| | | { |
| | | |
| | | public readonly int floorId; |
| | | public readonly int floorIndex; |
| | | public readonly string floorName; |
| | | public readonly int bossId; |
| | | public readonly Int2[] rewards; |
| | | public readonly int levelLimit; |
| | | public readonly int fightPower; |
| | | |
| | | public SkyTowerConfig() |
| | | { |
| | | } |
| | | |
| | | public SkyTowerConfig(string input) |
| | | { |
| | | try |
| | | { |
| | | var tables = input.Split('\t'); |
| | | |
| | | int.TryParse(tables[0],out floorId); |
| | | |
| | | int.TryParse(tables[1],out floorIndex); |
| | | |
| | | floorName = tables[2]; |
| | | |
| | | int.TryParse(tables[3],out bossId); |
| | | |
| | | //--------------------------------------------------------
|
| | | // [Author]: Fish
|
| | | // [ Date ]: 2023年10月8日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | | using System.IO;
|
| | | using System.Threading;
|
| | | using System;
|
| | | using UnityEngine;
|
| | |
|
| | | public partial class SkyTowerConfig
|
| | | {
|
| | |
|
| | | public readonly int floorId;
|
| | | public readonly int floorIndex;
|
| | | public readonly string floorName;
|
| | | public readonly int bossId;
|
| | | public readonly Int2[] rewards;
|
| | | public readonly int levelLimit;
|
| | | public readonly int fightPower;
|
| | | public readonly int rewardShow;
|
| | |
|
| | | public SkyTowerConfig()
|
| | | {
|
| | | }
|
| | |
|
| | | public SkyTowerConfig(string input)
|
| | | {
|
| | | try
|
| | | {
|
| | | var tables = input.Split('\t');
|
| | |
|
| | | int.TryParse(tables[0],out floorId); |
| | |
|
| | | int.TryParse(tables[1],out floorIndex); |
| | |
|
| | | floorName = tables[2];
|
| | |
|
| | | int.TryParse(tables[3],out bossId); |
| | |
|
| | | string[] rewardsStringArray = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | rewards = new Int2[rewardsStringArray.Length]; |
| | | for (int i=0;i<rewardsStringArray.Length;i++) |
| | | { |
| | | Int2.TryParse(rewardsStringArray[i],out rewards[i]); |
| | | } |
| | | |
| | | int.TryParse(tables[5],out levelLimit); |
| | | |
| | | int.TryParse(tables[6],out fightPower); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | DebugEx.Log(ex); |
| | | } |
| | | } |
| | | |
| | | static Dictionary<string, SkyTowerConfig> configs = new Dictionary<string, SkyTowerConfig>(); |
| | | public static SkyTowerConfig Get(string id) |
| | | { |
| | | if (!inited) |
| | | { |
| | | Debug.Log("SkyTowerConfig 还未完成初始化。"); |
| | | return null; |
| | | } |
| | | |
| | | if (configs.ContainsKey(id)) |
| | | { |
| | | return configs[id]; |
| | | } |
| | | |
| | | SkyTowerConfig config = null; |
| | | if (rawDatas.ContainsKey(id)) |
| | | { |
| | | config = configs[id] = new SkyTowerConfig(rawDatas[id]); |
| | | rawDatas.Remove(id); |
| | | } |
| | | |
| | | return config; |
| | | } |
| | | |
| | | public static SkyTowerConfig 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<SkyTowerConfig> GetValues() |
| | | { |
| | | var values = new List<SkyTowerConfig>(); |
| | | 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 +"/SkyTower.txt"; |
| | | } |
| | | else |
| | | { |
| | | path = AssetVersionUtility.GetAssetFilePath("config/SkyTower.txt"); |
| | | } |
| | | |
| | | configs.Clear(); |
| | | var tempConfig = new SkyTowerConfig(); |
| | | 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 SkyTowerConfig(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 SkyTowerConfig(line); |
| | | configs[id] = config; |
| | | (config as IConfigPostProcess).OnConfigParseCompleted(); |
| | | } |
| | | else |
| | | { |
| | | rawDatas[id] = line; |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | Debug.LogError(ex); |
| | | } |
| | | } |
| | | |
| | | inited = true; |
| | | }); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | }
|
| | |
|
| | | int.TryParse(tables[5],out levelLimit); |
| | |
|
| | | int.TryParse(tables[6],out fightPower); |
| | |
|
| | | int.TryParse(tables[7],out rewardShow); |
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | DebugEx.Log(ex);
|
| | | }
|
| | | }
|
| | |
|
| | | static Dictionary<string, SkyTowerConfig> configs = new Dictionary<string, SkyTowerConfig>();
|
| | | public static SkyTowerConfig Get(string id)
|
| | | { |
| | | if (!inited)
|
| | | {
|
| | | Debug.Log("SkyTowerConfig 还未完成初始化。");
|
| | | return null;
|
| | | }
|
| | | |
| | | if (configs.ContainsKey(id))
|
| | | {
|
| | | return configs[id];
|
| | | }
|
| | |
|
| | | SkyTowerConfig config = null;
|
| | | if (rawDatas.ContainsKey(id))
|
| | | {
|
| | | config = configs[id] = new SkyTowerConfig(rawDatas[id]);
|
| | | rawDatas.Remove(id);
|
| | | }
|
| | |
|
| | | return config;
|
| | | }
|
| | |
|
| | | public static SkyTowerConfig 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<SkyTowerConfig> GetValues()
|
| | | {
|
| | | var values = new List<SkyTowerConfig>();
|
| | | values.AddRange(configs.Values);
|
| | |
|
| | | var keys = new List<string>(rawDatas.Keys);
|
| | | for (int i = 0; i < keys.Count; i++)
|
| | | {
|
| | | values.Add(Get(keys[i]));
|
| | | }
|
| | |
|
| | | 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 +"/SkyTower.txt";
|
| | | }
|
| | | else
|
| | | {
|
| | | path = AssetVersionUtility.GetAssetFilePath("config/SkyTower.txt");
|
| | | }
|
| | |
|
| | | configs.Clear();
|
| | | var tempConfig = new SkyTowerConfig();
|
| | | 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 SkyTowerConfig(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 SkyTowerConfig(line);
|
| | | configs[id] = config;
|
| | | (config as IConfigPostProcess).OnConfigParseCompleted();
|
| | | }
|
| | | else
|
| | | {
|
| | | rawDatas[id] = line;
|
| | | }
|
| | | }
|
| | | catch (System.Exception ex)
|
| | | {
|
| | | Debug.LogError(ex);
|
| | | }
|
| | | }
|
| | |
|
| | | inited = true;
|
| | | });
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
| | | fileFormatVersion: 2 |
| | | guid: 5391bf9204e1f3743b4a9f452b57b964 |
| | | timeCreated: 1557892600 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: Fish |
| | | // [ Date ]: Thursday, March 05, 2020 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System.IO; |
| | | using System.Threading; |
| | | using System; |
| | | using UnityEngine; |
| | | |
| | | |
| | | public partial class SkyTowerServerChallengeConfig |
| | | { |
| | | |
| | | public readonly int floorId; |
| | | public readonly int rewardRecordIndex; |
| | | public readonly Int2[] rewards; |
| | | |
| | | public SkyTowerServerChallengeConfig() |
| | | { |
| | | } |
| | | |
| | | public SkyTowerServerChallengeConfig(string input) |
| | | { |
| | | try |
| | | { |
| | | var tables = input.Split('\t'); |
| | | |
| | | int.TryParse(tables[0],out floorId); |
| | | |
| | | int.TryParse(tables[1],out rewardRecordIndex); |
| | | |
| | | string[] rewardsStringArray = tables[2].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | rewards = new Int2[rewardsStringArray.Length]; |
| | | for (int i=0;i<rewardsStringArray.Length;i++) |
| | | { |
| | | Int2.TryParse(rewardsStringArray[i],out rewards[i]); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | DebugEx.Log(ex); |
| | | } |
| | | } |
| | | |
| | | static Dictionary<string, SkyTowerServerChallengeConfig> configs = new Dictionary<string, SkyTowerServerChallengeConfig>(); |
| | | public static SkyTowerServerChallengeConfig Get(string id) |
| | | { |
| | | if (!inited) |
| | | { |
| | | Debug.Log("SkyTowerServerChallengeConfig 还未完成初始化。"); |
| | | return null; |
| | | } |
| | | |
| | | if (configs.ContainsKey(id)) |
| | | { |
| | | return configs[id]; |
| | | } |
| | | |
| | | SkyTowerServerChallengeConfig config = null; |
| | | if (rawDatas.ContainsKey(id)) |
| | | { |
| | | config = configs[id] = new SkyTowerServerChallengeConfig(rawDatas[id]); |
| | | rawDatas.Remove(id); |
| | | } |
| | | |
| | | return config; |
| | | } |
| | | |
| | | public static SkyTowerServerChallengeConfig 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<SkyTowerServerChallengeConfig> GetValues() |
| | | { |
| | | var values = new List<SkyTowerServerChallengeConfig>(); |
| | | 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 +"/SkyTowerServerChallenge.txt"; |
| | | } |
| | | else |
| | | { |
| | | path = AssetVersionUtility.GetAssetFilePath("config/SkyTowerServerChallenge.txt"); |
| | | } |
| | | |
| | | configs.Clear(); |
| | | var tempConfig = new SkyTowerServerChallengeConfig(); |
| | | 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 SkyTowerServerChallengeConfig(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 SkyTowerServerChallengeConfig(line); |
| | | configs[id] = config; |
| | | (config as IConfigPostProcess).OnConfigParseCompleted(); |
| | | } |
| | | else |
| | | { |
| | | rawDatas[id] = line; |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | Debug.LogError(ex); |
| | | } |
| | | } |
| | | |
| | | inited = true; |
| | | }); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //--------------------------------------------------------
|
| | | // [Author]: Fish
|
| | | // [ Date ]: 2023年10月7日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | | using System.IO;
|
| | | using System.Threading;
|
| | | using System;
|
| | | using UnityEngine;
|
| | |
|
| | | public partial class SkyTowerServerChallengeConfig
|
| | | {
|
| | |
|
| | | public readonly int floorId;
|
| | | public readonly string passRankRewardInfo;
|
| | | public readonly string serverRewardInfo;
|
| | |
|
| | | public SkyTowerServerChallengeConfig()
|
| | | {
|
| | | }
|
| | |
|
| | | public SkyTowerServerChallengeConfig(string input)
|
| | | {
|
| | | try
|
| | | {
|
| | | var tables = input.Split('\t');
|
| | |
|
| | | int.TryParse(tables[0],out floorId); |
| | |
|
| | | passRankRewardInfo = tables[1];
|
| | |
|
| | | serverRewardInfo = tables[2];
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | DebugEx.Log(ex);
|
| | | }
|
| | | }
|
| | |
|
| | | static Dictionary<string, SkyTowerServerChallengeConfig> configs = new Dictionary<string, SkyTowerServerChallengeConfig>();
|
| | | public static SkyTowerServerChallengeConfig Get(string id)
|
| | | { |
| | | if (!inited)
|
| | | {
|
| | | Debug.Log("SkyTowerServerChallengeConfig 还未完成初始化。");
|
| | | return null;
|
| | | }
|
| | | |
| | | if (configs.ContainsKey(id))
|
| | | {
|
| | | return configs[id];
|
| | | }
|
| | |
|
| | | SkyTowerServerChallengeConfig config = null;
|
| | | if (rawDatas.ContainsKey(id))
|
| | | {
|
| | | config = configs[id] = new SkyTowerServerChallengeConfig(rawDatas[id]);
|
| | | rawDatas.Remove(id);
|
| | | }
|
| | |
|
| | | return config;
|
| | | }
|
| | |
|
| | | public static SkyTowerServerChallengeConfig 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<SkyTowerServerChallengeConfig> GetValues()
|
| | | {
|
| | | var values = new List<SkyTowerServerChallengeConfig>();
|
| | | values.AddRange(configs.Values);
|
| | |
|
| | | var keys = new List<string>(rawDatas.Keys);
|
| | | for (int i = 0; i < keys.Count; i++)
|
| | | {
|
| | | values.Add(Get(keys[i]));
|
| | | }
|
| | |
|
| | | 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 +"/SkyTowerServerChallenge.txt";
|
| | | }
|
| | | else
|
| | | {
|
| | | path = AssetVersionUtility.GetAssetFilePath("config/SkyTowerServerChallenge.txt");
|
| | | }
|
| | |
|
| | | configs.Clear();
|
| | | var tempConfig = new SkyTowerServerChallengeConfig();
|
| | | 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 SkyTowerServerChallengeConfig(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 SkyTowerServerChallengeConfig(line);
|
| | | configs[id] = config;
|
| | | (config as IConfigPostProcess).OnConfigParseCompleted();
|
| | | }
|
| | | else
|
| | | {
|
| | | rawDatas[id] = line;
|
| | | }
|
| | | }
|
| | | catch (System.Exception ex)
|
| | | {
|
| | | Debug.LogError(ex);
|
| | | }
|
| | | }
|
| | |
|
| | | inited = true;
|
| | | });
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
| | | fileFormatVersion: 2 |
| | | guid: 48c5917195f003d41bad1b2535b8df0b |
| | | timeCreated: 1583404656 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Thursday, May 03, 2018
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using UnityEngine;
|
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using LitJson;
|
| | | using System.Linq;
|
| | |
|
| | | public partial class SkyTowerServerChallengeConfig : IConfigPostProcess
|
| | | {
|
| | | public static Dictionary<int, Dictionary<int, int[][]>> floorRankAwards = new Dictionary<int, Dictionary<int, int[][]>>();
|
| | | public static Dictionary<int, Dictionary<int, int[][]>> floorPassAwards = new Dictionary<int, Dictionary<int, int[][]>>();
|
| | |
|
| | | public void OnConfigParseCompleted()
|
| | | {
|
| | | var jsonCF = JsonMapper.ToObject(passRankRewardInfo);
|
| | | var keyList = jsonCF.Keys.ToList();
|
| | | var rankAwards = new Dictionary<int, int[][]>();
|
| | | for (int i = 0; i < keyList.Count; i++)
|
| | | {
|
| | | var key = keyList[i];
|
| | | var rankIndex = int.Parse(key);
|
| | | rankAwards[rankIndex] = JsonMapper.ToObject<int[][]>(jsonCF[key].ToJson());
|
| | |
|
| | | }
|
| | | floorRankAwards[floorId] = rankAwards;
|
| | |
|
| | | jsonCF = JsonMapper.ToObject(serverRewardInfo);
|
| | | var passAwards = new Dictionary<int, int[][]>();
|
| | | keyList = jsonCF.Keys.ToList();
|
| | | for (int i = 0; i < keyList.Count; i++)
|
| | | {
|
| | | var key = keyList[i];
|
| | | var passIndex = int.Parse(key);
|
| | | passAwards[passIndex] = JsonMapper.ToObject<int[][]>(jsonCF[key].ToJson());
|
| | | }
|
| | | floorPassAwards[floorId] = passAwards;
|
| | | }
|
| | |
|
| | | //获取排名最近的奖励
|
| | | public static int[][] GetRankAwards(int floorId, int rank)
|
| | | {
|
| | | if (floorRankAwards.ContainsKey(floorId))
|
| | | {
|
| | | var rankAwards = floorRankAwards[floorId];
|
| | | var keyList = rankAwards.Keys.ToList();
|
| | | keyList.Sort();
|
| | | for (int i = 0; i < keyList.Count; i++)
|
| | | {
|
| | | var key = keyList[i];
|
| | | if (rank <= key)
|
| | | {
|
| | | return rankAwards[key];
|
| | | }
|
| | | }
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | //获取全服通关奖励
|
| | | public static int[][] GetPassAwards(int floorId, int passIndex)
|
| | | {
|
| | | if (floorPassAwards.ContainsKey(floorId))
|
| | | {
|
| | | var passAwards = floorPassAwards[floorId];
|
| | | return passAwards[passIndex];
|
| | | }
|
| | | return null;
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 68e9f79a8c5d1b94891cd906540c2062 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using Snxxz.UI;
|
| | |
|
| | | // A9 AD 通知天星塔全服奖励通关玩家信息 #tagGCSkyTowerPassPlayerInfo
|
| | |
|
| | | public class DTCA9AD_tagGCSkyTowerPassPlayerInfo : DtcBasic {
|
| | |
|
| | | SkyTowerModel model { get { return ModelCenter.Instance.GetModel<SkyTowerModel>(); } }
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HA9AD_tagGCSkyTowerPassPlayerInfo vNetData = vNetPack as HA9AD_tagGCSkyTowerPassPlayerInfo;
|
| | | model.OnGetSkyTowerPassPlayerInfo(vNetData);
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 4817affc723f36842941b1165043af77 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A9 AD 通知天星塔全服奖励通关玩家信息 #tagGCSkyTowerPassPlayerInfo
|
| | |
|
| | | public class HA9AD_tagGCSkyTowerPassPlayerInfo : GameNetPackBasic {
|
| | | public ushort FloorCount;
|
| | | public tagGCSkyTowerPassFloor[] PassFloorList; // 通关塔层信息列表
|
| | | public ushort PlayerCount;
|
| | | public tagGCSkyTowerPassPlayer[] PassPlayerList; // 通关玩家信息列表
|
| | |
|
| | | public HA9AD_tagGCSkyTowerPassPlayerInfo () {
|
| | | _cmd = (ushort)0xA9AD;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out FloorCount, vBytes, NetDataType.WORD);
|
| | | PassFloorList = new tagGCSkyTowerPassFloor[FloorCount];
|
| | | for (int i = 0; i < FloorCount; i ++) {
|
| | | PassFloorList[i] = new tagGCSkyTowerPassFloor();
|
| | | TransBytes (out PassFloorList[i].FloorID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out PassFloorList[i].PassPlayerCount, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out PassFloorList[i].PassPlayerIDList, vBytes, NetDataType.DWORD, PassFloorList[i].PassPlayerCount);
|
| | | }
|
| | | TransBytes (out PlayerCount, vBytes, NetDataType.WORD);
|
| | | PassPlayerList = new tagGCSkyTowerPassPlayer[PlayerCount];
|
| | | for (int i = 0; i < PlayerCount; i ++) {
|
| | | PassPlayerList[i] = new tagGCSkyTowerPassPlayer();
|
| | | TransBytes (out PassPlayerList[i].PlayerID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out PassPlayerList[i].PlayerName, vBytes, NetDataType.Chars, 33);
|
| | | TransBytes (out PassPlayerList[i].Job, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out PassPlayerList[i].LV, vBytes, NetDataType.WORD);
|
| | | TransBytes (out PassPlayerList[i].RealmLV, vBytes, NetDataType.WORD);
|
| | | }
|
| | | }
|
| | |
|
| | | public struct tagGCSkyTowerPassPlayer {
|
| | | public uint PlayerID;
|
| | | public string PlayerName;
|
| | | public byte Job;
|
| | | public ushort LV; //等级
|
| | | public ushort RealmLV; //境界
|
| | | }
|
| | |
|
| | | public struct tagGCSkyTowerPassFloor {
|
| | | public uint FloorID; // 层ID
|
| | | public byte PassPlayerCount; // 通关记录玩家数
|
| | | public uint[] PassPlayerIDList; // 通关记录玩家ID列表 [第1个通过玩家ID, 第2个, ...]
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 2d53831af3cbce54e94ec1e5ffa13e04 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // B2 13 天星塔通关层数 #tagMCSkyTowerInfo |
| | | |
| | | public class HB213_tagMCSkyTowerInfo : GameNetPackBasic { |
| | | public uint Floor; // 已通关层 |
| | | public byte RecordCount; |
| | | public uint[] ServerRewardRecord; //全服挑战层领奖记录值列表,按奖励记录二进制位存储是否已领取 |
| | | |
| | | public HB213_tagMCSkyTowerInfo () { |
| | | _cmd = (ushort)0xB213; |
| | | } |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | TransBytes (out Floor, vBytes, NetDataType.DWORD); |
| | | TransBytes (out RecordCount, vBytes, NetDataType.BYTE); |
| | | TransBytes (out ServerRewardRecord, vBytes, NetDataType.DWORD, RecordCount); |
| | | } |
| | | |
| | | } |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // B2 13 天星塔通关层数 #tagMCSkyTowerInfo
|
| | |
|
| | | public class HB213_tagMCSkyTowerInfo : GameNetPackBasic
|
| | | {
|
| | | public uint Floor; // 已通关层
|
| | | public ushort ServerRewardCount;
|
| | | public tagMCSkyTowerServerReward[] ServerRewardList; // 全服奖励领取记录列表,下发的层记录替换更新即可,领奖记录没有变化时服务端不会下发
|
| | |
|
| | | public HB213_tagMCSkyTowerInfo()
|
| | | {
|
| | | _cmd = (ushort)0xB213;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes(byte[] vBytes)
|
| | | {
|
| | | TransBytes(out Floor, vBytes, NetDataType.DWORD);
|
| | | TransBytes(out ServerRewardCount, vBytes, NetDataType.WORD);
|
| | | ServerRewardList = new tagMCSkyTowerServerReward[ServerRewardCount];
|
| | | for (int i = 0; i < ServerRewardCount; i++)
|
| | | {
|
| | | ServerRewardList[i] = new tagMCSkyTowerServerReward();
|
| | | TransBytes(out ServerRewardList[i].Floor, vBytes, NetDataType.DWORD);
|
| | | TransBytes(out ServerRewardList[i].ServerRewardRecord, vBytes, NetDataType.DWORD);
|
| | | }
|
| | | }
|
| | |
|
| | | public struct tagMCSkyTowerServerReward
|
| | | {
|
| | | public uint Floor; // 全服奖励层ID
|
| | | public uint ServerRewardRecord; //该层全服领奖记录,按所需人数作为二进制位进行位运算判断是否已领取
|
| | | }
|
| | |
|
| | | } |
| | |
| | | using Snxxz.UI; |
| | | using UnityEngine; |
| | | using UnityEngine.Events; |
| | | |
| | | public class GA_NpcFightBoss : GA_NpcFightNorm |
| | | { |
| | | /// <summary> |
| | | /// 1. 实例ID, 2. Npc表ID |
| | | /// </summary> |
| | | public static UnityAction<uint, int, bool> s_OnSelect; |
| | | /// <summary> |
| | | /// 1. 实例ID, 2. Npc表ID, 3.当前血量, 4. 总血量 |
| | | /// </summary> |
| | | public static UnityAction<uint, int, ulong, ulong> s_HpRefresh; |
| | | |
| | | protected override void OnInit(GameNetPackBasic package) |
| | | { |
| | | base.OnInit(package); |
| | | } |
| | | |
| | | protected sealed override void OnMainModelLoaded() |
| | | { |
| | | base.OnMainModelLoaded(); |
| | | |
| | | GA_Hero _hero = PlayerDatas.Instance.hero; |
| | | if (_hero != null) |
| | | { |
| | | destForward = Forward = MathUtility.ForwardXZ(_hero.Pos, Pos); |
| | | } |
| | | } |
| | | |
| | | public sealed override void OnSelect() |
| | | { |
| | | if (ActorInfo.serverDie) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | SelectionManager.Request(SelectionManager.E_Type.Red, this); |
| | | RequestName(); |
| | | if (s_OnSelect != null) |
| | | { |
| | | s_OnSelect(ServerInstID, NpcConfig.NPCID, true); |
| | | } |
| | | } |
| | | |
| | | public sealed override void OnUnSelect() |
| | | { |
| | | SelectionManager.Release(SelectionManager.E_Type.Red); |
| | | |
| | | if (s_OnSelect != null) |
| | | { |
| | | s_OnSelect(ServerInstID, NpcConfig.NPCID, false); |
| | | } |
| | | } |
| | | |
| | | public sealed override void RequestDialogueBubble() |
| | | { |
| | | if (m_DialogAppear) |
| | | { |
| | | NPCDialogueBubble.Recyle(m_DialogAppear); |
| | | } |
| | | } |
| | | |
| | | protected override sealed void UpdateTimeDialogueBubble() |
| | | { |
| | | if (!MP_Stun) |
| | | { |
| | | return; |
| | | } |
| | | // 瞎BB逻辑 |
| | | if (Time.realtimeSinceStartup - m_LastTalkTime > 5) |
| | | { |
| | | if (m_DialogTiming != null) |
| | | { |
| | | NPCDialogueBubble.Recyle(m_DialogTiming); |
| | | } |
| | | m_DialogTiming = NPCDialogueBubble.TimingShow(NpcConfig.NPCID, MP_Stun, CameraController.Instance.CameraObject); |
| | | m_LastTalkTime = Time.realtimeSinceStartup; |
| | | } |
| | | } |
| | | |
| | | public override void RefreshLifeBar(ulong value) |
| | | { |
| | | var _hero = PlayerDatas.Instance.hero; |
| | | if ((_hero != null |
| | | && _hero.SelectTarget == this) |
| | | || ModelCenter.Instance.GetModel<HazyDemonKingModel>().IsInDungeon) |
| | | { |
| | | // 非选中状态下不刷新 |
| | | if (s_HpRefresh != null) |
| | | { |
| | | s_HpRefresh(ServerInstID, NpcConfig.NPCID, ActorInfo.RealHp, ActorInfo.RealMaxHp); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private float m_LastPlayTime; |
| | | |
| | | public sealed override void PlayHurtAudio(GActorFight attacker) |
| | | { |
| | | base.PlayHurtAudio(attacker); |
| | | |
| | | if (Time.time - m_LastPlayTime > GeneralDefine.PlayBossHurtInterval) |
| | | { |
| | | if (m_AudioSource) |
| | | { |
| | | if (NpcConfig.Sounds != null) |
| | | { |
| | | if (NpcConfig.Sounds.Length > 1) |
| | | { |
| | | SoundPlayer.Instance.PlayAudio(m_AudioSource, NpcConfig.Sounds[1]); |
| | | } |
| | | } |
| | | } |
| | | |
| | | m_LastPlayTime = Time.time; |
| | | } |
| | | |
| | | } |
| | | public override void RequestName() |
| | | { |
| | | ReleaseName(); |
| | | |
| | | // 天星塔冠名 |
| | | if (PlayerDatas.Instance.baseData.MapID == SkyTowerModel.DATA_MAPID) |
| | | { |
| | | if (SkyTowerServerChallengeConfig.Has(ModelCenter.Instance.GetModel<SkyTowerModel>().currentFloor)) |
| | | { |
| | | HeadUpName.Pattern _pattern = HeadUpName.Pattern.Monster; |
| | | m_HeadUpName = HeadUpName.RequireHeadUpName(_pattern, MP_Name, 0, CameraController.Instance.CameraObject); |
| | | m_HeadUpName.SetSkyTowerChanllengeName(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | #region Boss类型不需要实现的方法, 覆盖掉父类 |
| | | public sealed override void RequestLifeBar() { } |
| | | public sealed override void ReleaseLifeBar() { } |
| | | #endregion |
| | | } |
| | | using Snxxz.UI;
|
| | | using UnityEngine;
|
| | | using UnityEngine.Events;
|
| | |
|
| | | public class GA_NpcFightBoss : GA_NpcFightNorm
|
| | | {
|
| | | /// <summary>
|
| | | /// 1. 实例ID, 2. Npc表ID
|
| | | /// </summary>
|
| | | public static UnityAction<uint, int, bool> s_OnSelect;
|
| | | /// <summary>
|
| | | /// 1. 实例ID, 2. Npc表ID, 3.当前血量, 4. 总血量
|
| | | /// </summary>
|
| | | public static UnityAction<uint, int, ulong, ulong> s_HpRefresh;
|
| | |
|
| | | protected override void OnInit(GameNetPackBasic package)
|
| | | {
|
| | | base.OnInit(package);
|
| | | }
|
| | |
|
| | | protected sealed override void OnMainModelLoaded()
|
| | | {
|
| | | base.OnMainModelLoaded();
|
| | |
|
| | | GA_Hero _hero = PlayerDatas.Instance.hero;
|
| | | if (_hero != null)
|
| | | {
|
| | | destForward = Forward = MathUtility.ForwardXZ(_hero.Pos, Pos);
|
| | | }
|
| | | }
|
| | |
|
| | | public sealed override void OnSelect()
|
| | | {
|
| | | if (ActorInfo.serverDie)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | SelectionManager.Request(SelectionManager.E_Type.Red, this);
|
| | | RequestName();
|
| | | if (s_OnSelect != null)
|
| | | {
|
| | | s_OnSelect(ServerInstID, NpcConfig.NPCID, true);
|
| | | }
|
| | | }
|
| | |
|
| | | public sealed override void OnUnSelect()
|
| | | {
|
| | | SelectionManager.Release(SelectionManager.E_Type.Red);
|
| | |
|
| | | if (s_OnSelect != null)
|
| | | {
|
| | | s_OnSelect(ServerInstID, NpcConfig.NPCID, false);
|
| | | }
|
| | | }
|
| | |
|
| | | public sealed override void RequestDialogueBubble()
|
| | | {
|
| | | if (m_DialogAppear)
|
| | | {
|
| | | NPCDialogueBubble.Recyle(m_DialogAppear);
|
| | | }
|
| | | }
|
| | |
|
| | | protected override sealed void UpdateTimeDialogueBubble()
|
| | | {
|
| | | if (!MP_Stun)
|
| | | {
|
| | | return;
|
| | | }
|
| | | // 瞎BB逻辑
|
| | | if (Time.realtimeSinceStartup - m_LastTalkTime > 5)
|
| | | {
|
| | | if (m_DialogTiming != null)
|
| | | {
|
| | | NPCDialogueBubble.Recyle(m_DialogTiming);
|
| | | }
|
| | | m_DialogTiming = NPCDialogueBubble.TimingShow(NpcConfig.NPCID, MP_Stun, CameraController.Instance.CameraObject);
|
| | | m_LastTalkTime = Time.realtimeSinceStartup;
|
| | | }
|
| | | }
|
| | |
|
| | | public override void RefreshLifeBar(ulong value)
|
| | | {
|
| | | var _hero = PlayerDatas.Instance.hero;
|
| | | if ((_hero != null
|
| | | && _hero.SelectTarget == this)
|
| | | || ModelCenter.Instance.GetModel<HazyDemonKingModel>().IsInDungeon)
|
| | | {
|
| | | // 非选中状态下不刷新
|
| | | if (s_HpRefresh != null)
|
| | | {
|
| | | s_HpRefresh(ServerInstID, NpcConfig.NPCID, ActorInfo.RealHp, ActorInfo.RealMaxHp);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private float m_LastPlayTime;
|
| | |
|
| | | public sealed override void PlayHurtAudio(GActorFight attacker)
|
| | | {
|
| | | base.PlayHurtAudio(attacker);
|
| | |
|
| | | if (Time.time - m_LastPlayTime > GeneralDefine.PlayBossHurtInterval)
|
| | | {
|
| | | if (m_AudioSource)
|
| | | {
|
| | | if (NpcConfig.Sounds != null)
|
| | | {
|
| | | if (NpcConfig.Sounds.Length > 1)
|
| | | {
|
| | | SoundPlayer.Instance.PlayAudio(m_AudioSource, NpcConfig.Sounds[1]);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | m_LastPlayTime = Time.time;
|
| | | }
|
| | |
|
| | | }
|
| | | public override void RequestName()
|
| | | {
|
| | | ReleaseName();
|
| | | }
|
| | |
|
| | | #region Boss类型不需要实现的方法, 覆盖掉父类
|
| | | public sealed override void RequestLifeBar() { }
|
| | | public sealed override void ReleaseLifeBar() { }
|
| | | #endregion
|
| | | }
|
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Tuesday, October 31, 2017
|
| | | //--------------------------------------------------------
|
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | | using UnityEngine.UI;
|
| | | using System.Collections.Generic;
|
| | | using System.Linq;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | //显示当前层奖励,并且显示下一个目标层的额外奖励
|
| | | public class SkyTowerRewardPreviewGroup : MonoBehaviour
|
| | | {
|
| | | [SerializeField] ItemBehaviour[] m_ItemBehaviours;
|
| | | [SerializeField] ImageEx lineImg;
|
| | | [SerializeField] Text tagetFloorTxt;
|
| | |
|
| | | SkyTowerModel model { get { return ModelCenter.Instance.GetModel<SkyTowerModel>(); } }
|
| | | public void Display(List<Item> _items)
|
| | | {
|
| | | for (int i = 0; i < m_ItemBehaviours.Length; i++)
|
| | | {
|
| | | var behaviour = m_ItemBehaviours[i];
|
| | | if (i < _items.Count)
|
| | | {
|
| | | behaviour.SetActive(true);
|
| | | behaviour.SetItem(_items[i]);
|
| | | }
|
| | | else
|
| | | {
|
| | | behaviour.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | public void Display(Int2[] rewards)
|
| | | {
|
| | | if (rewards == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | var items = new List<Item>();
|
| | | foreach (var reward in rewards)
|
| | | {
|
| | | items.Add(new Item(reward.x, reward.y));
|
| | | }
|
| | |
|
| | | Display(items);
|
| | |
|
| | | var nextTarget = model.GetNextRewardShowFloor();
|
| | | if (nextTarget == 0 || nextTarget == model.currentFloor) |
| | | { |
| | | lineImg.SetActive(false); |
| | | }
|
| | | else
|
| | | {
|
| | | lineImg.SetActive(true);
|
| | | tagetFloorTxt.text = Language.Get("SkyTowerChallenge1", nextTarget);
|
| | | //特殊奖励倒序显示
|
| | | var config = SkyTowerConfig.Get(nextTarget);
|
| | | var tagetAwards = config.rewards.Reverse().ToArray();
|
| | | for (int i = 0; i < tagetAwards.Length; i++)
|
| | | {
|
| | | if (i >= config.rewardShow)
|
| | | break;
|
| | |
|
| | | var behaviour = m_ItemBehaviours[m_ItemBehaviours.Length - 1 - i];
|
| | | behaviour.SetActive(true);
|
| | | behaviour.SetItem(new Item(tagetAwards[i].x, tagetAwards[i].y));
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1d4f81aeb00c9c14f8e2bb52a1c4b80f |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class SkyTowerChallengeRankCell : CellView
|
| | | {
|
| | | [SerializeField] Text rank;
|
| | | [SerializeField] ImageEx headIcon;
|
| | | [SerializeField] ImageEx realmImg;
|
| | | [SerializeField] Text playerName;
|
| | |
|
| | | SkyTowerModel model { get { return ModelCenter.Instance.GetModel<SkyTowerModel>(); } }
|
| | | public void Display(int index)
|
| | | {
|
| | | int chooseFloor = model.ChallengeFloors[model.chooseFloorIndex];
|
| | | var playerIDs = model.rankFloorPlayerIDs[chooseFloor];
|
| | | int playerID = (int)playerIDs[index];
|
| | |
|
| | | rank.text = (index + 1).ToString();
|
| | | var playerInfo = model.GetPlayerInfo(chooseFloor, playerID);
|
| | | headIcon.SetSprite(GeneralDefine.GetJobHeadPortrait(playerInfo.Job, 0));
|
| | | RealmConfig presentCfg = RealmConfig.Get(playerInfo.Realm);
|
| | | realmImg.SetSprite(presentCfg.Img);
|
| | | playerName.text = playerInfo.Name;
|
| | |
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 9b448424300de104c900788b6c713a35 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using System; |
| | | |
| | | using System.Linq;
|
| | |
|
| | | namespace Snxxz.UI |
| | | { |
| | | |
| | | |
| | | public class SkyTowerModel : Model, IPlayerLoginOk, ISwitchAccount |
| | | public class SkyTowerModel : Model, IPlayerLoginOk, ISwitchAccount,IBeforePlayerDataInitialize |
| | | { |
| | | public const int DATA_MAPID = 31370; |
| | | readonly static int REDPOINTID_01 = 21501; |
| | | readonly static int REDPOINTID_02 = 215; |
| | | readonly static int REDPOINTID_03 = 21503; |
| | | readonly static int FUNCTIONID = 164; |
| | | readonly static int REDPOINTID_04 = 21508; //天星塔挑战全服奖励 |
| | | |
| | | readonly static int REDPOINTID_04 = 21508; //天星塔挑战全服奖励外层 |
| | | readonly static int REDPOINTID_041 = 215080; //天星塔挑战全服1奖励 |
| | | readonly static int REDPOINTID_042 = 215081; //天星塔挑战全服5奖励 |
| | | public static int fullServerPassNum1 = 1; //全服通关人数指标 |
| | | public static int fullServerPassNum2 = 5; |
| | | public bool allPassed { |
| | | get { |
| | | return IsTopFloor(highestPassFloor); |
| | |
| | | return highestPassFloor + 1; |
| | | } |
| | | } |
| | | }
|
| | |
|
| | | int m_chooseFloorIndex = 0; //全服5奖励层 |
| | | public int chooseFloorIndex
|
| | | {
|
| | | get
|
| | | {
|
| | | return m_chooseFloorIndex;
|
| | | }
|
| | | set
|
| | | {
|
| | | m_chooseFloorIndex = value;
|
| | | OnChooseFloorIndexChange?.Invoke();
|
| | | }
|
| | | } |
| | | public event Action OnChooseFloorIndexChange; |
| | | |
| | | |
| | | bool redpointConfirm_01 = false; |
| | | bool redpointConfirm_02 = false; |
| | |
| | | Redpoint redpoint02 = new Redpoint(REDPOINTID_02); |
| | | public Redpoint redpoint03 = new Redpoint(REDPOINTID_03); |
| | | public Redpoint redpoint04 = new Redpoint(REDPOINTID_01, REDPOINTID_04); |
| | | |
| | | public Redpoint redpoint041 = new Redpoint(REDPOINTID_04, REDPOINTID_041); |
| | | public Redpoint redpoint042 = new Redpoint(REDPOINTID_04, REDPOINTID_042); |
| | | List<int> sortedFloors = new List<int>(); |
| | | //特殊奖励楼层 |
| | | Dictionary<int, int> rewardShowFloors = new Dictionary<int, int>(); |
| | | public List<int> ChallengeFloors = new List<int>(); |
| | | //上榜的玩家数据 玩家ID:玩家信息 |
| | | public Dictionary<int, ChallengeInfo> ChallengeInfoFloors = new Dictionary<int, ChallengeInfo>(); |
| | | List<int> serverRewardRecord = new List<int>(); |
| | | //排行榜数据 楼层:玩家ID列表 |
| | | public Dictionary<int, uint[]> rankFloorPlayerIDs = new Dictionary<int, uint[]>(); |
| | | //全服奖励领取记录 楼层:领取状态 |
| | | Dictionary<int,int> serverRewardRecord = new Dictionary<int, int>(); |
| | | public event Action OnChallengeState; |
| | | |
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } } |
| | |
| | | public override void Init() |
| | | { |
| | | ParseConfig(); |
| | | DTCA003_tagUniversalGameRecInfo.onGetUniversalGameInfo += OnGetUniversalGameInfo; |
| | | } |
| | | |
| | | public override void UnInit() |
| | | { |
| | | ChallengeInfoFloors.Clear(); |
| | | DTCA003_tagUniversalGameRecInfo.onGetUniversalGameInfo -= OnGetUniversalGameInfo; |
| | | |
| | | } |
| | | |
| | | public void RequestChallenge() |
| | |
| | | public void UpdateHighestPassFloor(HB213_tagMCSkyTowerInfo info) |
| | | { |
| | | highestPassFloor = (int)info.Floor; |
| | | for (int i = 0; i < info.ServerRewardRecord.Length; i++) |
| | | for (int i = 0; i < info.ServerRewardList.Length; i++) |
| | | { |
| | | serverRewardRecord.Add((int)info.ServerRewardRecord[i]); |
| | | serverRewardRecord[(int)info.ServerRewardList[i].Floor] = (int)info.ServerRewardList[i].ServerRewardRecord; |
| | | } |
| | | UpateRedpoint(); |
| | | if (OnChallengeState != null) |
| | |
| | | public void OnPlayerLoginOk() |
| | | { |
| | | UpateRedpoint(); |
| | | } |
| | | |
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | ChallengeInfoFloors.Clear(); |
| | | serverRewardRecord.Clear(); |
| | | rankFloorPlayerIDs.Clear(); |
| | | } |
| | | |
| | | public void OnSwitchAccount() |
| | |
| | | var configs = SkyTowerConfig.GetKeys(); |
| | | foreach (var item in configs) |
| | | { |
| | | sortedFloors.Add(int.Parse(item)); |
| | | var key = int.Parse(item); |
| | | sortedFloors.Add(key); |
| | | var config = SkyTowerConfig.Get(key); |
| | | if (config.rewardShow != 0)
|
| | | {
|
| | | rewardShowFloors[key] = config.rewardShow;
|
| | | } |
| | | } |
| | | |
| | | var challengeConfig = SkyTowerServerChallengeConfig.GetKeys(); |
| | |
| | | return true; |
| | | } |
| | | |
| | | //下一个最近的特殊奖励层 |
| | | public int GetNextRewardShowFloor() |
| | | {
|
| | | var floors = rewardShowFloors.Keys.ToList();
|
| | | floors.Sort();
|
| | | for (var i = 0; i < floors.Count; i++)
|
| | | {
|
| | | if (floors[i] >= currentFloor)
|
| | | {
|
| | | return floors[i];
|
| | | }
|
| | | }
|
| | |
|
| | | return 0;
|
| | | } |
| | | |
| | | |
| | | |
| | | private void UpdateChallengeInfoRedPoint() |
| | | { |
| | | redpoint04.state = RedPointState.None; |
| | | //challengeRewardRecord 和 ChallengeInfoFloors 红点,打开挑战最低一层 |
| | | foreach (var floorInfo in ChallengeInfoFloors) |
| | | redpoint041.state = RedPointState.None; |
| | | redpoint042.state = RedPointState.None; |
| | | foreach (var floorInfo in rankFloorPlayerIDs) |
| | | { |
| | | var config = SkyTowerServerChallengeConfig.Get(floorInfo.Key); |
| | | if (config == null) |
| | | continue; |
| | | if (CanGetChallengeReward(config.rewardRecordIndex)) |
| | | if (CanGetChallengeReward(floorInfo.Key, fullServerPassNum1)) |
| | | { |
| | | //可领取 |
| | | redpoint04.state = RedPointState.Simple; |
| | | return; |
| | | redpoint041.state = RedPointState.Simple; |
| | | }
|
| | | if (CanGetChallengeReward(floorInfo.Key, fullServerPassNum2)) |
| | | { |
| | | //可领取 |
| | | redpoint042.state = RedPointState.Simple; |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | public bool CanGetChallengeReward(int index) |
| | | { |
| | | //每个数按位存31个激活索引 |
| | | var listIndex = index / 31; |
| | | var bitIndex = index % 31; |
| | | |
| | | if (listIndex >= serverRewardRecord.Count) |
| | | public int GetChallengeAwardOrder()
|
| | | {
|
| | | foreach (var floorInfo in rankFloorPlayerIDs) |
| | | { |
| | | return false; |
| | | if (CanGetChallengeReward(floorInfo.Key, fullServerPassNum1)) |
| | | { |
| | | return 0; |
| | | }
|
| | | if (CanGetChallengeReward(floorInfo.Key, fullServerPassNum2)) |
| | | { |
| | | return 1; |
| | | } |
| | | } |
| | | |
| | | if (((int)Math.Pow(2, bitIndex) & serverRewardRecord[listIndex]) == 0) |
| | | return 0; |
| | | } |
| | | |
| | | public bool CanGetChallengeReward(int floor, int bitIndex) |
| | | { |
| | | if (!rankFloorPlayerIDs.ContainsKey(floor)) |
| | | return false; |
| | | var playerCnt = rankFloorPlayerIDs[floor].Length; |
| | | |
| | | //人数不达标无法领奖 |
| | | if (playerCnt < bitIndex) |
| | | return false; |
| | | |
| | | var state = serverRewardRecord.ContainsKey(floor) ? serverRewardRecord[floor] : 0; |
| | | |
| | | //每个数按位存31个激活索引 |
| | | if (((int)Math.Pow(2, bitIndex) & state) == 0) |
| | | { |
| | | return true; |
| | | } |
| | | return false; |
| | | }
|
| | |
|
| | | //0 不可领取 1 可领取 2 已领取
|
| | | public int CanGetChallengeRewardEx(int floor, int bitIndex) |
| | | { |
| | | if (!rankFloorPlayerIDs.ContainsKey(floor)) |
| | | return 0; |
| | | var playerCnt = rankFloorPlayerIDs[floor].Length; |
| | | |
| | | //人数不达标无法领奖 |
| | | if (playerCnt < bitIndex) |
| | | return 0; |
| | | |
| | | var state = serverRewardRecord.ContainsKey(floor) ? serverRewardRecord[floor] : 0; |
| | | |
| | | //每个数按位存31个激活索引 |
| | | if (((int)Math.Pow(2, bitIndex) & state) == 0) |
| | | { |
| | | return 1; |
| | | } |
| | | return 2; |
| | | } |
| | | |
| | | |
| | | private void OnGetUniversalGameInfo(HA003_tagUniversalGameRecInfo package) |
| | | public void OnGetSkyTowerPassPlayerInfo(HA9AD_tagGCSkyTowerPassPlayerInfo package) |
| | | { |
| | | if (package.Type == 10) |
| | | for (int i = 0; i < package.PassFloorList.Length; i++)
|
| | | { |
| | | for (int i = 0; i < package.Count; i++) |
| | | { |
| | | |
| | | int floorID = (int)package.UniversalGameRec[i].Value1; |
| | | ChallengeInfoFloors[floorID] = new ChallengeInfo() { |
| | | Name = package.UniversalGameRec[i].StrValue1, |
| | | PlayerID = (int)package.UniversalGameRec[i].Value2, |
| | | LV = (int)package.UniversalGameRec[i].Value3, |
| | | Job = (int)package.UniversalGameRec[i].Value4, |
| | | Realm = (int)package.UniversalGameRec[i].Value5, |
| | | }; |
| | | rankFloorPlayerIDs[(int)package.PassFloorList[i].FloorID] = package.PassFloorList[i].PassPlayerIDList; |
| | | } |
| | | for (int i = 0; i < package.PassPlayerList.Length; i++)
|
| | | {
|
| | | ChallengeInfoFloors[(int)package.PassPlayerList[i].PlayerID] = new ChallengeInfo()
|
| | | {
|
| | | Name = package.PassPlayerList[i].PlayerName.Trim().Replace("\0", ""),
|
| | | LV = package.PassPlayerList[i].LV,
|
| | | Job = package.PassPlayerList[i].Job,
|
| | | Realm = package.PassPlayerList[i].RealmLV,
|
| | | PlayerID = (int)package.PassPlayerList[i].PlayerID,
|
| | | }; |
| | | |
| | | UpateRedpoint(); |
| | | if (OnChallengeState != null) |
| | | OnChallengeState(); |
| | | } |
| | | |
| | | UpateRedpoint(); |
| | | if (OnChallengeState != null) |
| | | OnChallengeState(); |
| | | } |
| | | |
| | | public uint[] GetPlayerIDs(int floor) |
| | | {
|
| | | if (!rankFloorPlayerIDs.ContainsKey(floor))
|
| | | return new uint[0];
|
| | | return rankFloorPlayerIDs[floor];
|
| | | } |
| | | |
| | | //指定层挑战记录 |
| | | public ChallengeInfo GetChallengeFloorInfo(int floorID) |
| | | { |
| | | if (ChallengeInfoFloors.ContainsKey(floorID)) |
| | | { |
| | | return ChallengeInfoFloors[floorID]; |
| | | } |
| | | return new ChallengeInfo(); |
| | | public ChallengeInfo GetPlayerInfo(int floor, int index) |
| | | {
|
| | | if (!rankFloorPlayerIDs.ContainsKey(floor))
|
| | | return new ChallengeInfo();
|
| | | if (rankFloorPlayerIDs[floor].Length <= index)
|
| | | return new ChallengeInfo();
|
| | | var playerID = rankFloorPlayerIDs[floor][index];
|
| | | if (!ChallengeInfoFloors.ContainsKey((int)playerID))
|
| | | return new ChallengeInfo();
|
| | | return ChallengeInfoFloors[(int)playerID];
|
| | | } |
| | | |
| | | public struct ChallengeInfo |
| | | { |
| | | public string Name; |
| | | public int PlayerID; |
| | | public int LV; |
| | | public int Job; |
| | | public int Realm; |
| | | public int PlayerID; |
| | | } |
| | | } |
| | | } |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Friday, January 18, 2019 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | |
| | | public class SkyTowerServeChallengeCell : CellView |
| | | { |
| | | [SerializeField] Text m_Floor; |
| | | [SerializeField] Image m_RoleHead; |
| | | [SerializeField] Button m_RoleHeadBtn; |
| | | [SerializeField] Image m_FloorBG; |
| | | [SerializeField] Text m_RoleName; |
| | | [SerializeField] ItemCell m_Gift; |
| | | [SerializeField] Button m_GetGift; |
| | | [SerializeField] Text m_GetGiftText; |
| | | [SerializeField] SmoothMask m_SmoothMask; |
| | | |
| | | SkyTowerModel model { get { return ModelCenter.Instance.GetModel<SkyTowerModel>(); } } |
| | | RoleParticularModel particularModel { get { return ModelCenter.Instance.GetModel<RoleParticularModel>(); } } |
| | | |
| | | public void Display(int floorID) |
| | | { |
| | | m_Floor.text = Language.Get("SkyTowerChallenge2", floorID); |
| | | |
| | | var config = SkyTowerServerChallengeConfig.Get(floorID); |
| | | |
| | | ItemCellModel cellModel = new ItemCellModel(config.rewards[0].x, true, (ulong)config.rewards[0].y); |
| | | m_Gift.Init(cellModel); |
| | | m_Gift.button.RemoveAllListeners(); |
| | | m_Gift.button.AddListener(() => |
| | | { |
| | | ItemTipUtility.Show(config.rewards[0].x); |
| | | }); |
| | | |
| | | if (model.ChallengeInfoFloors.ContainsKey(floorID)) |
| | | { |
| | | var floorInfo = model.ChallengeInfoFloors[floorID]; |
| | | m_RoleHead.SetSprite(GeneralDefine.GetJobHeadPortrait(floorInfo.Job, 0)); |
| | | m_RoleName.text = UIHelper.AppendColor(TextColType.DarkGreen, floorInfo.Name); |
| | | m_FloorBG.material = m_SmoothMask.imageMaterials[0]; |
| | | |
| | | m_RoleHeadBtn.SetListener(() => { |
| | | particularModel.ViewRoleEquip(floorInfo.PlayerID); |
| | | }); |
| | | |
| | | if (model.CanGetChallengeReward(config.rewardRecordIndex)) |
| | | { |
| | | //可领取 |
| | | m_GetGift.SetColorful(m_GetGiftText, true); |
| | | m_GetGift.SetListener(() => |
| | | { |
| | | if (PlayerDatas.Instance.baseData.LV < 100) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("RuneSpecialHoleLevelError", 100); |
| | | return; |
| | | } |
| | | var pack = new CA504_tagCMPlayerGetReward(); |
| | | pack.RewardType = 31; |
| | | pack.DataEx = (uint)floorID; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | }); |
| | | m_GetGiftText.text = Language.Get("Z1043"); |
| | | m_GetGift.image.material = m_SmoothMask.imageMaterials[0]; |
| | | } |
| | | else |
| | | { |
| | | m_GetGift.SetColorful(m_GetGiftText, false); |
| | | m_GetGift.SetListener(() => { return; }); |
| | | m_GetGiftText.text = Language.Get("Z1044"); |
| | | m_GetGift.image.material = m_SmoothMask.imageMaterials[1]; |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | //未完成 |
| | | m_RoleHead.SetSprite("UnKnowIcon"); |
| | | m_RoleName.text = UIHelper.AppendColor(TextColType.Gray, Language.Get("L1046")); |
| | | m_FloorBG.material = m_SmoothMask.imageMaterials[1]; |
| | | m_GetGift.SetColorful(m_GetGiftText, false); |
| | | m_GetGift.SetListener(()=> { |
| | | SysNotifyMgr.Instance.ShowTip("SkyTowerChallenge1"); |
| | | }); |
| | | m_GetGiftText.text = Language.Get("Z1043"); |
| | | m_GetGift.image.material = m_SmoothMask.imageMaterials[1]; |
| | | |
| | | m_RoleHeadBtn.SetListener(() => { |
| | | SysNotifyMgr.Instance.ShowTip("SkyTowerChallenge1"); |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Friday, January 18, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class SkyTowerServeChallengeCell : CellView
|
| | | {
|
| | | [SerializeField] Text m_Floor;
|
| | | [SerializeField] Image m_RoleHead;
|
| | | [SerializeField] Button m_RoleHeadBtn;
|
| | | [SerializeField] Image m_FloorBG;
|
| | | [SerializeField] Text m_RoleName;
|
| | | [SerializeField] ItemCell m_Gift;
|
| | | [SerializeField] Button m_GetGift;
|
| | | [SerializeField] Text m_GetGiftText;
|
| | | [SerializeField] SmoothMask m_SmoothMask;
|
| | |
|
| | | SkyTowerModel model { get { return ModelCenter.Instance.GetModel<SkyTowerModel>(); } }
|
| | | RoleParticularModel particularModel { get { return ModelCenter.Instance.GetModel<RoleParticularModel>(); } }
|
| | |
|
| | | public void Display(int floorID)
|
| | | {
|
| | | m_Floor.text = Language.Get("SkyTowerChallenge2", floorID);
|
| | |
|
| | | var config = SkyTowerServerChallengeConfig.GetPassAwards(floorID, 1);
|
| | | var itemID = config[0][0];
|
| | | ItemCellModel cellModel = new ItemCellModel(itemID, true, (ulong)config[0][1]);
|
| | | m_Gift.Init(cellModel);
|
| | | m_Gift.button.RemoveAllListeners();
|
| | | m_Gift.button.AddListener(() =>
|
| | | {
|
| | | ItemTipUtility.Show(itemID);
|
| | | });
|
| | |
|
| | | if (model.rankFloorPlayerIDs.ContainsKey(floorID))
|
| | | {
|
| | | var floorInfo = model.GetPlayerInfo(floorID, 1);
|
| | | m_RoleHead.SetSprite(GeneralDefine.GetJobHeadPortrait(floorInfo.Job, 0));
|
| | | m_RoleName.text = UIHelper.AppendColor(TextColType.DarkGreen, floorInfo.Name);
|
| | | m_FloorBG.material = m_SmoothMask.imageMaterials[0];
|
| | |
|
| | | m_RoleHeadBtn.SetListener(() =>
|
| | | {
|
| | | particularModel.ViewRoleEquip(floorInfo.PlayerID);
|
| | | });
|
| | |
|
| | | if (model.CanGetChallengeReward(floorID, 1))
|
| | | {
|
| | | //可领取
|
| | | m_GetGift.SetColorful(m_GetGiftText, true);
|
| | | m_GetGift.SetListener(() =>
|
| | | {
|
| | | //if (PlayerDatas.Instance.baseData.LV < 100)
|
| | | //{
|
| | | // SysNotifyMgr.Instance.ShowTip("RuneSpecialHoleLevelError", 100);
|
| | | // return;
|
| | | //}
|
| | | var pack = new CA504_tagCMPlayerGetReward();
|
| | | pack.RewardType = 31;
|
| | | pack.DataEx = (uint)floorID;
|
| | | pack.DataExStr = "1";
|
| | | pack.DataExStrLen = (byte)pack.DataExStr.Length;
|
| | | GameNetSystem.Instance.SendInfo(pack);
|
| | | });
|
| | | m_GetGiftText.text = Language.Get("Z1043");
|
| | | m_GetGift.image.material = m_SmoothMask.imageMaterials[0];
|
| | | }
|
| | | else
|
| | | {
|
| | | m_GetGift.SetColorful(m_GetGiftText, false);
|
| | | m_GetGift.SetListener(() => { return; });
|
| | | m_GetGiftText.text = Language.Get("Z1044");
|
| | | m_GetGift.image.material = m_SmoothMask.imageMaterials[1];
|
| | | }
|
| | |
|
| | | }
|
| | | else
|
| | | {
|
| | | //未完成
|
| | | m_RoleHead.SetSprite("UnKnowIcon");
|
| | | m_RoleName.text = UIHelper.AppendColor(TextColType.Gray, Language.Get("L1046"));
|
| | | m_FloorBG.material = m_SmoothMask.imageMaterials[1];
|
| | | m_GetGift.SetColorful(m_GetGiftText, false);
|
| | | m_GetGift.SetListener(() =>
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("SkyTowerChallenge1");
|
| | | });
|
| | | m_GetGiftText.text = Language.Get("Z1043");
|
| | | m_GetGift.image.material = m_SmoothMask.imageMaterials[1];
|
| | |
|
| | | m_RoleHeadBtn.SetListener(() =>
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("SkyTowerChallenge1");
|
| | | });
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Friday, January 18, 2019 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | |
| | | public class SkyTowerServerGift : Window, SecondWindowInterface |
| | | { |
| | | [SerializeField] ScrollerController m_ChallengeScroll; |
| | | |
| | | SkyTowerModel model { get { return ModelCenter.Instance.GetModel<SkyTowerModel>(); } } |
| | | |
| | | public Button close { get; set; } |
| | | #region Built-in |
| | | protected override void BindController() |
| | | { |
| | | if (this is SecondWindowInterface) |
| | | { |
| | | var frame = this.GetComponentInChildren<SecondFrameLoader>(); |
| | | frame.Create(); |
| | | close = frame.GetComponentInChildren<Button>(); |
| | | } |
| | | } |
| | | |
| | | protected override void AddListeners() |
| | | { |
| | | close.AddListener(CloseClick); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | m_ChallengeScroll.OnRefreshCell += OnRefreshCell; |
| | | model.OnChallengeState += OnRefreshAllCell; |
| | | DisplayChallengeInfo(); |
| | | m_ChallengeScroll.JumpIndex(JumpIndex()); |
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | | { |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | m_ChallengeScroll.OnRefreshCell -= OnRefreshCell; |
| | | model.OnChallengeState -= OnRefreshAllCell; |
| | | } |
| | | |
| | | protected override void OnAfterClose() |
| | | { |
| | | } |
| | | |
| | | protected override void OnActived() |
| | | { |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | private int JumpIndex() |
| | | { |
| | | int index = 0; |
| | | foreach (var floorInfo in model.ChallengeInfoFloors) |
| | | { |
| | | int floorID = floorInfo.Key; |
| | | var config = SkyTowerServerChallengeConfig.Get(floorID); |
| | | if (model.CanGetChallengeReward(config.rewardRecordIndex)) |
| | | { |
| | | return index; |
| | | } |
| | | index++; |
| | | } |
| | | index = index == 0 ? 0 : index - 1; |
| | | return index; |
| | | } |
| | | |
| | | |
| | | private void DisplayChallengeInfo() |
| | | { |
| | | m_ChallengeScroll.Refresh(); |
| | | |
| | | foreach (var floorID in model.ChallengeFloors) |
| | | { |
| | | m_ChallengeScroll.AddCell(ScrollerDataType.Header, floorID); |
| | | } |
| | | m_ChallengeScroll.Restart(); |
| | | m_ChallengeScroll.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | | |
| | | private void OnRefreshAllCell() |
| | | { |
| | | m_ChallengeScroll.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | | |
| | | private void OnRefreshCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | if (type == ScrollerDataType.Header) |
| | | { |
| | | SkyTowerServeChallengeCell curCell = cell as SkyTowerServeChallengeCell; |
| | | curCell.Display(cell.index); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Friday, January 18, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using System.Reflection;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | |
| | | public class SkyTowerServerGift : Window, SecondWindowInterface
|
| | | {
|
| | | [SerializeField] ScrollerController m_ChallengeScroll;
|
| | | [SerializeField] FunctionButton m_Btn1;
|
| | | [SerializeField] FunctionButton m_Btn5;
|
| | | [SerializeField] FunctionButtonGroup btnGroup;
|
| | | [SerializeField] Transform m_Challenge5;
|
| | | [SerializeField] ScrollerController m_ChallengeRankScroll;
|
| | | [SerializeField] TextEx tagetTxt;
|
| | | [SerializeField] List<ItemCell> items;
|
| | | [SerializeField] ButtonEx getAward;
|
| | | [SerializeField] Image gotImg;
|
| | | [SerializeField] Text noRank;
|
| | | [SerializeField] ButtonEx rightBtn;
|
| | | [SerializeField] ButtonEx leftBtn;
|
| | | SkyTowerModel model { get { return ModelCenter.Instance.GetModel<SkyTowerModel>(); } }
|
| | |
|
| | |
|
| | | public Button close { get; set; }
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | if (this is SecondWindowInterface)
|
| | | {
|
| | | var frame = this.GetComponentInChildren<SecondFrameLoader>();
|
| | | frame.Create();
|
| | | close = frame.GetComponentInChildren<Button>();
|
| | | }
|
| | | }
|
| | | protected override void OnActived()
|
| | | {
|
| | | base.OnActived();
|
| | | btnGroup.TriggerByOrder(functionOrder);
|
| | | }
|
| | |
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | close.AddListener(CloseClick);
|
| | | m_Btn1.AddListener(Choose1);
|
| | | m_Btn5.AddListener(Choose5);
|
| | | rightBtn.AddListener(() => { |
| | | if (model.chooseFloorIndex < model.ChallengeFloors.Count - 1)
|
| | | model.chooseFloorIndex++;
|
| | | });
|
| | |
|
| | | leftBtn.AddListener(() =>
|
| | | {
|
| | | if (model.chooseFloorIndex > 0)
|
| | | model.chooseFloorIndex--;
|
| | | });
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | m_ChallengeScroll.OnRefreshCell += OnRefreshCell;
|
| | | m_ChallengeRankScroll.OnRefreshCell += OnRefreshRankCell;
|
| | | model.OnChallengeState += OnRefreshAllCell;
|
| | | model.OnChooseFloorIndexChange += OnChooseFloorIndexChange;
|
| | | Display();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | m_ChallengeScroll.OnRefreshCell -= OnRefreshCell;
|
| | | model.OnChallengeState -= OnRefreshAllCell;
|
| | | model.OnChooseFloorIndexChange -= OnChooseFloorIndexChange;
|
| | | m_ChallengeRankScroll.OnRefreshCell -= OnRefreshRankCell;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | |
|
| | |
|
| | | #endregion
|
| | |
|
| | | void OnChooseFloorIndexChange()
|
| | | {
|
| | | DisplayRankInfo();
|
| | | }
|
| | |
|
| | | void Display()
|
| | | {
|
| | | if (functionOrder == 0)
|
| | | {
|
| | | DisplayChallengeInfo();
|
| | | m_ChallengeScroll.JumpIndex(JumpIndex());
|
| | | }
|
| | | else
|
| | | {
|
| | | model.chooseFloorIndex = GetJumpChallenge5Floor();
|
| | | DisplayRankInfo();
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayRankInfo()
|
| | | {
|
| | | int chooseFloor = model.ChallengeFloors[model.chooseFloorIndex];
|
| | | var playerIDs = model.GetPlayerIDs(chooseFloor);
|
| | | if (playerIDs.Length == 0)
|
| | | {
|
| | | noRank.SetActive(true);
|
| | | m_ChallengeRankScroll.SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | | noRank.SetActive(false);
|
| | | m_ChallengeRankScroll.SetActive(true);
|
| | |
|
| | | m_ChallengeRankScroll.Refresh();
|
| | | for (int i = 0; i < playerIDs.Length; i++)
|
| | | {
|
| | | m_ChallengeRankScroll.AddCell(ScrollerDataType.Header, i);
|
| | | }
|
| | | m_ChallengeRankScroll.Restart();
|
| | | m_ChallengeRankScroll.m_Scorller.RefreshActiveCellViews();
|
| | | }
|
| | |
|
| | | tagetTxt.text = Language.Get("SkyTowerChallenge5", SkyTowerModel.fullServerPassNum2, chooseFloor, playerIDs.Length);
|
| | |
|
| | | for (int i = 0; i < items.Count; i++)
|
| | | {
|
| | | var awards = SkyTowerServerChallengeConfig.GetPassAwards(chooseFloor, SkyTowerModel.fullServerPassNum2);
|
| | | if (i < awards.Length)
|
| | | {
|
| | | items[i].SetActive(true);
|
| | | int itemID = awards[i][0];
|
| | | items[i].Init(new ItemCellModel(itemID, false, (ulong)awards[i][1]));
|
| | | items[i].button.AddListener(() => { |
| | | ItemTipUtility.Show(itemID);
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | items[i].SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | int state = model.CanGetChallengeRewardEx(chooseFloor, SkyTowerModel.fullServerPassNum2);
|
| | | getAward.SetActive(state == 1);
|
| | | getAward.AddListener(() => {
|
| | | var pack = new CA504_tagCMPlayerGetReward();
|
| | | pack.RewardType = 31;
|
| | | pack.DataEx = (uint)chooseFloor;
|
| | | pack.DataExStr = "5";
|
| | | pack.DataExStrLen = (byte)pack.DataExStr.Length;
|
| | | GameNetSystem.Instance.SendInfo(pack);
|
| | | });
|
| | | gotImg.SetActive(state == 2);
|
| | | }
|
| | |
|
| | | int GetJumpChallenge5Floor()
|
| | | {
|
| | | int chooseIndex = 0;
|
| | | foreach (var floorID in model.ChallengeFloors)
|
| | | {
|
| | | int state = model.CanGetChallengeRewardEx(floorID, 5);
|
| | | if (state < 2)
|
| | | {
|
| | | return chooseIndex;
|
| | | }
|
| | | chooseIndex++;
|
| | | }
|
| | | return chooseIndex - 1;
|
| | | }
|
| | |
|
| | | private int JumpIndex()
|
| | | {
|
| | | int index = 0;
|
| | | foreach (var floorInfo in model.rankFloorPlayerIDs)
|
| | | {
|
| | | int floorID = floorInfo.Key;
|
| | | if (model.CanGetChallengeReward(floorID, 1))
|
| | | {
|
| | | return index;
|
| | | }
|
| | | index++;
|
| | | }
|
| | | index = index == 0 ? 0 : index - 1;
|
| | | return index;
|
| | | }
|
| | |
|
| | |
|
| | | private void DisplayChallengeInfo()
|
| | | {
|
| | | m_ChallengeScroll.Refresh();
|
| | |
|
| | | foreach (var floorID in model.ChallengeFloors)
|
| | | {
|
| | | m_ChallengeScroll.AddCell(ScrollerDataType.Header, floorID);
|
| | | }
|
| | | m_ChallengeScroll.Restart();
|
| | | m_ChallengeScroll.m_Scorller.RefreshActiveCellViews();
|
| | | }
|
| | |
|
| | | private void OnRefreshAllCell()
|
| | | {
|
| | | m_ChallengeScroll.m_Scorller.RefreshActiveCellViews();
|
| | | DisplayRankInfo();
|
| | | }
|
| | |
|
| | | private void OnRefreshCell(ScrollerDataType type, CellView cell)
|
| | | {
|
| | | if (type == ScrollerDataType.Header)
|
| | | {
|
| | | SkyTowerServeChallengeCell curCell = cell as SkyTowerServeChallengeCell;
|
| | | curCell.Display(cell.index);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | private void OnRefreshRankCell(ScrollerDataType type, CellView cell)
|
| | | {
|
| | | var curCell = cell as SkyTowerChallengeRankCell;
|
| | | curCell.Display(cell.index);
|
| | |
|
| | | }
|
| | |
|
| | | private void Choose1()
|
| | | {
|
| | | m_ChallengeScroll.SetActive(true);
|
| | | m_Challenge5.SetActive(false);
|
| | | functionOrder = m_Btn1.order;
|
| | | Display();
|
| | | }
|
| | | private void Choose5()
|
| | | {
|
| | | m_ChallengeScroll.SetActive(false);
|
| | | m_Challenge5.SetActive(true);
|
| | | functionOrder = m_Btn5.order;
|
| | | Display();
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Friday, January 18, 2019 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | |
| | | public class SkyTowerWin : Window |
| | | { |
| | | [SerializeField] SkyTowerBehaviour m_TowerBehaviour; |
| | | |
| | | [SerializeField] Button m_ViewBoss; |
| | | [SerializeField] UIEffect m_ViewBossEffect; |
| | | [SerializeField] Button m_ViewReward; |
| | | [SerializeField] UIEffect m_ViewRewardEffect; |
| | | |
| | | [SerializeField] RectTransform m_BossContainer; |
| | | [SerializeField] PositionTween m_BossShowTween; |
| | | [SerializeField] Image m_BossRealm; |
| | | [SerializeField] Text m_BossName; |
| | | [SerializeField] Text m_BossLevel; |
| | | [SerializeField] RawImage m_BossPortrait; |
| | | [SerializeField] UIEffect m_BossEffect; |
| | | |
| | | [SerializeField] RectTransform m_RewardContainer; |
| | | [SerializeField] PositionTween m_RewardShowTween; |
| | | [SerializeField] RewardPreviewGroup m_RewardBehaviour; |
| | | |
| | | [SerializeField] RectTransform m_LevelContaienr; |
| | | [SerializeField] TextEx m_LevelLimit; |
| | | [SerializeField] RectTransform m_FightPowerContainer; |
| | | [SerializeField] TextEx m_FightPower; |
| | | |
| | | [SerializeField] Button m_Challenge; |
| | | [SerializeField] TextEx m_ChallengeTitle; |
| | | [SerializeField] ImageEx m_ChallengeImage; |
| | | |
| | | [SerializeField] Button m_Rank; |
| | | [SerializeField] Button m_Gift; |
| | | |
| | | SkyTowerModel model { get { return ModelCenter.Instance.GetModel<SkyTowerModel>(); } } |
| | | RankModel rankModel { get { return ModelCenter.Instance.GetModel<RankModel>(); } } |
| | | |
| | | ShowType showType = ShowType.None; |
| | | |
| | | #region Built-in |
| | | protected override void BindController() |
| | | { |
| | | } |
| | | |
| | | protected override void AddListeners() |
| | | { |
| | | m_Challenge.SetListener(Challenge); |
| | | m_ViewBoss.SetListener(() => { DisplayBossInfo(false); }); |
| | | m_ViewReward.SetListener(() => { DisplayRewardInfo(false); }); |
| | | m_Rank.SetListener(() => { |
| | | rankModel.jumpRankType = 5; |
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.GameRank); |
| | | }); |
| | | |
| | | m_Gift.SetListener(() => { |
| | | WindowJumpMgr.Instance.WindowJumpToEx("SkyTowerServerGift"); |
| | | }); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | showType = ShowType.None; |
| | | model.ConfirmRedpoint02(); |
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | | { |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | } |
| | | |
| | | protected override void OnAfterClose() |
| | | { |
| | | } |
| | | |
| | | protected override void OnActived() |
| | | { |
| | | base.OnActived(); |
| | | DisplayTowerInfo(); |
| | | DisplayChallengeButton(); |
| | | DisplayRewardInfo(false); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | private void DisplayTowerInfo() |
| | | { |
| | | m_TowerBehaviour.Display(); |
| | | } |
| | | |
| | | private void DisplayBossInfo(bool immediately) |
| | | { |
| | | if (showType == ShowType.Boss) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | showType = ShowType.Boss; |
| | | |
| | | m_BossContainer.SetActive(true); |
| | | m_RewardContainer.SetActive(false); |
| | | |
| | | m_ViewBoss.transform.localScale = Vector3.one; |
| | | m_ViewReward.transform.localScale = Vector3.one * 0.8f; |
| | | |
| | | m_ViewBossEffect.Play(); |
| | | m_ViewRewardEffect.Stop(); |
| | | m_BossEffect.Play(); |
| | | |
| | | var towerConfig = SkyTowerConfig.Get(model.currentFloor); |
| | | var npcConfig = NPCConfig.Get(towerConfig.bossId); |
| | | |
| | | if (npcConfig.Realm > 0 && RealmConfig.Has(npcConfig.Realm)) |
| | | { |
| | | m_BossRealm.SetActive(true); |
| | | var realmConfig = RealmConfig.Get(npcConfig.Realm); |
| | | m_BossRealm.SetSprite(realmConfig.Img); |
| | | } |
| | | else |
| | | { |
| | | m_BossRealm.SetActive(false); |
| | | } |
| | | |
| | | m_BossName.text = npcConfig.charName; |
| | | m_BossLevel.text = Language.Get("HeadUpName_Monster", npcConfig.NPCLV); |
| | | UI3DModelExhibition.Instance.ShowNPC(towerConfig.bossId, new Vector3(0, 30, 0), m_BossPortrait); |
| | | |
| | | if (immediately) |
| | | { |
| | | m_BossShowTween.SetEndState(); |
| | | } |
| | | else |
| | | { |
| | | m_BossShowTween.Play(); |
| | | } |
| | | } |
| | | |
| | | private void DisplayRewardInfo(bool immediately) |
| | | { |
| | | if (showType == ShowType.Reward) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | showType = ShowType.Reward; |
| | | |
| | | m_BossContainer.SetActive(false); |
| | | m_RewardContainer.SetActive(true); |
| | | |
| | | m_ViewBoss.transform.localScale = Vector3.one * 0.8f; |
| | | m_ViewReward.transform.localScale = Vector3.one; |
| | | |
| | | m_ViewBossEffect.Stop(); |
| | | m_ViewRewardEffect.Play(); |
| | | m_BossEffect.Stop(); |
| | | |
| | | var config = SkyTowerConfig.Get(model.currentFloor); |
| | | m_RewardBehaviour.Display(config.rewards); |
| | | |
| | | if (PlayerDatas.Instance.baseData.LV < config.levelLimit) |
| | | { |
| | | m_LevelContaienr.SetActive(true); |
| | | m_LevelLimit.text = config.levelLimit.ToString(); |
| | | m_LevelLimit.colorType = PlayerDatas.Instance.baseData.LV >= config.levelLimit ? TextColType.Green : TextColType.Red; |
| | | } |
| | | else |
| | | { |
| | | m_LevelContaienr.SetActive(false); |
| | | } |
| | | |
| | | if (PlayerDatas.Instance.baseData.LV >= config.levelLimit) |
| | | { |
| | | m_FightPowerContainer.SetActive(true); |
| | | var fightPower = NPCExConfig.Get(config.bossId).SuppressFightPower; |
| | | m_FightPower.text = fightPower.ToString(); |
| | | m_FightPower.colorType = PlayerDatas.Instance.baseData.FightPoint >= (ulong)fightPower ? TextColType.Green : TextColType.Red; |
| | | } |
| | | else |
| | | { |
| | | m_FightPowerContainer.SetActive(false); |
| | | } |
| | | |
| | | if (immediately) |
| | | { |
| | | m_RewardShowTween.SetEndState(); |
| | | } |
| | | else |
| | | { |
| | | m_RewardShowTween.Play(); |
| | | } |
| | | } |
| | | |
| | | private void DisplayChallengeButton() |
| | | { |
| | | m_ChallengeTitle.text = Language.Get(model.allPassed ? "SkyTower4" : "Multiple_Challenge"); |
| | | m_ChallengeImage.gray = !model.IsChallengable(); |
| | | } |
| | | |
| | | private void Challenge() |
| | | { |
| | | model.ConfirmRedpoint03(); |
| | | if (model.allPassed) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var config = SkyTowerConfig.Get(model.currentFloor); |
| | | var myFightPoint = PlayerDatas.Instance.baseData.FightPoint; |
| | | if (myFightPoint >= (ulong)NPCExConfig.Get(config.bossId).SuppressFightPower) |
| | | { |
| | | model.RequestChallenge(); |
| | | } |
| | | else |
| | | { |
| | | ConfirmCancel.ShowPopConfirm( |
| | | Language.Get("Mail101"), |
| | | Language.Get("RuneTower25", NPCExConfig.Get(config.bossId).SuppressFightPower), |
| | | (bool ok) => |
| | | { |
| | | if (ok) |
| | | { |
| | | model.RequestChallenge(); |
| | | } |
| | | } |
| | | ); |
| | | } |
| | | } |
| | | |
| | | public enum ShowType |
| | | { |
| | | None, |
| | | Boss, |
| | | Reward, |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Friday, January 18, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | |
| | | public class SkyTowerWin : Window
|
| | | {
|
| | | [SerializeField] SkyTowerBehaviour m_TowerBehaviour;
|
| | |
|
| | | [SerializeField] Button m_ViewBoss;
|
| | | [SerializeField] UIEffect m_ViewBossEffect;
|
| | | [SerializeField] Button m_ViewReward;
|
| | | [SerializeField] UIEffect m_ViewRewardEffect;
|
| | |
|
| | | [SerializeField] RectTransform m_BossContainer;
|
| | | [SerializeField] PositionTween m_BossShowTween;
|
| | | [SerializeField] Image m_BossRealm;
|
| | | [SerializeField] Text m_BossName;
|
| | | [SerializeField] Text m_BossLevel;
|
| | | [SerializeField] RawImage m_BossPortrait;
|
| | | [SerializeField] UIEffect m_BossEffect;
|
| | |
|
| | | [SerializeField] RectTransform m_RewardContainer;
|
| | | [SerializeField] PositionTween m_RewardShowTween;
|
| | | [SerializeField] SkyTowerRewardPreviewGroup m_RewardBehaviour;
|
| | |
|
| | | [SerializeField] RectTransform m_LevelContaienr;
|
| | | [SerializeField] TextEx m_LevelLimit;
|
| | | [SerializeField] RectTransform m_FightPowerContainer;
|
| | | [SerializeField] TextEx m_FightPower;
|
| | |
|
| | | [SerializeField] Button m_Challenge;
|
| | | [SerializeField] TextEx m_ChallengeTitle;
|
| | | [SerializeField] ImageEx m_ChallengeImage;
|
| | |
|
| | | [SerializeField] Button m_Rank;
|
| | | [SerializeField] Button m_Gift;
|
| | | [SerializeField] Button m_NewSuccess;
|
| | |
|
| | | SkyTowerModel model { get { return ModelCenter.Instance.GetModel<SkyTowerModel>(); } }
|
| | | RankModel rankModel { get { return ModelCenter.Instance.GetModel<RankModel>(); } }
|
| | |
|
| | | ShowType showType = ShowType.None;
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_Challenge.SetListener(Challenge);
|
| | | m_ViewBoss.SetListener(() => { DisplayBossInfo(false); });
|
| | | m_ViewReward.SetListener(() => { DisplayRewardInfo(false); });
|
| | | m_Rank.SetListener(() => {
|
| | | rankModel.jumpRankType = 5;
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.GameRank);
|
| | | });
|
| | |
|
| | | m_Gift.SetListener(() => {
|
| | | WindowJumpMgr.Instance.WindowJumpToEx("SkyTowerServerGift", 1, 0, model.GetChallengeAwardOrder());
|
| | | });
|
| | |
|
| | | m_NewSuccess.SetListener(() => {
|
| | | ILRuntimeUtility.Instance.ModelInvoke("ILAchievementModel", "SetJumpSuccessGroup", 201);
|
| | | WindowJumpMgr.Instance.WindowJumpToEx("NewAchievementActivityWin");
|
| | | });
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | showType = ShowType.None;
|
| | | model.ConfirmRedpoint02();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnActived()
|
| | | {
|
| | | base.OnActived();
|
| | | DisplayTowerInfo();
|
| | | DisplayChallengeButton();
|
| | | DisplayRewardInfo(false);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | private void DisplayTowerInfo()
|
| | | {
|
| | | m_TowerBehaviour.Display();
|
| | | }
|
| | |
|
| | | private void DisplayBossInfo(bool immediately)
|
| | | {
|
| | | if (showType == ShowType.Boss)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | showType = ShowType.Boss;
|
| | |
|
| | | m_BossContainer.SetActive(true);
|
| | | m_RewardContainer.SetActive(false);
|
| | |
|
| | | m_ViewBoss.transform.localScale = Vector3.one;
|
| | | m_ViewReward.transform.localScale = Vector3.one * 0.8f;
|
| | |
|
| | | m_ViewBossEffect.Play();
|
| | | m_ViewRewardEffect.Stop();
|
| | | m_BossEffect.Play();
|
| | |
|
| | | var towerConfig = SkyTowerConfig.Get(model.currentFloor);
|
| | | var npcConfig = NPCConfig.Get(towerConfig.bossId);
|
| | |
|
| | | if (npcConfig.Realm > 0 && RealmConfig.Has(npcConfig.Realm))
|
| | | {
|
| | | m_BossRealm.SetActive(true);
|
| | | var realmConfig = RealmConfig.Get(npcConfig.Realm);
|
| | | m_BossRealm.SetSprite(realmConfig.Img);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_BossRealm.SetActive(false);
|
| | | }
|
| | |
|
| | | m_BossName.text = npcConfig.charName;
|
| | | m_BossLevel.text = Language.Get("HeadUpName_Monster", npcConfig.NPCLV);
|
| | | UI3DModelExhibition.Instance.ShowNPC(towerConfig.bossId, new Vector3(0, 30, 0), m_BossPortrait);
|
| | |
|
| | | if (immediately)
|
| | | {
|
| | | m_BossShowTween.SetEndState();
|
| | | }
|
| | | else
|
| | | {
|
| | | m_BossShowTween.Play();
|
| | | }
|
| | | }
|
| | |
|
| | | private void DisplayRewardInfo(bool immediately)
|
| | | {
|
| | | if (showType == ShowType.Reward)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | showType = ShowType.Reward;
|
| | |
|
| | | m_BossContainer.SetActive(false);
|
| | | m_RewardContainer.SetActive(true);
|
| | |
|
| | | m_ViewBoss.transform.localScale = Vector3.one * 0.8f;
|
| | | m_ViewReward.transform.localScale = Vector3.one;
|
| | |
|
| | | m_ViewBossEffect.Stop();
|
| | | m_ViewRewardEffect.Play();
|
| | | m_BossEffect.Stop();
|
| | |
|
| | | var config = SkyTowerConfig.Get(model.currentFloor);
|
| | | m_RewardBehaviour.Display(config.rewards);
|
| | |
|
| | | if (PlayerDatas.Instance.baseData.LV < config.levelLimit)
|
| | | {
|
| | | m_LevelContaienr.SetActive(true);
|
| | | m_LevelLimit.text = config.levelLimit.ToString();
|
| | | m_LevelLimit.colorType = PlayerDatas.Instance.baseData.LV >= config.levelLimit ? TextColType.Green : TextColType.Red;
|
| | | }
|
| | | else
|
| | | {
|
| | | m_LevelContaienr.SetActive(false);
|
| | | }
|
| | |
|
| | | if (PlayerDatas.Instance.baseData.LV >= config.levelLimit)
|
| | | {
|
| | | m_FightPowerContainer.SetActive(true);
|
| | | var fightPower = NPCExConfig.Get(config.bossId).SuppressFightPower;
|
| | | m_FightPower.text = fightPower.ToString();
|
| | | m_FightPower.colorType = PlayerDatas.Instance.baseData.FightPoint >= (ulong)fightPower ? TextColType.Green : TextColType.Red;
|
| | | }
|
| | | else
|
| | | {
|
| | | m_FightPowerContainer.SetActive(false);
|
| | | }
|
| | |
|
| | | if (immediately)
|
| | | {
|
| | | m_RewardShowTween.SetEndState();
|
| | | }
|
| | | else
|
| | | {
|
| | | m_RewardShowTween.Play();
|
| | | }
|
| | | }
|
| | |
|
| | | private void DisplayChallengeButton()
|
| | | {
|
| | | m_ChallengeTitle.text = Language.Get(model.allPassed ? "SkyTower4" : "Multiple_Challenge");
|
| | | m_ChallengeImage.gray = !model.IsChallengable();
|
| | | }
|
| | |
|
| | | private void Challenge()
|
| | | {
|
| | | model.ConfirmRedpoint03();
|
| | | if (model.allPassed)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | var config = SkyTowerConfig.Get(model.currentFloor);
|
| | | var myFightPoint = PlayerDatas.Instance.baseData.FightPoint;
|
| | | if (myFightPoint >= (ulong)NPCExConfig.Get(config.bossId).SuppressFightPower)
|
| | | {
|
| | | model.RequestChallenge();
|
| | | }
|
| | | else
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(
|
| | | Language.Get("Mail101"),
|
| | | Language.Get("RuneTower25", NPCExConfig.Get(config.bossId).SuppressFightPower),
|
| | | (bool ok) =>
|
| | | {
|
| | | if (ok)
|
| | | {
|
| | | model.RequestChallenge();
|
| | | }
|
| | | }
|
| | | );
|
| | | }
|
| | | }
|
| | |
|
| | | public enum ShowType
|
| | | {
|
| | | None,
|
| | | Boss,
|
| | | Reward,
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
| | | m_NpcAppearTxt.SetActive(!m_RebornTime.gameObject.activeSelf);
|
| | | }
|
| | |
|
| | | //天星塔冠名
|
| | | public void SetSkyTowerChanllengeName()
|
| | | {
|
| | | var info = skyTowerModel.GetChallengeFloorInfo(skyTowerModel.currentFloor);
|
| | | if (info.PlayerID == 0)
|
| | | {
|
| | | SetNpcRealm(999);
|
| | | m_PlayerName.text = Language.Get("SkyTowerChallenge4");
|
| | | }
|
| | | else
|
| | | {
|
| | | SetNpcRealm(info.Realm);
|
| | | m_PlayerName.text = Language.Get("SkyTowerChallenge3", info.Name);
|
| | | }
|
| | | if (m_IceCrystalScore != null)
|
| | | m_IceCrystalScore.SetActive(false);
|
| | |
|
| | | if (m_ElderAnger != null)
|
| | | m_ElderAnger.SetActive(false);
|
| | | }
|
| | | |
| | |
|
| | | public void SetMonsterInfo(int _npcId, int _level)
|
| | | {
|