update samples

This commit is contained in:
hevinci
2023-03-09 17:28:40 +08:00
parent c976221cbb
commit 9739fe2b79
19 changed files with 79 additions and 28 deletions
@@ -3,17 +3,26 @@ using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UniFramework.Window;
using YooAsset;
[WindowAttribute(100, false)]
public class UIAboutWindow : UIWindow
{
private Text _info;
private RawFileOperationHandle _handle;
public override void OnCreate()
{
var maskBtn = this.transform.Find("mask").GetComponent<Button>();
maskBtn.onClick.AddListener(OnClicMaskBtn);
_info = this.transform.Find("bg/info").GetComponent<Text>();
_handle = YooAssets.LoadRawFileAsync("about");
_handle.Completed += _handle_Completed;
}
public override void OnDestroy()
{
_handle.Release();
}
public override void OnRefresh()
{
@@ -22,6 +31,11 @@ public class UIAboutWindow : UIWindow
{
}
private void _handle_Completed(RawFileOperationHandle obj)
{
_info.text = _handle.GetRawFileText();
}
private void OnClicMaskBtn()
{
UniWindow.CloseWindow<UIAboutWindow>();