using DG.Tweening; using System.Collections; using System.Collections.Generic; using UnityEngine; public class Littlepony2 : MonoBehaviour { public Transform points; public Transform tongs; private void OnTriggerStay(Collider other) { if (other.gameObject.CompareTag("Box")) { if (transform.childCount == 1) { //Debug.Log("hao"); if (points.childCount == 0) { GameObject game = transform.GetChild(0).gameObject; game.transform.SetParent(null); tongs.transform.DOMoveY(tongs.transform.position.y - 0.6f, 0.5f).SetEase(Ease.InOutQuad); game.transform.DOMoveY(game.transform.position.y - 1.33f, 1.5f).SetEase(Ease.InOutQuad).OnComplete(() => { game.transform.SetParent(points); tongs.transform.DOMoveY(tongs.transform.position.y + 0.4f, 0.2f).SetEase(Ease.InOutQuad); //Debug.Log("Âë¶â»ú·ÅÏä×ÓÍê±Ï"); }); } } } } }