mirror of
https://github.com/Cardidi/dotween-upm-fork.git
synced 2025-12-21 01:36:05 +08:00
34 lines
522 B
C#
34 lines
522 B
C#
using DG.Tweening;
|
|
using System.Collections;
|
|
using UnityEngine;
|
|
|
|
public class From : BrainBase
|
|
{
|
|
public GameObject prefab;
|
|
|
|
Transform t;
|
|
|
|
void LateUpdate()
|
|
{
|
|
if (t != null) Debug.Log(">>> " + t.position);
|
|
}
|
|
|
|
void OnGUI()
|
|
{
|
|
DGUtils.BeginGUI();
|
|
|
|
if (GUILayout.Button("New FROM")) FromTween();
|
|
|
|
DGUtils.EndGUI();
|
|
}
|
|
|
|
void FromTween()
|
|
{
|
|
t = ((GameObject)Instantiate(prefab)).transform;
|
|
t.DOMove(new Vector3(0, 2, 0), 1)
|
|
.From()
|
|
.OnKill(() => Destroy(t.gameObject));
|
|
|
|
Debug.Log(t.position);
|
|
}
|
|
} |