// *********************************************************************** // Assembly : Game // Author : Kimch // Created : 2021-04-17 // Description : // Last Modified By : // Last Modified On : // *********************************************************************** // // // *********************************************************************** using System.Collections; using System.Collections.Generic; using UnityEngine; namespace G.UI { public partial class RootWindow : KUIWindow { #region Constructor public RootWindow() : base(UILayer.kBackground, UIMode.kNone) { uiPath = "ui_common/ui_w_root.prefab"; } #endregion #region Method public void LoadCommon() { StartCoroutine(LoadEffectRoot()); } IEnumerator LoadEffectRoot() { yield return new WaitForSeconds(1f); var handle = AssetProxy.Instance.TryGetGlobalAssetAsync("ui_effect_root"); yield return handle; Object.Instantiate(handle.Result); } #endregion #region Unity /// /// /// public override void Awake() { InitView(); LoadCommon(); } /// /// /// public override void OnEnable() { RegisterThis(); RefreshView(); } public override void OnDisable() { UnregisterThis(); } /// /// /// public override void Update() { UpdateView(); } /// /// /// public override void UpdatePerSecond() { } #endregion #region Mediator readonly int[] _notificationInterests = new int[] { GlobalDefine.EVENT_PLAYER_ATTRIBUTES_CHANGED, }; public override IList ListNotificationInterests() { return _notificationInterests; } public override void HandleNotification(PureMVC.Interfaces.INotification notification) { if (notification.Name == GlobalDefine.EVENT_PLAYER_ATTRIBUTES_CHANGED) { int addCV = (int)notification.Body; if (addCV > 0) { #if UNITY_EDITOR Debug.Log($"{notification.Type} 战力增加 {addCV}"); #endif ToastBox.ShowCombatValue(PlayerProxy.Instance.combatValue, addCV, 0); } } } #endregion } }