void Awake() { instance = this; OnPlayerInfoChanged += OnPlayerInfoChange; //注意将方法名字写对,该委托用于同步更新到服务器 roleController = GetComponent <RoleController>(); inventoryDBController = GetComponent <InventoryDBController>(); }
void Awake() { instance = this; inventoryDBController = GetComponent <InventoryDBController>(); inventoryDBController.OnGetInventoryDBList += OnGetInventoryDBList; inventoryDBController.OnAddInventoryDB += OnAddInventoryDB; InitInfo(); //初始化物品信息 }