Core/NetworkPackage/DTCFile/ServerPack/HA0_Sys/DTCA007_tagGCFBLinePlayerCnt.cs
@@ -17,6 +17,7 @@ ModelCenter.Instance.GetModel<MapModel>().UpdateDungeonMapLines(package); ModelCenter.Instance.GetModel<JadeDynastyBossModel>().OnReceivePackage(package); ModelCenter.Instance.GetModel<RidingPetBossModel>().ReceivePackage(package); } } Core/NetworkPackage/DTCFile/ServerPack/HAC_Activity/DTCAC07_tagGCHorsePetBossInfo.cs
New file @@ -0,0 +1,25 @@ //-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Friday, March 22, 2019 //-------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; using Snxxz.UI; public class DTCAC07_tagGCHorsePetBossInfo : DtcBasic { public override void Done(GameNetPackBasic vNetPack) { base.Done(vNetPack); var package = vNetPack as HAC07_tagGCHorsePetBossInfo; ModelCenter.Instance.GetModel<RidingPetBossModel>().ReceivePackage(package); } } Core/NetworkPackage/DTCFile/ServerPack/HAC_Activity/DTCAC07_tagGCHorsePetBossInfo.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 9e60f623bd383f54fae32a9701f02b1f timeCreated: 1553243342 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Core/NetworkPackage/ServerPack/HAC_Activity/HAC07_tagGCHorsePetBossInfo.cs
New file @@ -0,0 +1,17 @@ using UnityEngine; using System.Collections; // AC 07 骑宠Boss信息 #tagGCHorsePetBossInfo public class HAC07_tagGCHorsePetBossInfo : GameNetPackBasic { public uint IsEnd; // 是否已结束(按位代表对应线路是否结束) public HAC07_tagGCHorsePetBossInfo () { _cmd = (ushort)0xAC07; } public override void ReadFromBytes (byte[] vBytes) { TransBytes (out IsEnd, vBytes, NetDataType.DWORD); } } Core/NetworkPackage/ServerPack/HAC_Activity/HAC07_tagGCHorsePetBossInfo.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 60ff2ad7692bc504db195e2d653b01ef timeCreated: 1553243255 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Fight/Stage/Dungeon/DungeonStage.cs
@@ -239,6 +239,9 @@ case AllianceBossModel.DATAMAPID: WindowCenter.Instance.Open<AllianceBossHintWin>(); break; case RidingPetBossModel.RIDINGPETBOSS_MAP: WindowCenter.Instance.Open<RidingPetBossHintWin>(); break; default: WindowCenter.Instance.Open<DungeonStageTimeWin>(); break; System/Dungeon/DungeonModel.cs
@@ -829,6 +829,12 @@ WindowCenter.Instance.Open<AllianceBossHintWin>(); } break; case RidingPetBossModel.RIDINGPETBOSS_MAP: if (!WindowCenter.Instance.IsOpen<RidingPetBossHintWin>()) { WindowCenter.Instance.Open<RidingPetBossHintWin>(); } break; case TreasureModel.TREASURE_MAPID: break; case HeavenBattleModel.HEAVEBATTLE_MAPID: @@ -1032,6 +1038,9 @@ case AllianceBossModel.DATAMAPID: WindowCenter.Instance.Open<AllianceBossVictoryWin>(); break; case RidingPetBossModel.RIDINGPETBOSS_MAP: WindowCenter.Instance.Open<RidingPetBossVictoryWin>(); break; default: WindowCenter.Instance.Open<DungeonVictoryWin>(); break; System/Dungeon/TargetBriefInfoWin.cs
@@ -68,7 +68,8 @@ if (dataMapId == DemonJarModel.DEMONJAR_MAPID || dataMapId == JadeDynastyBossModel.JADEDYNASTY_MAP || dataMapId == JadeDynastyTowerModel.DATA_MAPID || dataMapId == AllianceBossModel.DATAMAPID) || dataMapId == AllianceBossModel.DATAMAPID || dataMapId == RidingPetBossModel.RIDINGPETBOSS_MAP) { if (_show) { @@ -112,7 +113,8 @@ if (dataMapId == DemonJarModel.DEMONJAR_MAPID || dataMapId == JadeDynastyBossModel.JADEDYNASTY_MAP || dataMapId == JadeDynastyTowerModel.DATA_MAPID || dataMapId == AllianceBossModel.DATAMAPID) || dataMapId == AllianceBossModel.DATAMAPID || dataMapId == RidingPetBossModel.RIDINGPETBOSS_MAP) { if (!WindowCenter.Instance.IsOpen("DemonJarBossLifeBarWin")) { @@ -331,7 +333,8 @@ if (dataMapId != DemonJarModel.DEMONJAR_MAPID && dataMapId != JadeDynastyBossModel.JADEDYNASTY_MAP && dataMapId != JadeDynastyTowerModel.DATA_MAPID && dataMapId != AllianceBossModel.DATAMAPID) && dataMapId != AllianceBossModel.DATAMAPID && dataMapId != RidingPetBossModel.RIDINGPETBOSS_MAP) { ShowBossLifeBar(bossInfo, true); } @@ -359,7 +362,8 @@ if (dataMapId != DemonJarModel.DEMONJAR_MAPID && dataMapId != JadeDynastyBossModel.JADEDYNASTY_MAP && dataMapId != JadeDynastyTowerModel.DATA_MAPID && dataMapId != AllianceBossModel.DATAMAPID) && dataMapId != AllianceBossModel.DATAMAPID && dataMapId != RidingPetBossModel.RIDINGPETBOSS_MAP) { if (bossInfo.npcId != TargetBriefInfo.bossInfo.npcId) { System/FairyAu/AllianceBossModel.cs
System/FindPrecious/FindPreciousBossBriefInfoBehaviour.cs
@@ -68,7 +68,6 @@ { base.Display(_data); bossId = (int)_data; var bossInfoQuery = m_RefreshAtOnce.AddMissingComponent<RebornRightNowBossInfoQuery>(); bossInfoQuery.bossId = bossId; findPreciousModel.bossSubscribeChangeEvent -= OnSubscribe; System/FindPrecious/LootPreciousFrameWin.cs
@@ -18,6 +18,7 @@ [SerializeField] FunctionButton m_FairyGrabBoss; [SerializeField] FunctionButton m_DogzDungeon; [SerializeField] FunctionButton m_JadeDynastyBoss; [SerializeField] FunctionButton m_RidingPetContention; [SerializeField] Button m_Left; [SerializeField] Button m_Right; @@ -32,6 +33,7 @@ { m_DemonJar.AddListener(ShowDemonJar); m_DogzDungeon.AddListener(ShowDogzDungeon); m_RidingPetContention.AddListener(ShowRidingPetContention); m_FairyGrabBoss.AddListener(FairyGrabBoss); m_JadeDynastyBoss.AddListener(JadeDynastyBoss); m_Left.AddListener(ShowLastFunction); @@ -93,6 +95,13 @@ functionOrder = m_DogzDungeon.order; } private void ShowRidingPetContention() { CloseSubWindows(); WindowCenter.Instance.Open<RidingPetContentionWin>(); functionOrder = m_RidingPetContention.order; } private void JadeDynastyBoss() { CloseSubWindows(); System/RidingPet.meta
New file @@ -0,0 +1,9 @@ fileFormatVersion: 2 guid: 553a9b041488000458f70910e659446e folderAsset: yes timeCreated: 1553495236 licenseType: Pro DefaultImporter: userData: assetBundleName: assetBundleVariant: System/RidingPet/BottomTip.cs
New file @@ -0,0 +1,36 @@ using Snxxz.UI; using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class BottomTip : MonoBehaviour { [SerializeField] Text bottomText; DailyQuestModel dailyQuestModel { get { return ModelCenter.Instance.GetModel<DailyQuestModel>(); } } public int m_ActivityID = 34; public void DisplayBottomStartTip() { DailyQuestOpenTime dailyQuestOpenTime; dailyQuestModel.TryGetOpenTime(m_ActivityID, out dailyQuestOpenTime); int secondsToNext = dailyQuestOpenTime.GetNextSessionSurplusTime(); int hour = secondsToNext / 3600; int min = secondsToNext % 3600 / 60; int seconds = secondsToNext % 3600 % 60; bottomText.text = "<color=red>"+"活动开启倒计时:" + hour + "小时" + min + "分" + seconds + "秒"+"</color>"; } public void DisplayBottomRemainTimeTip() { DailyQuestOpenTime dailyQuestOpenTime; dailyQuestModel.TryGetOpenTime(m_ActivityID, out dailyQuestOpenTime); HourMinute hourMin; dailyQuestOpenTime.TryGetNextOpenTime(out hourMin); DateTime endTime = new DateTime(TimeUtility.Year, TimeUtility.Month, TimeUtility.Day, hourMin.hourEnd, hourMin.minuteEnd, 0); TimeSpan remainTime = endTime - TimeUtility.ServerNow; bottomText.text = "<color=green>"+"活动剩余时间:" + remainTime.Hours + "小时" + remainTime.Minutes + "分" + remainTime.Seconds + "秒"+"</color>"; } } System/RidingPet/BottomTip.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 1cac12964546c3946b4c07e4a1ba90fe timeCreated: 1553911102 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: System/RidingPet/Container_RidingPet.cs
New file @@ -0,0 +1,96 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public enum RewardPositionType { Left, Right } namespace Snxxz.UI { public class Container_RidingPet : MonoBehaviour { [SerializeField] Text m_MountsBossName; [SerializeField] Text m_ActivityInfo; [SerializeField] RawImage m_BossRawImage; DailyQuestModel dailyQuestModel { get { return ModelCenter.Instance.GetModel<DailyQuestModel>(); } } public int RawImagetestBossID = 50103006; public RewardPositionType rewardPositonType; [SerializeField] ItemCell[] m_RewardArray; public int bossIdIndex = 0; public int m_ActivityID = 34; public void DisplayBossName() { m_MountsBossName.text = ModelCenter.Instance.GetModel<RidingPetBossModel>().GetBossName(bossIdIndex); } public void DisplayBossRawImage() { var config = NPCConfig.Get(RawImagetestBossID); UI3DModelExhibition.Instance.ShowNPC(RawImagetestBossID, config.UIModeLOffset, config.UIModelRotation, m_BossRawImage); } public void StopShowBossRawImage() { UI3DModelExhibition.Instance.StopShow(); } public void StopShowAnotherBossImage() { UI3DModelExhibition.InstanceClone1.StopShow(); } public void DisplayAnotherBossRawImage() { var config = NPCConfig.Get(RawImagetestBossID); UI3DModelExhibition.InstanceClone1.ShowNPC(RawImagetestBossID, config.UIModeLOffset, config.UIModelRotation, m_BossRawImage); } public void DisplaySpiritPetHP() { m_ActivityInfo.text = "剩余血量 " + ModelCenter.Instance.GetModel<RidingPetBossModel>().GetBossRemianedHP(bossIdIndex) + "%"; } public void DisplayActivityTime() { DailyQuestOpenTime dailyQuestOpentime; dailyQuestModel.TryGetOpenTime(m_ActivityID, out dailyQuestOpentime); HourMinute hourMin; dailyQuestOpentime.TryGetNextOpenTime(out hourMin); m_ActivityInfo.text = "活动时间 " + hourMin.hourBegin + ":" + hourMin.minuteBegin; } public void DisplayRewardItem() { switch (rewardPositonType) { case RewardPositionType.Left: ModelIDArrayToRewardItem(ModelCenter.Instance.GetModel<RidingPetBossModel>().Boss1RewardIDArray); break; case RewardPositionType.Right: ModelIDArrayToRewardItem(ModelCenter.Instance.GetModel<RidingPetBossModel>().Boss2RewardIDArray); break; } } public void ModelIDArrayToRewardItem(int[] idArray) { for (int i = 0; i < idArray.Length; i++) { var itemConfig = ItemConfig.Get(idArray[i]); if (itemConfig != null) { ItemCellModel cellModel = new ItemCellModel(itemConfig.ID, true, (ulong)1); m_RewardArray[i].Init(cellModel); } } } } } System/RidingPet/Container_RidingPet.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: f555c034244317d43bac755016b2469e timeCreated: 1553495311 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: System/RidingPet/RidingPetBossHintWin.cs
New file @@ -0,0 +1,115 @@ using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace Snxxz.UI { [XLua.Hotfix] public class RidingPetBossHintWin : Window { [SerializeField] Text m_Progress; [SerializeField] RankBehaviour[] m_Ranks; [SerializeField] Text m_MyHurt; [SerializeField] Text m_MyRank; DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } } const long BOSSHP_TOTAL = 1000000000; void DisplayProgress() { var mission = dungeonModel.mission; var currentHp = (long)(mission.remainHPPer * 0.000001d * BOSSHP_TOTAL); var progress = 1 - (float)currentHp / BOSSHP_TOTAL; m_Progress.text = StringUtility.Contact((int)(progress * 100), "%"); } void DisplayTop3HurtRank() { var mission = dungeonModel.mission; var hurtInfos = mission.hurtInfo; var index = 0; if (hurtInfos != null) { for (int i = 0; i < hurtInfos.Length; i++) { if (i < m_Ranks.Length) { m_Ranks[i].Display(hurtInfos[i].playerName, hurtInfos[i].totalHurt); } index++; } } for (int i = index; i < m_Ranks.Length; i++) { m_Ranks[i].Reset(); } } void DisplayMyHurtRank() { var mission = dungeonModel.mission; m_MyHurt.text = UIHelper.ReplaceLargeNum(mission.myHurtTotal); m_MyRank.text = mission.myRank == 0 ? string.Empty : mission.myRank.ToString(); } void DisplayAll() { DisplayProgress(); DisplayTop3HurtRank(); DisplayMyHurtRank(); } protected override void BindController() { } protected override void AddListeners() { } protected override void OnPreOpen() { dungeonModel.updateMissionEvent += DisplayAll; DisplayAll(); } protected override void OnAfterOpen() { } protected override void OnPreClose() { dungeonModel.updateMissionEvent -= DisplayAll; } protected override void OnAfterClose() { } } [Serializable] public class RankBehaviour { [SerializeField] Text m_FairyName; [SerializeField] Text m_Hurt; public void Display(string fairyName, long hurt) { m_FairyName.text = fairyName; m_Hurt.text = UIHelper.ReplaceLargeNum(hurt); } public void Reset() { m_FairyName.text = string.Empty; m_Hurt.text = string.Empty; } } } System/RidingPet/RidingPetBossHintWin.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 53a286b959429cd42a6446c64d2de46d timeCreated: 1554184819 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: System/RidingPet/RidingPetBossModel.cs
New file @@ -0,0 +1,138 @@ using System; using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Snxxz.UI { [XLua.LuaCallCSharp] [XLua.Hotfix] public class RidingPetBossModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk { public int[] BossIDArray; public int[] Boss1RewardIDArray; public int[] Boss2RewardIDArray; public bool isActivityOver { get; private set; } public const int RIDINGPETBOSS_MAP = 31200; Dictionary<int, RidingPetBossLine> RidingPetBossLineDict = new Dictionary<int, RidingPetBossLine>(); private string m_MountsBossID; private string m_Boss1RewardID; private string m_Boss2RewardID; public event Action GetRidingPetBossLineDictAction; public string MountsBossID { get { if (m_MountsBossID == null) { m_MountsBossID = FuncConfigConfig.Get("QCBOSSID").Numerical1; } return m_MountsBossID; } } public string Boss1RewardID { get { if (m_Boss1RewardID == null) { m_Boss1RewardID = FuncConfigConfig.Get("QCBOSSID").Numerical2; } return m_Boss1RewardID; } } public string Boss2RewardID { get { if (m_Boss2RewardID == null) { m_Boss2RewardID = FuncConfigConfig.Get("QCBOSSID").Numerical3; } return m_Boss2RewardID; } } public override void Init() { BossIDArray = ConfigParse.GetMultipleStr<int>(MountsBossID); Boss1RewardIDArray = ConfigParse.GetMultipleStr<int>(Boss1RewardID); Boss2RewardIDArray = ConfigParse.GetMultipleStr<int>(Boss2RewardID); } public void OnBeforePlayerDataInitialize() { } public void OnPlayerLoginOk() { } public override void UnInit() { } public void ReceivePackage(HAC07_tagGCHorsePetBossInfo package) { if (package.IsEnd == 1) { isActivityOver = true; } } public void ReceivePackage(HA007_tagGCFBLinePlayerCnt package) { if (package.MapID != RIDINGPETBOSS_MAP) { return; } RidingPetBossLineDict.Clear(); for (int i = 0; i < package.Count; i++) { var mapState = package.FBLineInfoList[i]; RidingPetBossLineDict[mapState.FBLineID] = new RidingPetBossLine() { playerCnt = mapState.PlayerCnt, remainedHP = int.Parse(mapState.ExtraStr) }; } if (GetRidingPetBossLineDictAction != null) { GetRidingPetBossLineDictAction(); } } public string GetBossName(int index) { return NPCConfig.Get(BossIDArray[index]).charName; } public int GetBossRemianedHP(int index) { if (RidingPetBossLineDict.Count == 0 || !RidingPetBossLineDict.ContainsKey(index)) { return 100; } else { return RidingPetBossLineDict[index].remainedHP; } } } public struct RidingPetBossLine { public int playerCnt; public int remainedHP; } } System/RidingPet/RidingPetBossModel.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: f098809addb595248b6974513a5c3889 timeCreated: 1553244454 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: System/RidingPet/RidingPetBossVictoryWin.cs
New file @@ -0,0 +1,215 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace Snxxz.UI { [XLua.Hotfix] public class RidingPetBossVictoryWin : Window { [SerializeField] Transform m_ContainerPoivt; [SerializeField] ButtonEx m_Exit; [SerializeField] Text m_ExitTimer; [SerializeField] Transform m_ContainerTopThree; [SerializeField] Image m_Rank; [SerializeField] Transform m_ContainerOutThree; [SerializeField] Text m_RankText; [SerializeField] Transform m_ContainerAuctionReward; [SerializeField] HorizontalLayoutGroup m_AuctionItemRoot; [SerializeField] ScrollRect m_AuctionItemScroll; [SerializeField] List<DemonJarRewardBehaviour> m_AuctionItems; [SerializeField] HorizontalLayoutGroup m_MyItemRoot; [SerializeField] ScrollRect m_MyItemScroll; [SerializeField] List<DemonJarRewardBehaviour> m_MyItems; [SerializeField] Button m_GotoAucton; float timer = 0f; RidingPetBossModel ridingPetBossModel { get { return ModelCenter.Instance.GetModel<RidingPetBossModel>(); } } DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } } protected override void AddListeners() { m_GotoAucton.AddListener(GotoAuction); m_Exit.AddListener(ExitDungeon); } protected override void BindController() { } protected override void OnAfterClose() { } protected override void OnAfterOpen() { } protected override void OnPreClose() { } protected override void OnPreOpen() { m_ContainerPoivt.gameObject.SetActive(false); } protected override void OnActived() { base.OnActived(); if (!WindowJumpMgr.Instance.IsJumpState) { var config = DungeonOpenTimeConfig.Get(dungeonModel.dungeonResult.dataMapID); StartCoroutine(Co_DelayDisplay(config.DelayTime * 0.001f)); } else { DisplayAll(); } } protected override void LateUpdate() { base.LateUpdate(); timer -= Time.deltaTime; if (timer < 0f) { timer += 0.5f; var endTime = dungeonModel.GetCoolDownEndTime(DungeonCoolDownType.LeaveMap); var seconds = (endTime - TimeUtility.ServerNow).TotalSeconds; DrawExitTimer((int)seconds); } } IEnumerator Co_DelayDisplay(float _delay) { yield return new WaitForSeconds(_delay); DisplayAll(); } private void DisplayAll() { m_ContainerPoivt.gameObject.SetActive(true); DisplayDungeonExit(); DisplayWinOrRank(); DisplayAuctionItem(); DisPlayMyItem(); } void DisplayDungeonExit() { var endTime = dungeonModel.GetCoolDownEndTime(DungeonCoolDownType.LeaveMap); var seconds = (endTime - TimeUtility.ServerNow).TotalSeconds; timer = (float)seconds - (int)seconds; DrawExitTimer((int)seconds); } void DrawExitTimer(int seconds) { m_ExitTimer.text = Language.Get("DungeonVictoryWin_Btn_Exit_1", Mathf.Clamp(seconds, 0, int.MaxValue)); } private void DisplayWinOrRank() { var result = dungeonModel.dungeonResult; bool top3 = result.rank <= 3 && result.rank > 0; m_ContainerTopThree.gameObject.SetActive(top3); m_ContainerOutThree.gameObject.SetActive(!top3); if (top3) { m_Rank.SetSprite(StringUtility.Contact("AllianceBossRank_", result.rank)); } m_RankText.text = Language.Get("AllianceBossRank", result.rank); } private void GotoAuction() { WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.FairyAuction); } private void ExitDungeon() { dungeonModel.ExitCurrentDungeon(); } private void DisplayAuctionItem() { var result = dungeonModel.dungeonResult; if (result.AuctionItem != null) { GenerateRewardBehaviour(m_AuctionItems,m_AuctionItemRoot.transform,result.AuctionItem.Length); m_AuctionItemScroll.horizontal = result.AuctionItem.Length > 3; m_AuctionItemRoot.childAlignment = result.AuctionItem.Length > 3 ? TextAnchor.MiddleLeft : TextAnchor.MiddleCenter; } m_AuctionItemScroll.horizontalNormalizedPosition = 0; var existAuctionItem = result.AuctionItem != null && result.AuctionItem.Length > 0; m_ContainerAuctionReward.gameObject.SetActive(existAuctionItem); if (existAuctionItem) { for (int i = 0; i < m_AuctionItems.Count; i++) { if (i < result.AuctionItem.Length) { var serverItem = result.AuctionItem[i]; m_AuctionItems[i].gameObject.SetActive(true); m_AuctionItems[i].Display(new Item(serverItem.ItemID, serverItem.Count)); } else { m_AuctionItems[i].gameObject.SetActive(false); } } } } private void DisPlayMyItem() { var result = dungeonModel.dungeonResult; if (result.itemInfo != null) { GenerateRewardBehaviour(m_MyItems, m_MyItemRoot.transform, result.itemInfo.Length); m_MyItemScroll.horizontal = result.itemInfo.Length > 3; m_MyItemRoot.childAlignment = result.itemInfo.Length > 3 ? TextAnchor.MiddleLeft : TextAnchor.MiddleCenter; } m_MyItemScroll.horizontalNormalizedPosition = 0; for (int i = 0; i < m_MyItems.Count; i++) { if (result.itemInfo != null && i < result.itemInfo.Length) { var serverItem = result.itemInfo[i]; m_MyItems[i].gameObject.SetActive(true); m_MyItems[i].Display(new Item(serverItem.ItemID, serverItem.Count)); } else { m_MyItems[i].gameObject.SetActive(false); } } } private void GenerateRewardBehaviour(List<DemonJarRewardBehaviour> rewardBehaviours, Transform _parent, int _needCount) { var nowCount = rewardBehaviours.Count; var dif = _needCount - nowCount; if (dif > 0) { for (int i = 0; i < dif; i++) { var instance = UIUtility.CreateWidget("DemonJarRewardBehaviour", "DemonJarRewardBehaviour"); var behaviour = instance.GetComponent<DemonJarRewardBehaviour>(); rewardBehaviours.Add(behaviour); instance.transform.SetParentEx(_parent, Vector3.zero, Vector3.zero, Vector3.one); } } } } } System/RidingPet/RidingPetBossVictoryWin.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 21afb33927741734ca35b87b7c2fea66 timeCreated: 1554271297 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: System/RidingPet/RidingPetContentionWin.cs
New file @@ -0,0 +1,123 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace Snxxz.UI { public class RidingPetContentionWin : Window { [SerializeField] Button m_MountsGoToButton; [SerializeField] Button m_SpiritPetGoToButton; [SerializeField] Container_RidingPet m_Container_Mounts; [SerializeField] Container_RidingPet m_Container_SpiritPet; [SerializeField] BottomTip m_BottomTip; MapModel mapModel { get { return ModelCenter.Instance.GetModel<MapModel>(); } } RidingPetBossModel ridingPetBossModel { get { return ModelCenter.Instance.GetModel<RidingPetBossModel>(); } } DungeonModel dungeondel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } } DailyQuestModel dailyQuestModel { get { return ModelCenter.Instance.GetModel<DailyQuestModel>(); } } private float m_Timer = 0; protected override void AddListeners() { m_MountsGoToButton.AddListener(GoToKillMountsBoss); m_SpiritPetGoToButton.AddListener(GoToKillSpiritPetBoss); } protected override void BindController() { } protected override void OnAfterClose() { m_Container_Mounts.StopShowBossRawImage(); m_Container_SpiritPet.StopShowAnotherBossImage(); } protected override void OnAfterOpen() { } protected override void OnPreClose() { ridingPetBossModel.GetRidingPetBossLineDictAction -= GetRidingBossDictPackageAction; } protected override void OnPreOpen() { m_Container_Mounts.DisplayBossName(); m_Container_SpiritPet.DisplayBossName(); ridingPetBossModel.GetRidingPetBossLineDictAction += GetRidingBossDictPackageAction; mapModel.RequestQueryMapLineState(RidingPetBossModel.RIDINGPETBOSS_MAP); GetRidingBossDictPackageAction(); m_Container_Mounts.DisplayBossRawImage(); m_Container_SpiritPet.DisplayAnotherBossRawImage(); m_Container_Mounts.DisplayRewardItem(); m_Container_SpiritPet.DisplayRewardItem(); } private void GoToKillMountsBoss() { dungeondel.SingleChallenge(RidingPetBossModel.RIDINGPETBOSS_MAP, m_Container_Mounts.bossIdIndex); } private void GoToKillSpiritPetBoss() { dungeondel.SingleChallenge(RidingPetBossModel.RIDINGPETBOSS_MAP, m_Container_SpiritPet.bossIdIndex); } protected override void LateUpdate() { m_Timer += Time.deltaTime; if (m_Timer > 5) { mapModel.RequestQueryMapLineState(RidingPetBossModel.RIDINGPETBOSS_MAP); m_Timer -= 5; } UpdatebottomTip(); } public void GetRidingBossDictPackageAction() { switch (dailyQuestModel.GetQuestState(m_Container_Mounts.m_ActivityID)) { case DailyQuestModel.DailyQuestState.Completed: case DailyQuestModel.DailyQuestState.Normal: m_Container_Mounts.DisplaySpiritPetHP(); break; default: m_Container_Mounts.DisplayActivityTime(); break; } switch (dailyQuestModel.GetQuestState(m_Container_SpiritPet.m_ActivityID)) { case DailyQuestModel.DailyQuestState.Completed: case DailyQuestModel.DailyQuestState.Normal: m_Container_SpiritPet.DisplaySpiritPetHP(); break; default: m_Container_SpiritPet.DisplayActivityTime(); break; } } public void UpdatebottomTip() { switch (dailyQuestModel.GetQuestState(m_BottomTip.m_ActivityID)) { case DailyQuestModel.DailyQuestState.Completed: case DailyQuestModel.DailyQuestState.Normal: m_BottomTip.DisplayBottomRemainTimeTip(); break; default: m_BottomTip.DisplayBottomStartTip(); break; } } } } System/RidingPet/RidingPetContentionWin.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 43221548898cbbc4c9a345f385caddcb timeCreated: 1553496711 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Test.meta
New file @@ -0,0 +1,9 @@ fileFormatVersion: 2 guid: ee14af80141216d40bec149a394c6fc0 folderAsset: yes timeCreated: 1553503303 licenseType: Pro DefaultImporter: userData: assetBundleName: assetBundleVariant: Test/testbutton.cs
New file @@ -0,0 +1,20 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using Snxxz.UI; public class testbutton : MonoBehaviour { [SerializeField] Button self; private void Awake() { self.onClick.AddListener(Open); } private void Open() { WindowCenter.Instance.Open<RidingPetContentionWin>(); } } Test/testbutton.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: de5511c7b581c4b45821bb3c09c156f0 timeCreated: 1553503325 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: