2025-05-22 18:04:02 +08:00
|
|
|
|
using QFramework;
|
|
|
|
|
|
using QFramework.Example;
|
|
|
|
|
|
using System.Collections;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
namespace QFramework
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
public class GuideTipAction : IAction
|
|
|
|
|
|
{
|
|
|
|
|
|
public System.Action OnFinished
|
|
|
|
|
|
{
|
|
|
|
|
|
get; set;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public ulong ActionID
|
|
|
|
|
|
{
|
|
|
|
|
|
get; set;
|
|
|
|
|
|
}
|
|
|
|
|
|
public ActionStatus Status
|
|
|
|
|
|
{
|
|
|
|
|
|
get; set;
|
|
|
|
|
|
}
|
|
|
|
|
|
public bool Deinited
|
|
|
|
|
|
{
|
|
|
|
|
|
get; set;
|
|
|
|
|
|
}
|
|
|
|
|
|
public bool Paused
|
|
|
|
|
|
{
|
|
|
|
|
|
get; set;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private GuideTipAction()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private static readonly SimpleObjectPool<GuideTipAction> mPool =
|
|
|
|
|
|
new SimpleObjectPool<GuideTipAction>(() => new (), null, 10);
|
|
|
|
|
|
Dictionary<string, string> datas;
|
|
|
|
|
|
|
|
|
|
|
|
public static GuideTipAction Allocate( Dictionary<string, string> datas, System.Action onDelayFinish = null)
|
|
|
|
|
|
{
|
|
|
|
|
|
var retNode = mPool.Allocate();
|
|
|
|
|
|
retNode.ActionID = ActionKit.ID_GENERATOR++;
|
|
|
|
|
|
retNode.Deinited = false;
|
|
|
|
|
|
retNode.Reset();
|
|
|
|
|
|
retNode.datas = datas;
|
|
|
|
|
|
return retNode;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Deinit()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!Deinited)
|
|
|
|
|
|
{
|
|
|
|
|
|
Deinited = true;
|
|
|
|
|
|
mPool.Recycle(this);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void OnExecute(float dt)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void OnFinish()
|
|
|
|
|
|
{
|
2025-05-27 11:56:08 +08:00
|
|
|
|
// Debug.Log("Action OnFinish???");
|
2025-05-22 18:04:02 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void OnStart()
|
|
|
|
|
|
{
|
|
|
|
|
|
UIGuideTipData data = new UIGuideTipData();
|
|
|
|
|
|
|
|
|
|
|
|
data.targets = datas.ContainsKey("targetName") ? datas["targetName"] : string.Empty;
|
2025-05-23 17:41:26 +08:00
|
|
|
|
data.showName = datas.ContainsKey("showName") ? datas["showName"] : string.Empty;
|
|
|
|
|
|
data.offestPos= datas.ContainsKey("offSet") ? datas["offSet"] : string.Empty;
|
2025-05-26 20:22:21 +08:00
|
|
|
|
//<2F><><EFBFBD>Ӹ<EFBFBD><D3B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ť <20><><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĺ<EFBFBD><C4B9>ܡ<EFBFBD>
|
2025-05-27 11:56:08 +08:00
|
|
|
|
data.tiptext = datas.ContainsKey("tiptext") ? datas["tiptext"] : string.Empty;
|
|
|
|
|
|
data.tipaudio = datas.ContainsKey("tipaudio") ? datas["tipaudio"] : string.Empty;
|
2025-05-27 14:15:36 +08:00
|
|
|
|
data.tiptitle = datas.ContainsKey("tiptitle") ? datas["tiptitle"] : string.Empty;
|
2025-05-26 20:22:21 +08:00
|
|
|
|
|
2025-05-23 17:41:26 +08:00
|
|
|
|
UIKit.OpenPanelAsync<UIGuideTip>(uiData: data, canvasLevel: UILevel.Common).ToAction().StartGlobal(() =>
|
|
|
|
|
|
{
|
|
|
|
|
|
this.Finish();
|
|
|
|
|
|
});
|
2025-05-22 18:04:02 +08:00
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Reset()
|
|
|
|
|
|
{
|
2025-05-26 19:19:40 +08:00
|
|
|
|
Status = ActionStatus.NotStart;
|
|
|
|
|
|
Paused = false;
|
2025-05-22 18:04:02 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|