NGUI中的Tween Position动画

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Inventory : MonoBehaviour {

public static Inventory _instance;
private TweenPosition tween;//获取组件
void Awake() {
_instance = this;
tween = this.GetComponent<TweenPosition>();//获取组件
}
void Update () {

}

//需要播放的UI动画是从UI界面外移到UI界面里
public void Show() {
tween.PlayForward();//播放动画

}
public void Hide() {
tween.PlayReverse();//反向播放动画
}
}

原文地址:https://www.cnblogs.com/panyuyi/p/6881886.html