From 596790f0ddffe3400365c064c50de7a9b4bbe568 Mon Sep 17 00:00:00 2001
From: client_Hale <339726288@qq.com>
Date: 星期三, 22 五月 2019 14:07:30 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
---
System/MainInterfacePanel/InGamePushContainer.cs | 84 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 83 insertions(+), 1 deletions(-)
diff --git a/System/MainInterfacePanel/InGamePushContainer.cs b/System/MainInterfacePanel/InGamePushContainer.cs
index 3cf8e36..778b812 100644
--- a/System/MainInterfacePanel/InGamePushContainer.cs
+++ b/System/MainInterfacePanel/InGamePushContainer.cs
@@ -6,7 +6,7 @@
using System.Collections;
using UnityEngine.UI;
using System;
-
+using System.Collections.Generic;
namespace Snxxz.UI
{
@@ -31,6 +31,9 @@
[SerializeField] MyFocusAuctionBehaviour m_MyFocusBehavio;
[SerializeField] AuctionNewGetBehaviour m_AuctionNewGetBehaviour;
+ List<IInGamePush> m_InGamePushs = new List<IInGamePush>();
+ Dictionary<IInGamePush, Transform> m_InGamePushTrans = new Dictionary<IInGamePush, Transform>();
+
WorldBossModel worldBossModel { get { return ModelCenter.Instance.GetModel<WorldBossModel>(); } }
DogzDungeonModel dogzDungeonModel { get { return ModelCenter.Instance.GetModel<DogzDungeonModel>(); } }
CrossServerBossModel crossServerBossModel { get { return ModelCenter.Instance.GetModel<CrossServerBossModel>(); } }
@@ -52,6 +55,35 @@
DogzModel dogzModel { get { return ModelCenter.Instance.GetModel<DogzModel>(); } }
InSevenDayModel inSevenDayModel { get { return ModelCenter.Instance.GetModel<InSevenDayModel>(); } }
AuctionNewGetShowModel auctionNewGetShowModel { get { return ModelCenter.Instance.GetModel<AuctionNewGetShowModel>(); } }
+
+ private void Awake()
+ {
+ SetInGamePush(m_BetterEquipPusher, m_BetterEquipPusher.transform);
+ SetInGamePush(m_RealmBetterEquipPusher, m_RealmBetterEquipPusher.transform);
+ SetInGamePush(m_PreciousItemPusher, m_PreciousItemPusher.transform);
+ SetInGamePush(m_BossRebornPusher, m_BossRebornPusher.transform);
+ SetInGamePush(m_itemUsePusher, m_itemUsePusher.transform);
+ SetInGamePush(m_itemOverduePusher, m_itemOverduePusher.transform);
+ SetInGamePush(m_ResourceBackBehaviour, m_ResourceBackBehaviour.transform);
+ SetInGamePush(m_DecomposePusher, m_DecomposePusher.transform);
+ SetInGamePush(m_OffLineTimeLackBehaviour, m_OffLineTimeLackBehaviour.transform);
+ SetInGamePush(m_DungeonGuardBehaviour, m_DungeonGuardBehaviour.transform);
+ SetInGamePush(m_FirstChargeTrialBehaviour, m_FirstChargeTrialBehaviour.transform);
+ SetInGamePush(m_FairyGrabBossHelpBehaviour, m_FairyGrabBossHelpBehaviour.transform);
+ SetInGamePush(m_DogzNotifyBehaviour, m_DogzNotifyBehaviour.transform);
+ SetInGamePush(m_InSevenDayBehavior, m_InSevenDayBehavior.transform);
+ SetInGamePush(m_HelpPointExchangeNotify, m_HelpPointExchangeNotify.transform);
+ SetInGamePush(m_MyFocusBehavio, m_MyFocusBehavio.transform);
+ SetInGamePush(m_AuctionNewGetBehaviour, m_AuctionNewGetBehaviour.transform);
+
+ SetInGamePushContainerSort();
+ }
+
+ void SetInGamePush(IInGamePush inGamePush, Transform trans)
+ {
+ m_InGamePushs.Add(inGamePush);
+ m_InGamePushTrans.Add(inGamePush, trans);
+ }
public void Init()
{
@@ -367,9 +399,11 @@
{
case GuideTriggerType.EquipQuality:
m_BetterEquipPusher.transform.SetAsLastSibling();
+ SetInGamePushContainerSort();
break;
case GuideTriggerType.Item:
m_PreciousItemPusher.transform.SetAsLastSibling();
+ SetInGamePushContainerSort();
break;
default:
break;
@@ -435,8 +469,56 @@
m_FairyGrabBossHelpBehaviour.gameObject.SetActive(false);
}
}
+
+ void SetInGamePushContainerSort()
+ {
+ m_InGamePushs.Sort((x, y) =>
+ {
+ return -x.GetSiblingIndex().CompareTo(y.GetSiblingIndex());
+ });
+
+ SetInGamePushContainerScale();
+ }
+
+ void SetInGamePushContainerScale()
+ {
+ var alreadyExist = false;
+ for (int i = 0; i < m_InGamePushs.Count; i++)
+ {
+ var inGamePush = m_InGamePushs[i];
+ var trans = m_InGamePushTrans[inGamePush];
+ if (inGamePush.IsActive())
+ {
+ if (!alreadyExist)
+ {
+ if (!trans.localScale.Equals(Vector3.one))
+ {
+ trans.localScale = Vector3.one;
+ }
+ }
+ else
+ {
+ if (!trans.localScale.Equals(Vector3.zero))
+ {
+ trans.localScale = Vector3.zero;
+ }
+ }
+ alreadyExist = true;
+ }
+ }
+ }
+
+ private void LateUpdate()
+ {
+ SetInGamePushContainerScale();
+ }
}
+ public interface IInGamePush
+ {
+ int GetSiblingIndex();
+ bool IsActive();
+ }
}
--
Gitblit v1.8.0