30 lines
916 B
C#
30 lines
916 B
C#
using DG.Tweening;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Littlepony : MonoBehaviour
|
|
{
|
|
public Transform points;
|
|
public Transform tongs;
|
|
private void OnTriggerStay(Collider other)
|
|
{
|
|
if (other.gameObject.CompareTag("Box"))
|
|
{
|
|
if (transform.childCount == 1)
|
|
{
|
|
if (transform.GetChild(0).childCount == 1)
|
|
{
|
|
GameObject game = transform.GetChild(0).GetChild(0).gameObject;
|
|
game.transform.SetParent(null);
|
|
tongs.transform.DOMoveY(tongs.transform.position.y + 0.2f, 0.2f).SetEase(Ease.InOutQuad).OnComplete(() =>
|
|
{
|
|
game.transform.SetParent(points);
|
|
//Debug.Log("Âë¶â»ú²ðÏä×ÓÍê±Ï");
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|