右上角游戏

This commit is contained in:
2025-08-11 19:34:53 +08:00
parent f1aeeb6bf3
commit d2210e5387
33 changed files with 7220 additions and 4332 deletions
@@ -1,4 +1,6 @@
using System;
using AibisDream.Kit;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
using Random = UnityEngine.Random;
@@ -17,19 +19,17 @@ namespace AibisDream.FixSystem
[SerializeField] private Image target;
[SerializeField] private Image slot;
[SerializeField] private SliderEx slider;
[SerializeField] private TMP_Text infoText;
#endregion
private float _normalizePosX;
public event Action<bool> OnVerificationEnd;
private void Start()
{
StartVerification();
}
public void StartVerification()
{
infoText.text = "请将图片拖动至对应位置";
gameObject.SetActive(true);
_normalizePosX = Random.Range(0.4f, 0.9f);
// 随机生成数据,包括Slot位置,有资源之后增加背景图
var slotWidth = target.rectTransform.rect.width;
@@ -56,11 +56,13 @@ namespace AibisDream.FixSystem
// 如果失败就再来一次
if (!isSuccess)
{
StartVerification();
infoText.text = "失败";
ActionKit.Delay(1f, StartVerification).Start(this);
}
else
{
gameObject.SetActive(false);
infoText.text = "成功";
ActionKit.Delay(0.5f, () => gameObject.SetActive(false)).Start(this);
}
}