public BagItemInfo(EquipListItem it, BagController ctl) { GameObject.Destroy(it.obj); Obj = ResManager.Instance.LoadPrefabFromRes("Prefab/Bagitem", true); Image = it.sprite; ItemCtl = Obj.GetComponent <BagItemController>(); ItemCtl.SetController(ctl); this.id = it.id; this.name = it.name; this.type = it.type; this.count = it.count; this.gain = it.gain; this.discribe = it.discribe; }
//c#传递class数据类型都是传引用 public void SetController(Bag.BagController bagCtl) { m_bagCtl = bagCtl; }