53 lines
1.1 KiB
C#
53 lines
1.1 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using System;
|
|
using DG.Tweening;
|
|
|
|
public class GameSceneBtn : MonoBehaviour
|
|
{
|
|
public static Action OnSceneMouseBTN;
|
|
private SceneSpriteAniationPro aniationPro;
|
|
float time;
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
OnSceneMouseBTN += JUmpScem;
|
|
aniationPro = GetComponent<SceneSpriteAniationPro>();
|
|
}
|
|
|
|
|
|
private void OnMouseDown()
|
|
{
|
|
|
|
transform.DOScale(new Vector3(0.5f, 0.5f, 0.5f), 0.3f).SetEase(Ease.OutBack);
|
|
StartCoroutine("Magnify");
|
|
}
|
|
|
|
|
|
IEnumerator Magnify()
|
|
{
|
|
transform.DOScale(Vector3.one, 0.5f).SetEase(Ease.OutBack);
|
|
OnSceneMouseBTN();
|
|
return null;
|
|
}
|
|
|
|
void JUmpScem()
|
|
{
|
|
Debug.Log("====");
|
|
Promptmgr.Instance.PromptBubble("ÔÝ먦·Å");
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
time += Time.deltaTime;
|
|
if (time > 3)
|
|
{
|
|
time = 0;
|
|
aniationPro.SetAni(UnityEngine.Random.Range(0,5));
|
|
}
|
|
|
|
}
|
|
|
|
}
|