90 lines
2.0 KiB
C#
90 lines
2.0 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Cysharp.Threading.Tasks;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using UnityEngine.UIElements;
|
|
using Button = UnityEngine.UI.Button;
|
|
using Image = UnityEngine.UI.Image;
|
|
using Toggle = UnityEngine.UI.Toggle;
|
|
using ScrollView = PhxhSDK.PhxhScrollView;
|
|
using Framework;
|
|
using Gameplay;
|
|
using Gameplay.Story;
|
|
|
|
public class UI_SkipPlotController : UIWindow
|
|
{
|
|
//UI GameObj
|
|
///Auto Gen Start///
|
|
public TMP_Text Text_PlotTitle;
|
|
public TMP_Text Text_PlotContent;
|
|
public Button Button_Cancel;
|
|
public Button Button_Confirm;
|
|
|
|
///Auto Gen End///
|
|
private int storyID;
|
|
|
|
public static async UniTask<UIWindow> Open()
|
|
{
|
|
return await UIManager.Instance.CreateAndOpenWindow(UINameConst.UISkipPlot);
|
|
}
|
|
// deal with input data
|
|
public override void PreLoad(object data = null)
|
|
{
|
|
|
|
}
|
|
|
|
// Use this for initialization
|
|
public override void OnInit()
|
|
{
|
|
//bind UI GameObj
|
|
UI_SkipPlotBinder.GetComponents(this);
|
|
var rawImageGaussianBlurMask = GetComponent<RawImage>("GaussianBlurMask");
|
|
rawImageGaussianBlurMask.texture = CommonUtils.GetScreenTexture2D();
|
|
|
|
BindButton(Button_Confirm, _OnClickConfirm);
|
|
BindButton(Button_Cancel, _OnClickClose);
|
|
}
|
|
|
|
//invoke when open window
|
|
protected override void OnShowWindow(object data = null)
|
|
{
|
|
_RefreshContent();
|
|
}
|
|
|
|
//invoke when reload window
|
|
protected override void OnReloadWindow(object data = null)
|
|
{
|
|
|
|
}
|
|
|
|
//invoke when close window
|
|
protected override void OnHideWindow()
|
|
{
|
|
|
|
}
|
|
|
|
//invoke when destroy
|
|
public override void OnRelease()
|
|
{
|
|
base.OnRelease();
|
|
}
|
|
|
|
private void _RefreshContent()
|
|
{
|
|
Text_PlotTitle.text = CommonUtils.GetLocalizeText(E_LocalizePrefix.story_title, StoryManager.instance.StoryMainCfg.Id);
|
|
Text_PlotContent.text = CommonUtils.GetLocalizeText(E_LocalizePrefix.story_content, StoryManager.instance.StoryMainCfg.Id);
|
|
}
|
|
|
|
private void _OnClickClose()
|
|
{
|
|
CloseWindow();
|
|
}
|
|
|
|
private void _OnClickConfirm()
|
|
{
|
|
EventManager.Instance.Send(EventManager.EventName.STORY_CLICK_SKIP);
|
|
CloseWindow();
|
|
}
|
|
} |