예제 #1
0
    public void InitializeInventoryUI(GameObject player)
    {
        Player    = player;
        inventory = Player.GetComponent <PlayerWeaponManager_Inventory>();
        inventory.onItemChangedCallBack += UpdateUI;

        UpdateUI();
    }
예제 #2
0
    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();
    }
예제 #3
0
 void Start()
 {
     isBuilding = false;
     spawnPoint = transform.Find("FirePointPivot/FirePoint").gameObject;
     Inventory  = FindObjectOfType <PlayerWeaponManager_Inventory>();
 }