// ***********************************************************************
// Assembly : Game
// Author : Kimch
// Created : 2020-09-15
// Description :
// Last Modified By :
// Last Modified On :
// ***********************************************************************
//
//
// ***********************************************************************
namespace G.UI
{
public partial class StoryWindow : KUIWindow
{
public static void ShowStory(StoryAction action)
{
var window = GetWindow();
if (window != null && window.active)
{
window.DoAction(action);
}
else
{
OpenWindow(action);
}
}
#region Constructor
public StoryWindow()
: base(UILayer.kFloat, UIMode.kNone)
{
uiPath = "ui_common/ui_w_story.prefab";
}
#endregion
#region Method
#endregion
#region Unity
///
///
///
public override void Awake()
{
InitView();
}
///
///
///
public override void OnEnable()
{
RegisterThis();
RefreshView();
}
public override void OnDisable()
{
UnregisterThis();
}
///
///
///
public override void Update()
{
}
///
///
///
public override void UpdatePerSecond()
{
UpdateView();
}
#endregion
#region Mediator
readonly int[] _notificationInterests = new int[]
{
GlobalDefine.EVENT_STORY_ACTION,
GlobalDefine.EVENT_STORY_FINISH
};
public override System.Collections.Generic.IList ListNotificationInterests()
{
return _notificationInterests;
}
public override void HandleNotification(PureMVC.Interfaces.INotification notification)
{
if (notification.Name == GlobalDefine.EVENT_STORY_ACTION)
{
DoAction(notification.Body as StoryAction);
}
else if (notification.Name == GlobalDefine.EVENT_STORY_FINISH)
{
CloseWindow(this);
}
}
#endregion
}
}