组件、对象的获取方式

private TweenPosition tween;//获取TweenPosition组件()ngui)

public List<InventoryItemGrid> itemGridList = new List<InventoryItemGrid>();//InventoryItemGrid是放在多个UI对象上的一个脚本的名字
public UILabel coinNumberLabel;//获取UI中的Label
void Awake() {

tween = this.GetComponent<TweenPosition>();
}

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