using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using JC; /* 商城界面 */ public class ShopView : JCUnityLib.ViewBase, MenuBackInterface { [SerializeField] Sprite[] optionSprites; [SerializeField] GameObject options; [SerializeField] ScrollPanel productsPanel; [SerializeField] ScrollPanel bagPanel; [SerializeField] ScrollPanel equippedPanel; [SerializeField] GameObject introduceItem; public static ShopView ins; void Start() { ins = this; PersistenHandler.ins?.menuBackCtr.views.Add(this); TopBarView.NeedShowIt(this); InitOptions(); } void OnDestroy() { if (ins == this) ins = null; PersistenHandler.ins?.menuBackCtr.views.Remove(this); TopBarView.DontNeedShowIt(this); } public bool OnMenuBack() { ViewMgr.Instance.DestroyView(); return true; } void InitOptions() { for (int i = 0; i < this.options.transform.childCount; i++) { int index = i; Button button = this.options.transform.GetChild(i).gameObject.AddComponent