Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
1 文件已重命名
29个文件已修改
1个文件已删除
9 文件已复制
18个文件已添加
| | |
| | | public static void Init()
|
| | | {
|
| | | // 登记相应的数据体及对应的数据转逻辑类
|
| | | Register(typeof(HB215_tagMCFBBuyBuffInfo), typeof(DTCB215_tagMCFBBuyBuffInfo));
|
| | | Register(typeof(HA718_tagMCCollectAwardItemInfo), typeof(DTCA718_tagMCCollectAwardItemInfo));
|
| | | Register(typeof(HB214_tagMCCuntomFBPrizeInfo), typeof(DTCB214_tagMCCuntomFBPrizeInfo));
|
| | | Register(typeof(HA307_tagMCFairyAdventuresInfo), typeof(DTCA307_tagMCFairyAdventuresInfo));
|
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: Fish |
| | | // [ Date ]: Tuesday, April 16, 2019 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System.IO; |
| | | using System.Threading; |
| | | using System; |
| | | using UnityEngine; |
| | | |
| | | [XLua.LuaCallCSharp] |
| | | public partial class DungeonUseBuffConfig |
| | | { |
| | | |
| | | public readonly int ID;
|
| | | public readonly int DataMapId;
|
| | | public readonly int MoneyCnt;
|
| | | public readonly int BuffID;
|
| | | public readonly int CD; |
| | | |
| | | public DungeonUseBuffConfig() |
| | | { |
| | | } |
| | | |
| | | public DungeonUseBuffConfig(string input) |
| | | { |
| | | try |
| | | { |
| | | var tables = input.Split('\t'); |
| | | |
| | | int.TryParse(tables[0],out ID); |
| | |
|
| | | int.TryParse(tables[1],out DataMapId); |
| | |
|
| | | int.TryParse(tables[2],out MoneyCnt); |
| | |
|
| | | int.TryParse(tables[3],out BuffID); |
| | |
|
| | | int.TryParse(tables[4],out CD); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | DebugEx.Log(ex); |
| | | } |
| | | } |
| | | |
| | | static Dictionary<string, DungeonUseBuffConfig> configs = new Dictionary<string, DungeonUseBuffConfig>(); |
| | | public static DungeonUseBuffConfig Get(string id) |
| | | { |
| | | if (!inited) |
| | | { |
| | | Debug.Log("DungeonUseBuffConfig 还未完成初始化。"); |
| | | return null; |
| | | } |
| | | |
| | | if (configs.ContainsKey(id)) |
| | | { |
| | | return configs[id]; |
| | | } |
| | | |
| | | DungeonUseBuffConfig config = null; |
| | | if (rawDatas.ContainsKey(id)) |
| | | { |
| | | config = configs[id] = new DungeonUseBuffConfig(rawDatas[id]); |
| | | rawDatas.Remove(id); |
| | | } |
| | | |
| | | return config; |
| | | } |
| | | |
| | | public static DungeonUseBuffConfig 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<DungeonUseBuffConfig> GetValues() |
| | | { |
| | | var values = new List<DungeonUseBuffConfig>(); |
| | | 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 +"/DungeonUseBuff.txt"; |
| | | } |
| | | else |
| | | { |
| | | path = AssetVersionUtility.GetAssetFilePath("config/DungeonUseBuff.txt"); |
| | | } |
| | | |
| | | var tempConfig = new DungeonUseBuffConfig(); |
| | | 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 DungeonUseBuffConfig(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 DungeonUseBuffConfig(line); |
| | | configs[id] = config; |
| | | (config as IConfigPostProcess).OnConfigParseCompleted(); |
| | | } |
| | | else |
| | | { |
| | | rawDatas[id] = line; |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | Debug.LogError(ex); |
| | | } |
| | | } |
| | | |
| | | inited = true; |
| | | }); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
copy from System/KnapSack/Logic/PetMatInfoWin.cs.meta
copy to Core/GameEngine/Model/Config/DungeonUseBuffConfig.cs.meta
| File was copied from System/KnapSack/Logic/PetMatInfoWin.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1ecb0731383014d44863af268e0d376c |
| | | timeCreated: 1525846932 |
| | | guid: 443e9762aa0f4cd4b8551575e1b8bbb9 |
| | | timeCreated: 1555415806 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public partial class HorseConfig : IConfigPostProcess |
| | | { |
| | | static Dictionary<int, int> itemUnlockHorseMap = new Dictionary<int, int>(); |
| | | |
| | | public void OnConfigParseCompleted() |
| | | { |
| | | itemUnlockHorseMap[UnlockItemID] = HorseID; |
| | | } |
| | | |
| | | public static int GetItemUnLockHorse(int itemId) |
| | | { |
| | | if (itemUnlockHorseMap.ContainsKey(itemId)) |
| | | { |
| | | return itemUnlockHorseMap[itemId]; |
| | | } |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | } |
| File was renamed from System/KnapSack/Logic/PetMatInfoWin.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1ecb0731383014d44863af268e0d376c |
| | | timeCreated: 1525846932 |
| | | guid: 4daa64ed63cb868418aef659f368c280 |
| | | timeCreated: 1555404468 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | |
|
| | | public partial class PetInfoConfig : IConfigPostProcess
|
| | | {
|
| | | public static Dictionary<int, List<PetSkillLimit>> petSkillDict = new Dictionary<int, List<PetSkillLimit>>();
|
| | | static Dictionary<int, List<PetSkillLimit>> petSkillDict = new Dictionary<int, List<PetSkillLimit>>();
|
| | | static Dictionary<int, int> itemUnlockPetMap = new Dictionary<int, int>();
|
| | |
|
| | | public void OnConfigParseCompleted()
|
| | | {
|
| | |
| | | lv = skillUnlocks[i],
|
| | | });
|
| | | }
|
| | |
|
| | | itemUnlockPetMap[UnLockNeedItemID] = ID;
|
| | | }
|
| | |
|
| | | public static void GetPetSkills(int petId, int lv, bool onlyAcitve, ref List<int> skills)
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | public static int GetItemUnLockPet(int itemId)
|
| | | {
|
| | | if (itemUnlockPetMap.ContainsKey(itemId))
|
| | | {
|
| | | return itemUnlockPetMap[itemId];
|
| | | }
|
| | |
|
| | | return 0;
|
| | | }
|
| | |
|
| | | public struct PetSkillLimit
|
| | | {
|
| | | public int skill;
|
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // B1 0A 副本购买buff #tagCMFBBuyBuff
|
| | |
|
| | | public class CB10A_tagCMFBBuyBuff : GameNetPackBasic {
|
| | | public uint MapID;
|
| | | public ushort MoneyCnt;
|
| | |
|
| | | public CB10A_tagCMFBBuyBuff () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xB10A;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (MapID, NetDataType.DWORD);
|
| | | WriteBytes (MoneyCnt, NetDataType.WORD);
|
| | | }
|
| | |
|
| | | }
|
copy from System/KnapSack/Logic/PetMatInfoWin.cs.meta
copy to Core/NetworkPackage/ClientPack/ClientToMapServer/CB1_ActionMap/CB10A_tagCMFBBuyBuff.cs.meta
| File was copied from System/KnapSack/Logic/PetMatInfoWin.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1ecb0731383014d44863af268e0d376c |
| | | timeCreated: 1525846932 |
| | | guid: 8ae3d7fd5cd37de44b90243da6d1c531 |
| | | timeCreated: 1555420339 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 3e05761d690b75440a6be79207d0fb01 |
| | | folderAsset: yes |
| | | timeCreated: 1547643019 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1d70ccd06161e0443b7a802ad94292f8 |
| | | folderAsset: yes |
| | | timeCreated: 1547643019 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 71e878ac60c49ad4f964dd2dbc725739 |
| | | folderAsset: yes |
| | | timeCreated: 1547643019 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: eed34091b0568664b9fb42f0634496c1 |
| | | folderAsset: yes |
| | | timeCreated: 1547643019 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Tuesday, April 16, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using Snxxz.UI;
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | |
|
| | | public class DTCB215_tagMCFBBuyBuffInfo : DtcBasic
|
| | | {
|
| | |
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | base.Done(vNetPack);
|
| | | var package = vNetPack as HB215_tagMCFBBuyBuffInfo;
|
| | | ModelCenter.Instance.GetModel<DungeonUseBuffModel>().ReceivePackage(package);
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
copy from System/KnapSack/Logic/PetMatInfoWin.cs.meta
copy to Core/NetworkPackage/DTCFile/ServerPack/HB2_ActionMap/DTCB215_tagMCFBBuyBuffInfo.cs.meta
| File was copied from System/KnapSack/Logic/PetMatInfoWin.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1ecb0731383014d44863af268e0d376c |
| | | timeCreated: 1525846932 |
| | | guid: 639360f931dc64a45bcb25f90776d4bd |
| | | timeCreated: 1555420417 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 32ceb8b7faf99f84a8b73ce53c5e3e4d |
| | | folderAsset: yes |
| | | timeCreated: 1547643019 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 77f69c2b862d1704299a32d0d8eeb71e |
| | | folderAsset: yes |
| | | timeCreated: 1547643019 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: fa14960fa44b0d1439bab471a764e34f |
| | | folderAsset: yes |
| | | timeCreated: 1547643019 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: d914565b65f8e8145988734c4d915834 |
| | | folderAsset: yes |
| | | timeCreated: 1547643019 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // B2 15 副本买buff信息通知 #tagMCFBBuyBuffInfo
|
| | |
|
| | | public class HB215_tagMCFBBuyBuffInfo : GameNetPackBasic {
|
| | | public byte Cnt;
|
| | | public tagMCFBBuyBuffTime[] InfoList;
|
| | |
|
| | | public HB215_tagMCFBBuyBuffInfo () {
|
| | | _cmd = (ushort)0xB215;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out Cnt, vBytes, NetDataType.BYTE);
|
| | | InfoList = new tagMCFBBuyBuffTime[Cnt];
|
| | | for (int i = 0; i < Cnt; i ++) {
|
| | | InfoList[i] = new tagMCFBBuyBuffTime();
|
| | | TransBytes (out InfoList[i].MapID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out InfoList[i].MoneyCnt, vBytes, NetDataType.WORD);
|
| | | TransBytes (out InfoList[i].BuyTime, vBytes, NetDataType.DWORD);
|
| | | }
|
| | | }
|
| | |
|
| | | public struct tagMCFBBuyBuffTime {
|
| | | public uint MapID;
|
| | | public ushort MoneyCnt;
|
| | | public uint BuyTime;
|
| | | }
|
| | |
|
| | | }
|
copy from System/KnapSack/Logic/PetMatInfoWin.cs.meta
copy to Core/NetworkPackage/ServerPack/HB2_ActionMap/HB215_tagMCFBBuyBuffInfo.cs.meta
| File was copied from System/KnapSack/Logic/PetMatInfoWin.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1ecb0731383014d44863af268e0d376c |
| | | timeCreated: 1525846932 |
| | | guid: 4c40e169a5e64ef44adfc36bd3da6cdd |
| | | timeCreated: 1555420384 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "GetPetSkillCondition", _m_GetPetSkillCondition_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "TryGetPetIdBySkill", _m_TryGetPetIdBySkill_xlua_st_); |
| | | |
| | | |
| | | |
| | | Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "inited", _g_get_inited); |
| | | Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "petSkillDict", _g_get_petSkillDict); |
| | | |
| | | Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "petSkillDict", _s_set_petSkillDict); |
| | | |
| | | |
| | | Utils.EndClassRegister(type, L, translator); |
| | | } |
| | | |
| | |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_petSkillDict(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | translator.Push(L, PetInfoConfig.petSkillDict); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _s_set_petSkillDict(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | PetInfoConfig.petSkillDict = (System.Collections.Generic.Dictionary<int, System.Collections.Generic.List<PetInfoConfig.PetSkillLimit>>)translator.GetObject(L, 1, typeof(System.Collections.Generic.Dictionary<int, System.Collections.Generic.List<PetInfoConfig.PetSkillLimit>>)); |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | Dictionary<int, int> petSkillDict;
|
| | | Dictionary<int, List<int>> mountSkillDict;
|
| | | private List<GameObject> tempObjlist = new List<GameObject>();
|
| | | PetMatType matType = PetMatType.None;
|
| | | PetOrMount matType = PetOrMount.None;
|
| | | PetModel petmodel { get { return ModelCenter.Instance.GetModel<PetModel>(); } }
|
| | | MountModel mountModel { get { return ModelCenter.Instance.GetModel<MountModel>(); } }
|
| | |
|
| | |
| | |
|
| | | private void InitUI()
|
| | | {
|
| | | matType = PetMatType.None;
|
| | | matType = PetOrMount.None;
|
| | | petSkillDict = null;
|
| | | mountSkillDict = null;
|
| | | if (itemPathModel.chinItemModel == null) return;
|
| | |
|
| | | if (tipsModel.unlockPetDict.ContainsKey(itemPathModel.chinItemModel.ID))
|
| | | {
|
| | | matType = PetMatType.Pet;
|
| | | matType = PetOrMount.Pet;
|
| | | }
|
| | | else if (tipsModel.unlockMountDict.ContainsKey(itemPathModel.chinItemModel.ID))
|
| | | {
|
| | | matType = PetMatType.Mount;
|
| | | matType = PetOrMount.Mount;
|
| | | }
|
| | |
|
| | | tipAlpha.alpha = 0;
|
| | |
| | | Dictionary<int, int> itemEffectDict = null;
|
| | | switch (matType)
|
| | | {
|
| | | case PetMatType.Pet:
|
| | | case PetOrMount.Pet:
|
| | | PetInfoConfig petInfo = tipsModel.unlockPetDict[itemPathModel.chinItemModel.ID];
|
| | | itemEffectDict = petmodel.GetPetAttrAddDict(petInfo.ID);
|
| | | break;
|
| | | case PetMatType.Mount:
|
| | | case PetOrMount.Mount:
|
| | | HorseConfig horseConfig = tipsModel.unlockMountDict[itemPathModel.chinItemModel.ID];
|
| | | itemEffectDict = mountModel.GetMountAttrAddDict(horseConfig.HorseID);
|
| | | break;
|
| | |
| | | {
|
| | | switch (matType)
|
| | | {
|
| | | case PetMatType.Pet:
|
| | | case PetOrMount.Pet:
|
| | | PetInfoConfig petInfo = tipsModel.unlockPetDict[itemPathModel.chinItemModel.ID];
|
| | | petSkillDict = tipsModel.GetPetSkillDict(itemPathModel.chinItemModel.ID);
|
| | | modelShow.SetModelShow(petInfo.ID, ModelShowType.pet, Language.Get("TreasureEffect103"), petInfo.ShowFightPower);
|
| | | modelShow.SetModelShow(petInfo.ID, ModelShowType.Pet, Language.Get("TreasureEffect103"), petInfo.ShowFightPower);
|
| | | break;
|
| | | case PetMatType.Mount:
|
| | | case PetOrMount.Mount:
|
| | | HorseConfig horseConfig = tipsModel.unlockMountDict[itemPathModel.chinItemModel.ID];
|
| | | mountSkillDict = tipsModel.GetMountSkillDict(itemPathModel.chinItemModel.ID);
|
| | | modelShow.SetModelShow(horseConfig.Model, ModelShowType.mount, Language.Get("TreasureEffect103"), horseConfig.ShowFightPower);
|
| | | modelShow.SetModelShow(horseConfig.Model, ModelShowType.Mount, Language.Get("TreasureEffect103"), horseConfig.ShowFightPower);
|
| | | break;
|
| | | }
|
| | |
|
| | |
| | | protected override void OnPreClose()
|
| | | {
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | UI3DTreasureExhibition.Instance.StopShow();
|
| | | UI3DTreasureExhibition.Instance.Stop();
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | |
| | | {
|
| | | case ActivateShow.ActivateFunc.Stove:
|
| | | m_ModelRawImage.rectTransform.sizeDelta = new Vector2(600, 600);
|
| | | UI3DTreasureExhibition.Instance.BeginShowTreasure(301, m_ModelRawImage);
|
| | | UI3DTreasureExhibition.Instance.ShowTreasure(301, m_ModelRawImage);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
| | | [SerializeField] GameObject m_Container_WHYJ;
|
| | | [SerializeField] DungenWHYJ m_DungenWHYJ;
|
| | | [SerializeField] GatherSoulDungeonBehaviour m_GatherSoulDungeonBehaviour;
|
| | | [SerializeField] DungeonReturnBloodBehaviour m_DungeonReturnBlood;
|
| | | bool excutedAutoExit = false;
|
| | | float timer = 0f;
|
| | | DateTime endTime = DateTime.Now;
|
| | |
| | | RuneTowerModel runeTowerModel { get { return ModelCenter.Instance.GetModel<RuneTowerModel>(); } }
|
| | | BossHomeModel bossHomeModel { get { return ModelCenter.Instance.GetModel<BossHomeModel>(); } }
|
| | | TreasureModel treasureModel { get { return ModelCenter.Instance.GetModel<TreasureModel>(); } }
|
| | | DungeonUseBuffModel dungeonUseBuffModel { get { return ModelCenter.Instance.GetModel<DungeonUseBuffModel>(); } }
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | |
| | | m_BossInfosContainer.gameObject.SetActive(
|
| | | dataMapId == ElderGodAreaModel.ELDERGODAREA_MAPID
|
| | | || dataMapId == BossHomeModel.BOSSHOME_MAPID);
|
| | |
|
| | | if (dungeonUseBuffModel.IsDungeonUseBuff(dataMapId))
|
| | | {
|
| | | m_DungeonReturnBlood.gameObject.SetActive(true);
|
| | | m_DungeonReturnBlood.Display(dataMapId);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_DungeonReturnBlood.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | m_GatherSoulDungeonBehaviour.gameObject.SetActive(dataMapId == GatherSoulDungeonModel.DUNGEON_MAPID);
|
| | | switch (dataMapId)
|
| | |
| | | m_BossInfosContainer.Dispose();
|
| | | m_AncientKing.UnInit();
|
| | | m_GatherSoulDungeonBehaviour.Dispose();
|
| | | m_DungeonReturnBlood.Dispose();
|
| | | DropItemManager.pickUpCallBack -= OnPickItem;
|
| | | MainInterfaceWin.Event_Duplicates -= OnChangeFuncBtnPosEvent;
|
| | | model.dungeonCoolDownEvent -= OnLeaveMapTimeEvent;
|
| | |
| | | {
|
| | | public class DungeonReturnBloodBehaviour : MonoBehaviour
|
| | | {
|
| | | [SerializeField] Button m_ReturnBlood;
|
| | | [SerializeField] Button m_MoneyReturnBlood;
|
| | | [SerializeField] ReturnBloodBeha m_MoneyReturnBeha;
|
| | | [SerializeField] Button m_FreeReturnBlood;
|
| | | [SerializeField] ReturnBloodBeha m_FreeReturnBeha;
|
| | |
|
| | | int mapId = 0;
|
| | |
|
| | | int moneyReturnId = 0;
|
| | | int freeReturnId = 0;
|
| | |
|
| | | DungeonUseBuffModel model
|
| | | {
|
| | | get { return ModelCenter.Instance.GetModel<DungeonUseBuffModel>(); }
|
| | | }
|
| | |
|
| | | private void Awake()
|
| | | {
|
| | | m_ReturnBlood.AddListener(OnReturnBlood);
|
| | | m_FreeReturnBlood.AddListener(FreeReturnBlood);
|
| | | m_MoneyReturnBlood.AddListener(MoneyReturnBlood);
|
| | | }
|
| | |
|
| | | private void OnReturnBlood()
|
| | | public void Display(int mapId)
|
| | | {
|
| | | this.mapId = mapId;
|
| | |
|
| | | moneyReturnId = 0;
|
| | | freeReturnId = 0;
|
| | |
|
| | | var list = model.GetDungeonUseBuffs(mapId);
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | var config = DungeonUseBuffConfig.Get(list[i]);
|
| | | if (config.MoneyCnt != 0)
|
| | | {
|
| | | moneyReturnId = list[i];
|
| | | }
|
| | | else
|
| | | {
|
| | | freeReturnId = list[i];
|
| | | }
|
| | | }
|
| | |
|
| | | m_MoneyReturnBlood.gameObject.SetActive(moneyReturnId != 0);
|
| | | if (moneyReturnId != 0)
|
| | | {
|
| | | m_MoneyReturnBeha.Display(moneyReturnId);
|
| | | }
|
| | | m_FreeReturnBlood.gameObject.SetActive(freeReturnId != 0);
|
| | | if (freeReturnId != 0)
|
| | | {
|
| | | m_FreeReturnBeha.Display(freeReturnId);
|
| | | }
|
| | |
|
| | | DisplayTime();
|
| | |
|
| | | model.onUseBuffTimeRefresh += OnUseBuffTimeRefresh;
|
| | | }
|
| | |
|
| | | void DisplayTime()
|
| | | {
|
| | | if (moneyReturnId != 0)
|
| | | {
|
| | | var seconds = GetBuffSeconds(moneyReturnId);
|
| | | m_MoneyReturnBeha.SetCoolDown(seconds);
|
| | | }
|
| | |
|
| | | if (freeReturnId != 0)
|
| | | {
|
| | | var seconds = GetBuffSeconds(freeReturnId);
|
| | | m_FreeReturnBeha.SetCoolDown(seconds);
|
| | | }
|
| | | }
|
| | |
|
| | | private void LateUpdate()
|
| | | {
|
| | | if (m_FreeReturnBlood.gameObject.activeSelf)
|
| | | {
|
| | | m_FreeReturnBeha.OnUpdate();
|
| | | }
|
| | | if (m_MoneyReturnBlood.gameObject.activeSelf)
|
| | | {
|
| | | m_MoneyReturnBeha.OnUpdate();
|
| | | }
|
| | | }
|
| | |
|
| | | float GetBuffSeconds(int id)
|
| | | {
|
| | | var config = DungeonUseBuffConfig.Get(id);
|
| | | var tick = model.GetUseBuffTime(config.DataMapId, config.MoneyCnt);
|
| | | var useTime = TimeUtility.GetTime(tick);
|
| | | var seconds = Mathf.Max(0f, config.CD - (float)(TimeUtility.ServerNow - useTime).TotalSeconds);
|
| | | return seconds;
|
| | | }
|
| | |
|
| | | private void MoneyReturnBlood()
|
| | | {
|
| | | if (moneyReturnId != 0)
|
| | | {
|
| | | var config = DungeonUseBuffConfig.Get(moneyReturnId);
|
| | | var seconds = GetBuffSeconds(moneyReturnId);
|
| | | if (seconds <= 0)
|
| | | {
|
| | | if (model.moneyCostRemind)
|
| | | {
|
| | | var skillConfig = SkillConfig.Get(config.BuffID);
|
| | | ConfirmCancel.ToggleConfirmCancel(Language.Get("Mail101"),
|
| | | Language.Get("HazyReturnBloodRemind", config.MoneyCnt, skillConfig.EffectValue11 / 100),
|
| | | Language.Get("InspireNoMention"),
|
| | | (bool isOk, bool toggle) =>
|
| | | {
|
| | | if (toggle)
|
| | | {
|
| | | model.moneyCostRemind = false;
|
| | | }
|
| | | if (isOk)
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.diamond < config.MoneyCnt)
|
| | | {
|
| | | WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | return;
|
| | | }
|
| | | var pak = new CB10A_tagCMFBBuyBuff();
|
| | | pak.MapID = (uint)config.DataMapId;
|
| | | pak.MoneyCnt = (ushort)config.MoneyCnt;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | var pak = new CB10A_tagCMFBBuyBuff();
|
| | | pak.MapID = (uint)config.DataMapId;
|
| | | pak.MoneyCnt = (ushort)config.MoneyCnt;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void FreeReturnBlood()
|
| | | {
|
| | | if (freeReturnId != 0)
|
| | | {
|
| | | var config = DungeonUseBuffConfig.Get(freeReturnId);
|
| | | var seconds = GetBuffSeconds(freeReturnId);
|
| | | if (seconds <= 0)
|
| | | {
|
| | | var pak = new CB10A_tagCMFBBuyBuff();
|
| | | pak.MapID = (uint)config.DataMapId;
|
| | | pak.MoneyCnt = (ushort)config.MoneyCnt;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnUseBuffTimeRefresh()
|
| | | {
|
| | | DisplayTime();
|
| | | }
|
| | |
|
| | | public void Dispose()
|
| | | {
|
| | | model.onUseBuffTimeRefresh -= OnUseBuffTimeRefresh;
|
| | | }
|
| | |
|
| | | [Serializable]
|
| | | public class ReturnBloodBeha
|
| | | {
|
| | | [SerializeField] Image m_Mask;
|
| | | [SerializeField] Text m_Time;
|
| | | [SerializeField] Text m_Cost;
|
| | | [SerializeField] Text m_Effect;
|
| | |
|
| | | int id = 0;
|
| | | float seconds = 0f;
|
| | |
|
| | | public void Display(int id)
|
| | | {
|
| | | this.id = id;
|
| | | var config = DungeonUseBuffConfig.Get(id);
|
| | | if (config.MoneyCnt != 0)
|
| | | {
|
| | | m_Cost.text = config.MoneyCnt.ToString();
|
| | | }
|
| | |
|
| | | var skillConfig = SkillConfig.Get(config.BuffID);
|
| | | m_Effect.text = Language.Get("HazyReturnBlood", skillConfig.EffectValue11 / 100);
|
| | |
|
| | | m_Mask.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | public void SetCoolDown(float seconds)
|
| | | {
|
| | | this.seconds = seconds;
|
| | | if (seconds <= 0 && m_Mask.gameObject.activeSelf)
|
| | | {
|
| | | m_Mask.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayMask()
|
| | | {
|
| | | var config = DungeonUseBuffConfig.Get(id);
|
| | | var progress = Mathf.Clamp01(seconds / config.CD);
|
| | | m_Mask.fillAmount = progress;
|
| | | if (!m_Mask.gameObject.activeSelf)
|
| | | {
|
| | | m_Mask.gameObject.SetActive(true);
|
| | | }
|
| | | m_Time.text = ((int)seconds).ToString();
|
| | | }
|
| | |
|
| | | public void OnUpdate()
|
| | | {
|
| | | if (seconds > 0f)
|
| | | {
|
| | | seconds -= Time.deltaTime;
|
| | | DisplayMask();
|
| | |
|
| | | if (seconds <= 0f)
|
| | | {
|
| | | m_Mask.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | } |
| New file |
| | |
| | | using System;
|
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class DungeonUseBuffModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | {
|
| | | Dictionary<int, List<int>> m_UseBuffMaps = new Dictionary<int, List<int>>();
|
| | | Dictionary<int, Dictionary<int, uint>> m_UseBuffTimes = new Dictionary<int, Dictionary<int, uint>>();
|
| | |
|
| | | public bool moneyCostRemind { get; set; }
|
| | |
|
| | | public event Action onUseBuffTimeRefresh;
|
| | | public override void Init()
|
| | | {
|
| | | ParseConfig();
|
| | | StageLoad.Instance.onStageLoadFinish += OnStageLoadFinish;
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | m_UseBuffTimes.Clear();
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | | {
|
| | | StageLoad.Instance.onStageLoadFinish -= OnStageLoadFinish;
|
| | | }
|
| | |
|
| | | private void OnStageLoadFinish()
|
| | | {
|
| | | moneyCostRemind = true;
|
| | | }
|
| | |
|
| | | void ParseConfig()
|
| | | {
|
| | | var configs = DungeonUseBuffConfig.GetValues();
|
| | | foreach (var config in configs)
|
| | | {
|
| | | List<int> ids = null;
|
| | | if (!m_UseBuffMaps.TryGetValue(config.DataMapId, out ids))
|
| | | {
|
| | | ids = new List<int>();
|
| | | m_UseBuffMaps.Add(config.DataMapId, ids);
|
| | | }
|
| | | ids.Add(config.ID);
|
| | | }
|
| | | }
|
| | |
|
| | | public bool IsDungeonUseBuff(int mapId)
|
| | | {
|
| | | return m_UseBuffMaps.ContainsKey(mapId);
|
| | | }
|
| | |
|
| | | public List<int> GetDungeonUseBuffs(int mapId)
|
| | | {
|
| | | return m_UseBuffMaps.ContainsKey(mapId) ? m_UseBuffMaps[mapId] : null;
|
| | | }
|
| | |
|
| | | public uint GetUseBuffTime(int mapId, int moneyCnt)
|
| | | {
|
| | | if (m_UseBuffTimes.ContainsKey(mapId)
|
| | | && m_UseBuffTimes[mapId].ContainsKey(moneyCnt))
|
| | | {
|
| | | return m_UseBuffTimes[mapId][moneyCnt];
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | public void ReceivePackage(HB215_tagMCFBBuyBuffInfo package)
|
| | | {
|
| | | for (int i = 0; i < package.Cnt; i++)
|
| | | {
|
| | | var data = package.InfoList[i];
|
| | | Dictionary<int, uint> dict = null;
|
| | | if (!m_UseBuffTimes.TryGetValue((int)data.MapID, out dict))
|
| | | {
|
| | | dict = new Dictionary<int, uint>();
|
| | | m_UseBuffTimes.Add((int)data.MapID, dict);
|
| | | }
|
| | | dict[data.MoneyCnt] = data.BuyTime;
|
| | | }
|
| | |
|
| | | if (onUseBuffTimeRefresh != null)
|
| | | {
|
| | | onUseBuffTimeRefresh();
|
| | | }
|
| | | }
|
| | | }
|
| | | } |
| | | |
copy from System/KnapSack/Logic/PetMatInfoWin.cs.meta
copy to System/Dungeon/DungeonUseBuffModel.cs.meta
| File was copied from System/KnapSack/Logic/PetMatInfoWin.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1ecb0731383014d44863af268e0d376c |
| | | timeCreated: 1525846932 |
| | | guid: b96475bae31cb2f49b91ee730474aa55 |
| | | timeCreated: 1555415547 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | |
|
| | | private void WindowBeforeCloseEvent(Window window)
|
| | | {
|
| | | if (window is PetMatInfoWin)
|
| | | if (window is PetMountTipWin)
|
| | | {
|
| | | DisplayBossModel();
|
| | | }
|
| | |
| | | var refreshSeconds = npcInfos[i].refreshMinute * 60;
|
| | | var seconds = refreshSeconds - used % refreshSeconds;
|
| | | var npcConfig = NPCConfig.Get(npcInfos[i].npcId);
|
| | | m_GrassTimes[i].text = string.Format("{0}{1}后刷新", npcConfig.charName,
|
| | | m_GrassTimes[i].text = Language.Get("HazyGrassRefresh", npcConfig.charName,
|
| | | TimeUtility.SecondsToMS(seconds));
|
| | | }
|
| | | else
|
| | |
| | | public void Display(int npcId, int count)
|
| | | {
|
| | | var npcConfig = NPCConfig.Get(npcId);
|
| | | m_Title.text = string.Format("剩余{0}数量:", npcConfig.charName);
|
| | | m_Title.text = Language.Get("HazyGrassCountTitle", npcConfig.charName);
|
| | | m_Count.text = count.ToString();
|
| | | m_Count.color = UIHelper.GetUIColor(count > 0 ? TextColType.Green : TextColType.Red);
|
| | | }
|
| | |
| | | |
| | | public BaseInfo baseInfo; |
| | | public BaseProperty baseProperty; |
| | | public BaseProperty petMountBaseProperty; |
| | | public LegendProperty legendProperty; |
| | | public SkillInfo skillInfo; |
| | | public SuitInfo suitInfo; |
| | |
| | | static EquipGemModel gemModel { get { return ModelCenter.Instance.GetModel<EquipGemModel>(); } } |
| | | static EquipTrainModel trainModel { get { return ModelCenter.Instance.GetModel<EquipTrainModel>(); } } |
| | | static EquipStrengthModel strengthenModel { get { return ModelCenter.Instance.GetModel<EquipStrengthModel>(); } } |
| | | static MountModel mountModel { get { return ModelCenter.Instance.GetModel<MountModel>(); } } |
| | | static PetModel perModel { get { return ModelCenter.Instance.GetModel<PetModel>(); } } |
| | | |
| | | public static TipType tipType { get; private set; } |
| | | public static TipData mainTipData { get; private set; } |
| | |
| | | mainTipData = CreateItemData(itemId); |
| | | } |
| | | |
| | | var config = ItemConfig.Get(itemId); |
| | | switch (type) |
| | | { |
| | | case TipType.Normal: |
| | |
| | | } |
| | | else |
| | | { |
| | | WindowCenter.Instance.Open<ItemTipWin>(); |
| | | switch (config.Type) |
| | | { |
| | | case 26: |
| | | case 41: |
| | | case 42: |
| | | WindowCenter.Instance.Open<PetMountTipWin>(); |
| | | break; |
| | | default: |
| | | WindowCenter.Instance.Open<ItemTipWin>(); |
| | | break; |
| | | } |
| | | } |
| | | break; |
| | | case TipType.Good: |
| | |
| | | } |
| | | else |
| | | { |
| | | WindowCenter.Instance.Open<ItemTipWin>(); |
| | | switch (item.config.Type) |
| | | { |
| | | case 26: |
| | | case 41: |
| | | case 42: |
| | | WindowCenter.Instance.Open<PetMountTipWin>(); |
| | | break; |
| | | default: |
| | | WindowCenter.Instance.Open<ItemTipWin>(); |
| | | break; |
| | | } |
| | | } |
| | | break; |
| | | case TipType.Good: |
| | |
| | | guid = guid, |
| | | |
| | | baseInfo = GetBaseInfo(guid), |
| | | petMountBaseProperty=GetPetMountBaseProperty(item.itemId), |
| | | operates = GetOperates(guid), |
| | | }; |
| | | } |
| | |
| | | { |
| | | itemId = itemId, |
| | | baseInfo = GetBaseInfo(itemId), |
| | | petMountBaseProperty = GetPetMountBaseProperty(itemId), |
| | | }; |
| | | } |
| | | |
| | |
| | | { |
| | | itemId = item.itemId, |
| | | count = item.count, |
| | | isAuction = item.isAuction, |
| | | isAuction =item.isAuction, |
| | | isEquiped = isEquiped, |
| | | score = item.score, |
| | | auctionSurplusTime = item.isAuction ? item.auctionSurplusTime : 0, |
| | |
| | | return baseProperty; |
| | | } |
| | | |
| | | private static BaseProperty GetPetMountBaseProperty(int itemId) |
| | | { |
| | | var config = ItemConfig.Get(itemId); |
| | | var baseProperty = new BaseProperty(); |
| | | Dictionary<int, int> properties = null; |
| | | switch (config.Type) |
| | | { |
| | | case 26: |
| | | var petId = PetInfoConfig.GetItemUnLockPet(itemId); |
| | | properties = perModel.GetPetAttrAddDict(petId); |
| | | break; |
| | | case 41: |
| | | case 42: |
| | | var horseId = HorseConfig.GetItemUnLockHorse(itemId); |
| | | properties = mountModel.GetMountAttrAddDict(horseId); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | if (properties != null) |
| | | { |
| | | baseProperty.baseProperties = new List<Int2>(); |
| | | foreach (var property in properties) |
| | | { |
| | | baseProperty.baseProperties.Add(new Int2(property.Key, property.Value)); |
| | | } |
| | | } |
| | | |
| | | return baseProperty; |
| | | } |
| | | |
| | | private static LegendProperty GetLegendProperty(int itemId) |
| | | { |
| | | var data = new LegendProperty(); |
| | |
| | | [SerializeField] TipItemBaseInfoWidget m_BaseInfoWidget; |
| | | [SerializeField] TipItemDescriptionWidget m_DescriptionWidget; |
| | | [SerializeField] TipAuctionTipWidget m_AuctionWidget; |
| | | [SerializeField] TipModelWidget m_ModelWidget; |
| | | [SerializeField] OperateButton[] m_OperateButtons; |
| | | |
| | | PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } } |
| | |
| | | DisplayItemUseState(); |
| | | DisplayAuctionInfo(); |
| | | DisplayOperateButton(); |
| | | DisplayModel(); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | } |
| | | } |
| | | |
| | | private void DisplayModel() |
| | | { |
| | | var baseInfo = EquipTipUtility.mainTipData.baseInfo; |
| | | var config = ItemConfig.Get(baseInfo.itemId); |
| | | |
| | | m_ModelWidget.gameObject.SetActive(config.Type == 124 || config.Type == 125); |
| | | switch (config.Type) |
| | | { |
| | | case 124: |
| | | var horseId = HorseConfig.GetItemUnLockHorse(config.EffectValueA1); |
| | | var horseConfig = HorseConfig.Get(horseId); |
| | | m_ModelWidget.Display(horseConfig.Model, ModelShowType.Mount, horseConfig.ShowFightPower); |
| | | break; |
| | | case 125: |
| | | var petId = PetInfoConfig.GetItemUnLockPet(config.EffectValueA1); |
| | | var petConfig = PetInfoConfig.Get(petId); |
| | | m_ModelWidget.Display(petId, ModelShowType.Pet, petConfig.ShowFightPower); |
| | | break; |
| | | } |
| | | |
| | | } |
| | | |
| | | private void DisplayOperateButton() |
| | | { |
| | | var operates = EquipTipUtility.mainTipData.operates; |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Tuesday, April 16, 2019 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | |
| | | public class PetMountTipWin : Window |
| | | { |
| | | [SerializeField] RectTransform m_Pivot; |
| | | [SerializeField] ImageEx m_Label; |
| | | [SerializeField] Text m_ItemName; |
| | | [SerializeField] TipBasePropertyWidget m_BaseProperty; |
| | | [SerializeField] TipPetMountSkillWidget m_PetMountSkill; |
| | | [SerializeField] TipAuctionTipWidget m_AuctionWidget; |
| | | [SerializeField] TipPetMountDescriptionWidget m_DescriptionWidget; |
| | | [SerializeField] TipModelWidget m_Model; |
| | | [SerializeField] OperateButton[] m_OperateButtons; |
| | | |
| | | [SerializeField] Button m_Close; |
| | | |
| | | #region Built-in |
| | | protected override void BindController() |
| | | { |
| | | } |
| | | |
| | | protected override void AddListeners() |
| | | { |
| | | m_Close.SetListener(() => { WindowCenter.Instance.Close<PetMountTipWin>(); }); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | m_Pivot.localScale = Vector3.zero; |
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | | { |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | } |
| | | |
| | | protected override void OnAfterClose() |
| | | { |
| | | } |
| | | |
| | | protected override void OnActived() |
| | | { |
| | | base.OnActived(); |
| | | |
| | | StartCoroutine("Co_DelayDisplay"); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | private void DisplayBaseInfo() |
| | | { |
| | | var baseInfo = EquipTipUtility.mainTipData.baseInfo; |
| | | |
| | | var config = ItemConfig.Get(baseInfo.itemId); |
| | | m_ItemName.text = config.ItemName; |
| | | m_ItemName.color = UIHelper.GetUIColor(config.ItemColor); |
| | | |
| | | if (baseInfo.isAuction) |
| | | { |
| | | m_Label.gameObject.SetActive(true); |
| | | m_Label.SetSprite("Item_Auction_2"); |
| | | m_Label.gray = baseInfo.auctionSurplusTime <= 0; |
| | | } |
| | | else |
| | | { |
| | | m_Label.gameObject.SetActive(false); |
| | | } |
| | | } |
| | | |
| | | private void DisplayBaseProperty() |
| | | { |
| | | m_BaseProperty.Display(EquipTipUtility.mainTipData.petMountBaseProperty); |
| | | } |
| | | |
| | | private void DisplaySkills() |
| | | { |
| | | var baseInfo = EquipTipUtility.mainTipData.baseInfo; |
| | | var config = ItemConfig.Get(baseInfo.itemId); |
| | | switch (config.Type) |
| | | { |
| | | case 26: |
| | | m_PetMountSkill.Display(ShowType.Pet, baseInfo.itemId); |
| | | break; |
| | | case 41: |
| | | case 42: |
| | | m_PetMountSkill.Display(ShowType.Mount, baseInfo.itemId); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | private void DisplayAuctionInfo() |
| | | { |
| | | var baseInfo = EquipTipUtility.mainTipData.baseInfo; |
| | | m_AuctionWidget.gameObject.SetActive(baseInfo.isAuction); |
| | | if (baseInfo.isAuction) |
| | | { |
| | | var overdueTime = DateTime.Now.AddSeconds((double)baseInfo.auctionSurplusTime); |
| | | m_AuctionWidget.Display(overdueTime); |
| | | } |
| | | } |
| | | |
| | | private void DisplayDescription() |
| | | { |
| | | var baseInfo = EquipTipUtility.mainTipData.baseInfo; |
| | | m_DescriptionWidget.gameObject.SetActive(!baseInfo.isAuction); |
| | | if (!baseInfo.isAuction) |
| | | { |
| | | m_DescriptionWidget.Display(baseInfo.itemId); |
| | | } |
| | | } |
| | | |
| | | private void DisplayModel() |
| | | { |
| | | var baseInfo = EquipTipUtility.mainTipData.baseInfo; |
| | | var config = ItemConfig.Get(baseInfo.itemId); |
| | | switch (config.Type) |
| | | { |
| | | case 26: |
| | | var petId = PetInfoConfig.GetItemUnLockPet(baseInfo.itemId); |
| | | var petConfig = PetInfoConfig.Get(petId); |
| | | m_Model.Display(petId, ModelShowType.Pet, petConfig.ShowFightPower); |
| | | break; |
| | | case 41: |
| | | case 42: |
| | | var horseId = HorseConfig.GetItemUnLockHorse(baseInfo.itemId); |
| | | var horseConfig = HorseConfig.Get(horseId); |
| | | m_Model.Display(horseConfig.Model, ModelShowType.Mount, horseConfig.ShowFightPower); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | private void DisplayOperateButton() |
| | | { |
| | | var operates = EquipTipUtility.mainTipData.operates; |
| | | var guid = EquipTipUtility.mainTipData.guid; |
| | | if (operates.IsNullOrEmpty()) |
| | | { |
| | | for (int i = 0; i < m_OperateButtons.Length; i++) |
| | | { |
| | | var button = m_OperateButtons[i]; |
| | | button.SetActive(false); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (int i = 0; i < m_OperateButtons.Length; i++) |
| | | { |
| | | var button = m_OperateButtons[i]; |
| | | if (i < operates.Count) |
| | | { |
| | | button.SetActive(true); |
| | | button.Bind(operates[i], guid); |
| | | } |
| | | else |
| | | { |
| | | button.SetActive(false); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | IEnumerator Co_DelayDisplay() |
| | | { |
| | | yield return null; |
| | | yield return null; |
| | | m_Pivot.localScale = Vector3.one; |
| | | DisplayBaseInfo(); |
| | | DisplayBaseProperty(); |
| | | DisplaySkills(); |
| | | DisplayAuctionInfo(); |
| | | DisplayDescription(); |
| | | DisplayModel(); |
| | | DisplayOperateButton(); |
| | | } |
| | | |
| | | [Serializable] |
| | | public class OperateButton |
| | | { |
| | | [SerializeField] RectTransform m_Container; |
| | | [SerializeField] Button m_Button; |
| | | [SerializeField] Text m_Title; |
| | | |
| | | ItemOperateType operateType; |
| | | string guid; |
| | | |
| | | public void SetActive(bool active) |
| | | { |
| | | this.m_Container.gameObject.SetActive(active); |
| | | } |
| | | |
| | | public void Bind(ItemOperateType type, string guid) |
| | | { |
| | | operateType = type; |
| | | this.guid = guid; |
| | | switch (type) |
| | | { |
| | | case ItemOperateType.putAway: |
| | | this.m_Title.text = "上架"; |
| | | break; |
| | | case ItemOperateType.sell: |
| | | this.m_Title.text = "出售"; |
| | | break; |
| | | case ItemOperateType.makeUse: |
| | | this.m_Title.text = "使用"; |
| | | break; |
| | | case ItemOperateType.putOut: |
| | | this.m_Title.text = "取出"; |
| | | break; |
| | | case ItemOperateType.putIn: |
| | | this.m_Title.text = "放入"; |
| | | break; |
| | | default: |
| | | this.m_Title.text = ""; |
| | | break; |
| | | } |
| | | |
| | | m_Button.SetListener(() => |
| | | { |
| | | WindowCenter.Instance.Close<ItemTipWin>(); |
| | | EquipTipUtility.Operate(operateType, this.guid); |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | public enum ShowType |
| | | { |
| | | None, |
| | | Pet, |
| | | Mount, |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
copy from System/KnapSack/Logic/PetMatInfoWin.cs.meta
copy to System/ItemTip/PetMountTipWin.cs.meta
| File was copied from System/KnapSack/Logic/PetMatInfoWin.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1ecb0731383014d44863af268e0d376c |
| | | timeCreated: 1525846932 |
| | | guid: 18ed4c771f5e25740ac43932bbe5a611 |
| | | timeCreated: 1555402553 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | public class TipModelWidget : MonoBehaviour |
| | | { |
| | | |
| | | [SerializeField] Text m_Title; |
| | | [SerializeField] RawImage m_Model; |
| | | [SerializeField] Text m_FightPower; |
| | | [SerializeField] Image m_Fight; |
| | |
| | | FashionDressModel fashionDressModel { get { return ModelCenter.Instance.GetModel<FashionDressModel>(); } } |
| | | ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } } |
| | | |
| | | public void OnDisable() |
| | | void OnDisable() |
| | | { |
| | | switch (showType) |
| | | { |
| | | case ModelShowType.treasure: |
| | | UI3DTreasureExhibition.Instance.StopShow(); |
| | | case ModelShowType.Treasure: |
| | | UI3DTreasureExhibition.Instance.Stop(); |
| | | break; |
| | | case ModelShowType.mount: |
| | | case ModelShowType.Mount: |
| | | break; |
| | | case ModelShowType.pet: |
| | | case ModelShowType.Pet: |
| | | break; |
| | | } |
| | | } |
| | | |
| | | public void Display(int id, ModelShowType showType, string title, int fightValue = 0) |
| | | public void Display(int id, ModelShowType showType, int fightValue = 0) |
| | | { |
| | | m_Title.text = title; |
| | | this.showType = showType; |
| | | |
| | | switch (showType) |
| | | { |
| | | case ModelShowType.treasure: |
| | | case ModelShowType.Treasure: |
| | | m_Fight.SetSprite("FightingLv_Normal"); |
| | | UI3DTreasureExhibition.Instance.BeginShowTreasure(id, m_Model); |
| | | UI3DTreasureExhibition.Instance.ShowTreasure(id, m_Model); |
| | | break; |
| | | case ModelShowType.mount: |
| | | case ModelShowType.Mount: |
| | | m_Fight.SetSprite("FightingLv_Max"); |
| | | UI3DModelExhibition.Instance.ShowHourse(id, m_Model); |
| | | break; |
| | | case ModelShowType.pet: |
| | | case ModelShowType.Pet: |
| | | m_Fight.SetSprite("FightingLv_Max"); |
| | | var npcConfig = NPCConfig.Get(id); |
| | | UI3DModelExhibition.Instance.ShowNPC(id, npcConfig.UIModeLOffset, npcConfig.UIModelRotation, m_Model); |
| | |
| | | var itemConfig = ItemConfig.Get(id); |
| | | if (itemConfig != null) |
| | | { |
| | | int fashionType = 0; |
| | | int fashionId = 0; |
| | | bool isFashion = tipsModel.TryGetItemFashionData(itemConfig.ID, out fashionType, out fashionId); |
| | | var fashionType = 0; |
| | | var fashionId = 0; |
| | | var isFashion = tipsModel.TryGetItemFashionData(itemConfig.ID, out fashionType, out fashionId); |
| | | if (isFashion) |
| | | { |
| | | List<int> fashionIds = null; |
| | |
| | | fashionSecondaryId = fashionSecondaryId, |
| | | isDialogue = false, |
| | | }; |
| | | |
| | | return data; |
| | | } |
| | | |
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | public class TipPetMountDescriptionWidget : MonoBehaviour |
| | | { |
| | | [SerializeField] Text m_Description; |
| | | |
| | | public void Display(int itemId) |
| | | { |
| | | var config = ItemConfig.Get(itemId); |
| | | m_Description.text = config.Description; |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
copy from System/KnapSack/Logic/PetMatInfoWin.cs.meta
copy to System/ItemTip/TipPetMountDescriptionWidget.cs.meta
| File was copied from System/KnapSack/Logic/PetMatInfoWin.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1ecb0731383014d44863af268e0d376c |
| | | timeCreated: 1525846932 |
| | | guid: 3dd3994efd9cfae4b88db3a72aec0d32 |
| | | timeCreated: 1555414193 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Tuesday, April 16, 2019 |
| | | //-------------------------------------------------------- |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | |
| | | public class TipPetMountSkillBehaviour : ScrollItem |
| | | { |
| | | [SerializeField] Image m_Icon; |
| | | [SerializeField] Text m_SkillName; |
| | | [SerializeField] Text m_UnLockLevel; |
| | | [SerializeField] Text m_Description; |
| | | |
| | | public override void Display(object _data) |
| | | { |
| | | base.Display(_data); |
| | | |
| | | var info = (TipPetMountSkillWidget.SkillInfo)_data; |
| | | var config = SkillConfig.Get(info.skillId); |
| | | if (config == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | m_Icon.SetSprite(config.IconName); |
| | | m_SkillName.text = config.SkillName; |
| | | m_UnLockLevel.text = Language.Get("L1120", info.unlockLevel); |
| | | m_Description.text = config.Description; |
| | | } |
| | | |
| | | public override void Dispose() |
| | | { |
| | | base.Dispose(); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
copy from System/KnapSack/Logic/PetMatInfoWin.cs.meta
copy to System/ItemTip/TipPetMountSkillBehaviour.cs.meta
| File was copied from System/KnapSack/Logic/PetMatInfoWin.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1ecb0731383014d44863af268e0d376c |
| | | timeCreated: 1525846932 |
| | | guid: fb1e8498035fdad4788e3f24e3b467f3 |
| | | timeCreated: 1555402975 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Tuesday, April 16, 2019 |
| | | //-------------------------------------------------------- |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using UnityEngine.UI; |
| | | using System.Collections.Generic; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | |
| | | public class TipPetMountSkillWidget : MonoBehaviour |
| | | { |
| | | [SerializeField] CyclicScroll m_Scroll; |
| | | |
| | | public void Display(PetMountTipWin.ShowType showType, int itemId) |
| | | { |
| | | var skillInfos = new List<SkillInfo>(); |
| | | |
| | | switch (showType) |
| | | { |
| | | case PetMountTipWin.ShowType.Pet: |
| | | var petId = PetInfoConfig.GetItemUnLockPet(itemId); |
| | | var petConfig = PetInfoConfig.Get(petId); |
| | | |
| | | var min = Mathf.Min(petConfig.SkillID.Length, petConfig.SkillUnLock.Length); |
| | | for (var i = 0; i < min; i++) |
| | | { |
| | | var skillId = petConfig.SkillID[i]; |
| | | var unlockLevel = petConfig.SkillUnLock[i]; |
| | | skillInfos.Add(new SkillInfo() { skillId = skillId, unlockLevel = unlockLevel }); |
| | | } |
| | | break; |
| | | case PetMountTipWin.ShowType.Mount: |
| | | var horseId = HorseConfig.GetItemUnLockHorse(itemId); |
| | | var horseUpConfigs = HorseUpConfig.GetMountlistById(horseId); |
| | | foreach (var config in horseUpConfigs) |
| | | { |
| | | foreach (var skill in config.SkillID) |
| | | { |
| | | if (skill > 0) |
| | | { |
| | | skillInfos.Add(new SkillInfo() { skillId = skill, unlockLevel = config.LV }); |
| | | } |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | |
| | | m_Scroll.Init(skillInfos); |
| | | } |
| | | |
| | | public struct SkillInfo |
| | | { |
| | | public int skillId; |
| | | public int unlockLevel; |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
copy from System/KnapSack/Logic/PetMatInfoWin.cs.meta
copy to System/ItemTip/TipPetMountSkillWidget.cs.meta
| File was copied from System/KnapSack/Logic/PetMatInfoWin.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1ecb0731383014d44863af268e0d376c |
| | | timeCreated: 1525846932 |
| | | guid: e73ec57ed26b0b6478fc3822569c81b6 |
| | | timeCreated: 1555402806 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | } |
| | | |
| | | var config = ItemConfig.Get(itemId); |
| | | return config.Type >= 119 && config.Type <= 124; |
| | | return config.Type >= 119 && config.Type <= 123; |
| | | } |
| | | |
| | | } |
| | |
| | |
|
| | | public Dictionary<int, PetInfoConfig> unlockPetDict { get; private set; }
|
| | | public Dictionary<int, HorseConfig> unlockMountDict { get; private set; }
|
| | |
|
| | | private Dictionary<int, Dictionary<int, int>> petSkillDict = new Dictionary<int, Dictionary<int, int>>(); // 编号 解锁阶级 技能
|
| | | private Dictionary<int, Dictionary<int, List<int>>> mountSkillDict = new Dictionary<int, Dictionary<int, List<int>>>(); // 编号 解锁阶级 技能
|
| | |
|
| | | Dictionary<int, string> petAndMountQualityDict = new Dictionary<int, string>();
|
| | | string expValueFormula = "";
|
| | | Dictionary<int, string> exhaustedAttrFormula { get; set; }
|
| | |
| | | WindowCenter.Instance.Open<BuyBoxInfoWin>();
|
| | | break;
|
| | | case ItemWinType.petMatWin:
|
| | | WindowCenter.Instance.Open<PetMatInfoWin>();
|
| | | if (curAttrData.isPreview)
|
| | | {
|
| | | EquipTipUtility.Show(TipType.Normal, curAttrData.itemId);
|
| | | }
|
| | | else
|
| | | {
|
| | | EquipTipUtility.Show(curAttrData.guid);
|
| | | }
|
| | | break;
|
| | | case ItemWinType.buyPetMatWin:
|
| | | WindowCenter.Instance.Open<BuyPetMatInfoWin>();
|
| | |
| | | case 125:
|
| | | PetInfoConfig petInfo = unlockPetDict[config.EffectValueA1];
|
| | | fightPower = petInfo.ShowFightPower;
|
| | | showPerfab.SetModelShow(petInfo.ID, ModelShowType.pet, Language.Get("TreasureEffect103"), fightPower);
|
| | | showPerfab.SetModelShow(petInfo.ID, ModelShowType.Pet, Language.Get("TreasureEffect103"), fightPower);
|
| | | return true;
|
| | | case 124:
|
| | | HorseConfig horseConfig = unlockMountDict[config.EffectValueA1];
|
| | | fightPower = horseConfig.ShowFightPower;
|
| | | showPerfab.SetModelShow(horseConfig.Model, ModelShowType.mount, Language.Get("TreasureEffect103"), fightPower);
|
| | | showPerfab.SetModelShow(horseConfig.Model, ModelShowType.Mount, Language.Get("TreasureEffect103"), fightPower);
|
| | | return true;
|
| | | }
|
| | | bool isFashion = TryGetFashionFightPower(config, out fightPower);
|
| | |
| | | {
|
| | | switch (showType)
|
| | | {
|
| | | case ModelShowType.treasure:
|
| | | UI3DTreasureExhibition.Instance.StopShow();
|
| | | case ModelShowType.Treasure:
|
| | | UI3DTreasureExhibition.Instance.Stop();
|
| | | break;
|
| | | case ModelShowType.mount:
|
| | | case ModelShowType.Mount:
|
| | | break;
|
| | | case ModelShowType.pet:
|
| | | case ModelShowType.Pet:
|
| | | break;
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | switch (showType)
|
| | | {
|
| | | case ModelShowType.treasure:
|
| | | case ModelShowType.Treasure:
|
| | | fightImg.SetSprite("FightingLv_Normal");
|
| | | UI3DTreasureExhibition.Instance.BeginShowTreasure(id, modelImg);
|
| | | UI3DTreasureExhibition.Instance.ShowTreasure(id, modelImg);
|
| | | break;
|
| | | case ModelShowType.mount:
|
| | | case ModelShowType.Mount:
|
| | | fightImg.SetSprite("FightingLv_Max");
|
| | | UI3DModelExhibition.Instance.ShowHourse(id, modelImg);
|
| | | break;
|
| | | case ModelShowType.pet:
|
| | | case ModelShowType.Pet:
|
| | | fightImg.SetSprite("FightingLv_Max");
|
| | | var npcConfig = NPCConfig.Get(id);
|
| | | UI3DModelExhibition.Instance.ShowNPC(id, npcConfig.UIModeLOffset, npcConfig.UIModelRotation, modelImg);
|
| | |
| | |
|
| | | public enum ModelShowType
|
| | | {
|
| | | treasure, //法宝
|
| | | mount, //坐骑
|
| | | pet, //灵宠
|
| | | Treasure, //法宝
|
| | | Mount, //坐骑
|
| | | Pet, //灵宠
|
| | | FashionDress, //时装
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | sourceText.text = Language.Get("TreasureEffect101", treasureEffect.vipLv);
|
| | | }
|
| | | modelShow.SetModelShow(treasureEffect.treasureId,ModelShowType.treasure,Language.Get("TreasureEffect103"));
|
| | | modelShow.SetModelShow(treasureEffect.treasureId,ModelShowType.Treasure,Language.Get("TreasureEffect103"));
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | fightBg.SetActive(false);
|
| | | fightNumText.gameObject.SetActive(false);
|
| | | }
|
| | | modelShow.SetModelShow(kingShowModel.treasureId, ModelShowType.treasure, Language.Get("TreasureEffect103"));
|
| | | modelShow.SetModelShow(kingShowModel.treasureId, ModelShowType.Treasure, Language.Get("TreasureEffect103"));
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | packModel.refreshItemCountEvent += OnPackUpdate;
|
| | | PlayerDatas.Instance.playerDataRefreshEvent += OnPlayerDataUpdate;
|
| | | WindowCenter.Instance.windowBeforeCloseEvent += BeforeWindowClose;
|
| | | WindowCenter.Instance.windowAfterCloseEvent += AfterWindowClose;
|
| | | GlobalTimeEvent.Instance.secondEvent += UpdateSecond;
|
| | |
|
| | | UpdateMoney();
|
| | |
| | | {
|
| | | GlobalTimeEvent.Instance.secondEvent -= UpdateSecond;
|
| | | packModel.refreshItemCountEvent -= OnPackUpdate;
|
| | | WindowCenter.Instance.windowBeforeCloseEvent -= BeforeWindowClose;
|
| | | WindowCenter.Instance.windowAfterCloseEvent -= AfterWindowClose;
|
| | | PlayerDatas.Instance.playerDataRefreshEvent -= OnPlayerDataUpdate;
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | }
|
| | |
| | | UI3DModelExhibition.Instance.ShowPlayer(m_Role, PlayerDatas.Instance.baseData.Job);
|
| | | }
|
| | |
|
| | | private void BeforeWindowClose(Window window)
|
| | | private void AfterWindowClose(Window window)
|
| | | {
|
| | | if ("PetMatInfoWin" != window.name && "ItemInfoWin" != window.name) return;
|
| | |
|
| | | UI3DModelExhibition.Instance.ShowPlayer(m_Role, PlayerDatas.Instance.baseData.Job);
|
| | | if (window.windowInfo.windowType >= WindowType.Modal)
|
| | | {
|
| | | if (!WindowCenter.Instance.ExistAnyFullScreenOrMaskWinLEqual(WindowType.Modal))
|
| | | {
|
| | | UI3DModelExhibition.Instance.ShowPlayer(m_Role, PlayerDatas.Instance.baseData.Job);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void UpdateSecond()
|
| | |
| | | } |
| | | |
| | | #region 预览坐骑碎片属性 |
| | | Dictionary<int, int> mountAttrDict = new Dictionary<int, int>(); |
| | | |
| | | public Dictionary<int, int> GetMountAttrAddDict(int mountCode) |
| | | { |
| | | {
|
| | | var mountAttrDict = new Dictionary<int, int>(); |
| | | HorseConfig horseConfig = HorseConfig.Get(mountCode); |
| | | mountAttrDict.Clear(); |
| | | if (horseConfig == null) return mountAttrDict; |
| | |
| | | } |
| | | return mountAttrDict; |
| | | }
|
| | |
|
| | | #endregion |
| | |
|
| | | #region 技能整合 |
| | |
| | | protected override void OnPreClose()
|
| | | {
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | UI3DTreasureExhibition.Instance.StopShow();
|
| | | UI3DTreasureExhibition.Instance.Stop();
|
| | | flying = false;
|
| | | }
|
| | |
|
| | |
| | | case ActivateShow.ActivateFunc.GodWeapon:
|
| | | m_ModelRawImage.gameObject.SetActive(true);
|
| | | m_ModelRawImage.rectTransform.sizeDelta = new Vector2(600, 600);
|
| | | UI3DTreasureExhibition.Instance.BeginShowGodWeapon(ActivateShow.godWeaponType, m_ModelRawImage);
|
| | | UI3DTreasureExhibition.Instance.ShowGodWeapon(ActivateShow.godWeaponType, m_ModelRawImage);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | private void WindowBeforeCloseEvent(Window _window)
|
| | | {
|
| | | if (_window is PetMatInfoWin)
|
| | | if (_window is PetMountTipWin)
|
| | | {
|
| | | m_ContainerMounts.DisplayBossRawImage();
|
| | | m_ContainerSpiritPet.DisplayAnotherBossRawImage();
|
| | |
| | | ActivateShow.complelteFlySkillEvent -= ComplelteFlySkillEvent;
|
| | | AutoHammerWin.onConfirm -= OnAutoHammerConfirm;
|
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= BeforePlayerDataInitializeEvent;
|
| | | UI3DTreasureExhibition.Instance.StopShow();
|
| | | UI3DTreasureExhibition.Instance.Stop();
|
| | | }
|
| | |
|
| | | protected override void LateUpdate()
|
| | |
| | | private void DisplayGodWeaponModel()
|
| | | {
|
| | | m_GodWeaponModel.gameObject.SetActive(true);
|
| | | UI3DTreasureExhibition.Instance.BeginShowGodWeapon(model.selectType, m_GodWeaponModel);
|
| | | UI3DTreasureExhibition.Instance.ShowGodWeapon(model.selectType, m_GodWeaponModel);
|
| | | }
|
| | |
|
| | | private bool TryGetGodWeaponType(int skillId, out int type, out int index)
|
| | |
| | |
|
| | | Color32 conditionColor = new Color32(255, 244, 205, 255);
|
| | | Color32 conditionRedColor = new Color32(255, 1, 1, 255);
|
| | | PetMatType matType = PetMatType.None;
|
| | | PetOrMount matType = PetOrMount.None;
|
| | |
|
| | | protected override void BindController()
|
| | | {
|
| | |
| | | {
|
| | | petSkillDict = null;
|
| | | mountSkillDict = null;
|
| | | matType = PetMatType.None;
|
| | | matType = PetOrMount.None;
|
| | | if (itemTipsModel.curAttrData == null) return;
|
| | |
|
| | | if (itemTipsModel.unlockPetDict.ContainsKey(itemTipsModel.curAttrData.itemId))
|
| | | {
|
| | | matType = PetMatType.Pet;
|
| | | matType = PetOrMount.Pet;
|
| | | }
|
| | | else if (itemTipsModel.unlockMountDict.ContainsKey(itemTipsModel.curAttrData.itemId))
|
| | | {
|
| | | matType = PetMatType.Mount;
|
| | | matType = PetOrMount.Mount;
|
| | | }
|
| | |
|
| | | SetTopUI();
|
| | |
| | | Dictionary<int, int> itemEffectDict = null;
|
| | | switch (matType)
|
| | | {
|
| | | case PetMatType.Pet:
|
| | | case PetOrMount.Pet:
|
| | | PetInfoConfig petInfo = itemTipsModel.unlockPetDict[itemTipsModel.curAttrData.itemId];
|
| | | itemEffectDict = petmodel.GetPetAttrAddDict(petInfo.ID);
|
| | | break;
|
| | | case PetMatType.Mount:
|
| | | case PetOrMount.Mount:
|
| | | HorseConfig horseConfig = itemTipsModel.unlockMountDict[itemTipsModel.curAttrData.itemId];
|
| | | itemEffectDict = mountModel.GetMountAttrAddDict(horseConfig.HorseID);
|
| | | break;
|
| | |
| | | {
|
| | | switch (matType)
|
| | | {
|
| | | case PetMatType.Pet:
|
| | | case PetOrMount.Pet:
|
| | | PetInfoConfig petInfo = itemTipsModel.unlockPetDict[itemTipsModel.curAttrData.itemId];
|
| | | petSkillDict = itemTipsModel.GetPetSkillDict(itemTipsModel.curAttrData.itemId);
|
| | | modelShow.SetModelShow(petInfo.ID, ModelShowType.pet, Language.Get("TreasureEffect103"), petInfo.ShowFightPower);
|
| | | modelShow.SetModelShow(petInfo.ID, ModelShowType.Pet, Language.Get("TreasureEffect103"), petInfo.ShowFightPower);
|
| | | break;
|
| | | case PetMatType.Mount:
|
| | | case PetOrMount.Mount:
|
| | | HorseConfig horseConfig = itemTipsModel.unlockMountDict[itemTipsModel.curAttrData.itemId];
|
| | | mountSkillDict = itemTipsModel.GetMountSkillDict(itemTipsModel.curAttrData.itemId);
|
| | | modelShow.SetModelShow(horseConfig.Model, ModelShowType.mount, Language.Get("TreasureEffect103"), horseConfig.ShowFightPower);
|
| | | modelShow.SetModelShow(horseConfig.Model, ModelShowType.Mount, Language.Get("TreasureEffect103"), horseConfig.ShowFightPower);
|
| | | break;
|
| | | }
|
| | |
|
| | |
| | | switch (_type)
|
| | | {
|
| | | case FunctionUnlockType.Treasure:
|
| | | UI3DTreasureExhibition.Instance.BeginShowTreasure(m_Id, m_TreasureIcon);
|
| | | UI3DTreasureExhibition.Instance.ShowTreasure(m_Id, m_TreasureIcon);
|
| | | originalScale = 9f;
|
| | | break;
|
| | | case FunctionUnlockType.Normal:
|
| | |
| | | originalScale = 1f;
|
| | | break;
|
| | | case FunctionUnlockType.TreasureFunc:
|
| | | UI3DTreasureExhibition.Instance.BeginShowTreasure(m_Id, m_TreasureIcon);
|
| | | UI3DTreasureExhibition.Instance.ShowTreasure(m_Id, m_TreasureIcon);
|
| | | originalScale = 9f;
|
| | | break;
|
| | | }
|
| | |
| | | case FunctionUnlockType.Treasure:
|
| | | case FunctionUnlockType.TreasureSkill:
|
| | | case FunctionUnlockType.TreasureFunc:
|
| | | UI3DTreasureExhibition.Instance.StopShow();
|
| | | UI3DTreasureExhibition.Instance.Stop();
|
| | | break;
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | UI3DTreasureExhibition.Instance.StopShow();
|
| | | UI3DTreasureExhibition.Instance.Stop();
|
| | | for (int i = 0; i < funcBtnlist.Count; i++)
|
| | | {
|
| | | if (i < treasureIdlist.Count)
|
| | |
| | |
|
| | | selectTreasureId = treasureId;
|
| | | hostModel.SetSelectTreasureId(treasureId);
|
| | | UI3DTreasureExhibition.Instance.BeginShowTreasure(selectTreasureId, treasureIcon);
|
| | | UI3DTreasureExhibition.Instance.ShowTreasure(selectTreasureId, treasureIcon);
|
| | | CreateConditionCell();
|
| | | functionOrder = index;
|
| | | }
|
| | |
| | | RegisterModel<HazyRegionModel>();
|
| | | RegisterModel<HazyDemonKingModel>();
|
| | | RegisterModel<HazyGrassModel>();
|
| | | RegisterModel<DungeonUseBuffModel>();
|
| | | inited = true;
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void BeginShowTreasure(int _treasureId, RawImage _rawImage)
|
| | | public void ShowTreasure(int _treasureId, RawImage _rawImage)
|
| | | {
|
| | | var instance = UI3DModelFactory.LoadUITreasure(_treasureId);
|
| | | if (instance == null)
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | StopShow();
|
| | | Stop();
|
| | |
|
| | | m_ShowCamera.enabled = true;
|
| | | m_TreasureId = _treasureId;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void BeginShowGodWeapon(int _type, RawImage _rawImage)
|
| | | public void ShowGodWeapon(int _type, RawImage _rawImage)
|
| | | {
|
| | | var instance = UI3DModelFactory.LoadUIGodWeapon(_type);
|
| | | if (instance == null)
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | StopShow();
|
| | | Stop();
|
| | |
|
| | | m_ShowCamera.enabled = true;
|
| | | m_GodWeaponType = _type;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void StopShow()
|
| | | public void Stop()
|
| | | {
|
| | | m_ShowCamera.enabled = false;
|
| | | if (effect != null)
|
| | |
| | | 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; })); |
| | | normalTasks.Add(new ConfigInitTask("MapNpcRefreshConfig", () => { MapNpcRefreshConfig.Init(); }, () => { return MapNpcRefreshConfig.inited; })); |
| | | normalTasks.Add(new ConfigInitTask("MapNpcRefreshConfig", () => { MapNpcRefreshConfig.Init(); }, () => { return MapNpcRefreshConfig.inited; }));
|
| | | normalTasks.Add(new ConfigInitTask("DungeonUseBuffConfig", () => { DungeonUseBuffConfig.Init(); }, () => { return DungeonUseBuffConfig.inited; })); |
| | | } |
| | | |
| | | static List<ConfigInitTask> doingTasks = new List<ConfigInitTask>(); |
| | |
| | | JadeDynastyTower = 23,//诛仙塔排行榜
|
| | | Def_BT_NewFCCostGold = 24, //消费排行榜(新仙界盛典) 24
|
| | | }
|
| | |
|
| | | public enum PetOrMount
|
| | | {
|
| | | None,
|
| | | Pet,
|
| | | Mount,
|
| | | } |