33 lines
1.0 KiB
C#
33 lines
1.0 KiB
C#
using DG.Tweening;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class test : MonoBehaviour
|
|
{
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
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();
|
|
});
|
|
}
|
|
float timer = 1f;
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
timer -= Time.deltaTime;
|
|
if (timer < 0)
|
|
{
|
|
transform.Find("Image").DOLocalMoveX(-100* UnityEngine.Random.Range(0, 1.5f), 0.5f);
|
|
timer += 1f;
|
|
}
|
|
}
|
|
}
|