33 lines
1.0 KiB
C#
Raw Normal View History

2022-04-11 11:40:02 +08:00
using DG.Tweening;
using System.Collections;
2022-02-18 18:12:31 +08:00
using System.Collections.Generic;
using UnityEngine;
public class test : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
2022-04-11 11:40:02 +08:00
UIManager.AddEvent(transform.Find("Button").gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
{
transform.Find("Container").GetComponent<RowerTraceAnimated>().startAnimation(0.5f, () => { }).Play();
});
UIManager.AddEvent(transform.Find("BtnUp").gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
{
transform.Find("Container").GetComponent<RowerTraceAnimated>().startAnimation(0.5f, () => { },1).Play();
});
2022-02-18 18:12:31 +08:00
}
2022-04-27 14:48:06 +08:00
float timer = 1f;
2022-02-18 18:12:31 +08:00
// Update is called once per frame
void Update()
{
2022-04-27 14:48:06 +08:00
timer -= Time.deltaTime;
if (timer < 0)
{
transform.Find("Image").DOLocalMoveX(-100* UnityEngine.Random.Range(0, 1.5f), 0.5f);
timer += 1f;
}
2022-02-18 18:12:31 +08:00
}
}