52 lines
1.1 KiB
C#
52 lines
1.1 KiB
C#
using Unity.VisualScripting;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class TweenScript : MonoBehaviour
|
|
{
|
|
|
|
[SerializeField] private float duration;
|
|
[SerializeField] private GameObject button;
|
|
|
|
//private KeyCode secretCode = KeyCode.G;
|
|
|
|
Vector3 ort = new Vector3();
|
|
|
|
public void Start()
|
|
{
|
|
duration = 2;
|
|
//button = this.GameObject;
|
|
}
|
|
|
|
public void Update()
|
|
{
|
|
OnClick();
|
|
}
|
|
|
|
public void Scale()
|
|
{
|
|
LeanTween.scale(button, transform.localScale * 1.1f, duration * Time.deltaTime).setEase(LeanTweenType.easeOutBounce);
|
|
//LeanTween.scale(Trinagle, new Vector3(2,2,2), duration).setOnComplete(Debug.Log);
|
|
}
|
|
|
|
private void Move()
|
|
{
|
|
LeanTween.moveX(button, button.transform.position.y, duration * Time.deltaTime);
|
|
}
|
|
|
|
public void Bounce()
|
|
{
|
|
//code folgt
|
|
//code steht in scale
|
|
//mach circle bounce on space press
|
|
}
|
|
|
|
public void OnClick()
|
|
{
|
|
if (Input.GetKeyDown(KeyCode.Mouse1))
|
|
{
|
|
Scale();
|
|
}
|
|
}
|
|
}
|