public void InitializeInventoryUI(GameObject player) { Player = player; inventory = Player.GetComponent <PlayerWeaponManager_Inventory>(); inventory.onItemChangedCallBack += UpdateUI; UpdateUI(); }
public void SwitchWeapon() { InventoryUI inventory = GetGameObjectInRoot("Canvas").GetComponent <InventoryUI>(); PlayerWeaponManager_Inventory weaponManager = inventory.Player.GetComponent <PlayerWeaponManager_Inventory>(); int wid = weaponManager.Weapons.FindIndex(a => a == item); weaponManager.CmdSwitchWeapon(wid); inventory.OpenClose(); }
void Start() { isBuilding = false; spawnPoint = transform.Find("FirePointPivot/FirePoint").gameObject; Inventory = FindObjectOfType <PlayerWeaponManager_Inventory>(); }