思路:
1,UI设计
2,通过Id自动添加物品,使用Grid排序
UI设计
添加这个sprite,为商店背景,在其下添加Scroll View 和 Scroll Bar,把Scroll Bar 拖到Scroll View 下的UI Scroll View组件的Scroll Bars 。在Scroll View 下添加一个Grid,调整Grid的位置,用来排序。
通过ID添加物品
添加脚本Shop,编辑脚本
public static Shop _instance;
public int[] objectItemID;
public UIGrid grid;
public GameObject ObjectItemPre;
public GameObject BuyBar;
private TweenScale TS;
private bool isshow = false;
void Awake()
{
_instance = this;
TS = GetComponent<Twee