59 lines
2.7 KiB
C#
59 lines
2.7 KiB
C#
using Cysharp.Threading.Tasks;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using TEngine;
|
|
using TMPro;
|
|
|
|
namespace GameLogic
|
|
{
|
|
[Window(UILayer.UI)]
|
|
class UIARPreviewWindow : UIWindow
|
|
{
|
|
#region 脚本工具生成的代码
|
|
private TextMeshProUGUI m_tmptextPetName;
|
|
private TextMeshProUGUI m_tmptextPetType;
|
|
private TextMeshProUGUI m_tmptextOwnName;
|
|
private TextMeshProUGUI m_tmptextPetOwnOri;
|
|
private TextMeshProUGUI m_tmptextPetOwnNum;
|
|
private Button m_btnSure;
|
|
protected override void ScriptGenerator() // AR宠物预览
|
|
{
|
|
m_tmptextPetName = FindChildComponent<TextMeshProUGUI>("ARPreview/PhoneBackground/Phone/PetInfo/Center/Group/m_tmptextPetName");
|
|
m_tmptextPetType = FindChildComponent<TextMeshProUGUI>("ARPreview/PhoneBackground/Phone/PetInfo/Center/Group/m_tmptextPetType");
|
|
m_tmptextOwnName = FindChildComponent<TextMeshProUGUI>("ARPreview/PhoneBackground/Phone/PetInfo/Center/Group/m_tmptextOwnName");
|
|
m_tmptextPetOwnOri = FindChildComponent<TextMeshProUGUI>("ARPreview/PhoneBackground/Phone/PetInfo/Center/Group/m_tmptextPetOwnOri");
|
|
m_tmptextPetOwnNum = FindChildComponent<TextMeshProUGUI>("ARPreview/PhoneBackground/Phone/PetInfo/Center/Group/m_tmptextPetOwnNum");
|
|
m_btnSure = FindChildComponent<Button>("ARPreview/Bottom/Mask/m_btnSure");
|
|
m_btnSure.onClick.AddListener(UniTask.UnityAction(OnClickSureBtn));
|
|
}
|
|
#endregion
|
|
|
|
#region 事件
|
|
private async UniTaskVoid OnClickSureBtn() // 确认
|
|
{
|
|
await UniTask.Yield();
|
|
GameModule.UI.CloseUI<UIARPreviewWindow>();
|
|
await ARBrochureHomeSystem.Instance.ShowAsyncAllMainUI();
|
|
}
|
|
#endregion
|
|
|
|
|
|
/// <summary>
|
|
/// 预览信息
|
|
/// </summary>
|
|
/// <param name="PetName">宠物名字</param>
|
|
/// <param name="PetType">宠物品种</param>
|
|
/// <param name="PetOwnName">宠物主人名字</param>
|
|
/// <param name="PetOwnOri">宠物主人地址</param>
|
|
/// <param name="PetOwnNumber">宠物主人号码</param>
|
|
public void PetInfoPreviewSetFunc(string PetName, string PetType, string PetOwnName, string PetOwnOri, string PetOwnNumber)
|
|
{
|
|
this.m_tmptextPetName.text = PetName;
|
|
this.m_tmptextPetType.text = PetType;
|
|
this.m_tmptextOwnName.text = PetOwnName;
|
|
this.m_tmptextPetOwnOri.text = PetOwnOri;
|
|
this.m_tmptextPetOwnNum.text = PetOwnNumber;
|
|
}
|
|
}
|
|
}
|