TIL (Today I Learned)/Unity
[Unity, MacOS] LeanTween
loki d
2021. 9. 17. 23:55
728x90
LeanTween
- ์ ๋๋ฉ์ด์ ๋๊ตฌ์ด๋ค.
- Unity์์ ๋ถ๋๋ฌ์ด ํจ๊ณผ๋ฅผ ์ํด์ ์ ๋๋ฉ์ด์ ์ ๋ฃ์ด ํํํ ์ ์๋ค.
- ํ์ง๋ง ์ ๋๋ฉ์ด์ ์ ๋ฃ์ ๊ฒฝ์ฐ Idleํ ํ๋ก์ธ์ค๊ฐ ์ฆ๊ฐํ๊ธฐ ๋๋ฌธ์ ๋นํจ์จ์ ์ด๋ค.
- LeanTween์ import ํด์ ์ฌ์ฉํ๋ ๊ฒ์ ์ถ์ฒ
LeanTween import

Script CS
using System;
using System.Collections;
using System.Collections.Generic;
using DilmerGames.Core.Singletons;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.XR.ARFoundation;
using UnityEngine.XR.ARSubsystems;
public class AlertMessageController : MonoBehaviour
{
[SerializeField]
public GameObject AlertPanel;
[SerializeField]
public Text AlertText;
[SerializeField]
public GameObject StartPoint;
[SerializeField]
public GameObject EndPoint;
public void popUpMessage(string msg)
{
AlertText.text = msg;
LeanTween.move(AlertPanel, StartPoint.transform.position , 0.2f).setOnComplete(Destroy);
}
void Destroy()
{
LeanTween.move(AlertPanel, EndPoint.transform.position, 1f).setDelay(1f);
}
}
ํด๋น object์ Inspector

start point

end point
