Example #1
0
    // private V_Character tmpCharacter1, tmpCharacter2;



    // methods
    public new void Awake()
    {
        base.Awake();
        inventoryItems = GetComponent <V_InventoryItems>();

        inGamePistols          = new List <V_InventoryItem>();
        inGameRifles           = new List <V_InventoryItem>();
        inGameRifles_secondary = new List <V_InventoryItem>();

        try
        {
            weaponComparer    = weaponComp.GetComponent <V_WeaponComparison>();
            gearComparer      = gearComp.GetComponent <V_GearComparison>();
            characterComparer = characterComp.GetComponent <V_CharacterComparison>();
        }
        catch (System.Exception err)
        {
            UIController.ThrowError("V_Inventory_UI: Awake(): " + err.Message, () => { UIController.CloseError(); return; });
        }

        // main buttons
        UIController.IfClick_GoTo(WeaponsBtn, () =>
        {
            UIController.Enable_DisableUI(weaponPanel, gearPanel, charactersPanel);
            StopComparing();
        });

        UIController.IfClick_GoTo(GearsBtn, () =>
        {
            UIController.Enable_DisableUI(gearPanel, weaponPanel, charactersPanel);
            StopComparing();
        });

        UIController.IfClick_GoTo(CharactersBtn, () =>
        {
            UIController.Enable_DisableUI(charactersPanel, weaponPanel, gearPanel);
            StopComparing();
        });

        // sub buttons: Weapons

        UIController.IfClick_GoTo(pistolsBtn, () => UIController.Enable_DisableUI(pistolPanel, assaultPanel));
        UIController.IfClick_GoTo(assaultsBtn, () => UIController.Enable_DisableUI(assaultPanel, pistolPanel));

        // sub buttons: Gears
        UIController.IfClick_GoTo(upperBodyBtn, () => UIController.Enable_DisableUI(upperBodyPanel, lowerBodyPanel, headPanel));
        UIController.IfClick_GoTo(lowerBodyBtn, () => UIController.Enable_DisableUI(lowerBodyPanel, upperBodyPanel, headPanel));
        UIController.IfClick_GoTo(headBtn, () => UIController.Enable_DisableUI(headPanel, upperBodyPanel, lowerBodyPanel));

        // equipped Items
        UIController.IfClick_GoTo(inGamePistolsBtn, () => UIController.Enable_DisableUI(inGamePistolPanel, inGameAssaultPanel, inGameSecAssaultPanel, inGameGerenadePanel, inGameMeleePanel));
        UIController.IfClick_GoTo(inGameSecAssaultBtn, () => UIController.Enable_DisableUI(inGameAssaultPanel, inGamePistolPanel, inGameSecAssaultPanel, inGameGerenadePanel, inGameMeleePanel));
        UIController.IfClick_GoTo(inGameSecAssaultBtn, () => UIController.Enable_DisableUI(inGameSecAssaultPanel, inGamePistolPanel, inGameAssaultPanel, inGameGerenadePanel, inGameMeleePanel));
        UIController.IfClick_GoTo(inGameGerenadeBtn, () => UIController.Enable_DisableUI(inGameGerenadePanel, inGamePistolPanel, inGameAssaultPanel, inGameSecAssaultPanel, inGameMeleePanel));
        UIController.IfClick_GoTo(inGameMeleeBtn, () => UIController.Enable_DisableUI(inGameMeleePanel, inGamePistolPanel, inGameAssaultPanel, inGameSecAssaultPanel, inGameGerenadePanel));
    }
Example #2
0
    // methods
    public new void Awake()
    {
        base.Awake();
        try
        {
            weaponComparer    = weaponComp.GetComponent <V_WeaponComparison>();
            gearComparer      = gearComp.GetComponent <V_GearComparison>();
            characterComparer = characterComp.GetComponent <V_CharacterComparison>();
        }
        catch (System.Exception err)
        {
            UIController.ThrowError("V_Shop: Awake(): " + err.Message, () =>
            {
                UIController.CloseError();
                return;
            });
        }

        // shop main buttons
        UIController.IfClick_GoTo(weaponBtn, () =>
        {
            UIController.Enable_DisableUI(weaponsPanel, gearsPanel, charactersPanel, specialItemsPanel);
            StopComparing();
        });

        UIController.IfClick_GoTo(gearsBtn, () =>
        {
            UIController.Enable_DisableUI(gearsPanel, weaponsPanel, charactersPanel, specialItemsPanel);
            StopComparing();
        });
        UIController.IfClick_GoTo(characterBtn, () =>
        {
            UIController.Enable_DisableUI(charactersPanel, weaponsPanel, gearsPanel, specialItemsPanel);
            StopComparing();
        });
        UIController.IfClick_GoTo(specialItemsBtn, () =>
        {
            UIController.Enable_DisableUI(specialItemsPanel, weaponsPanel, gearsPanel, charactersPanel);
            StopComparing();
        });

        UIController.IfClick_GoTo(buyCreditBtn, BuyCredit);

        // shop sub buttons

        UIController.IfClick_GoTo(pistolBtn, () => UIController.Enable_DisableUI(pistolPanel, assaultPanel));
        UIController.IfClick_GoTo(assaultBtn, () => UIController.Enable_DisableUI(assaultPanel, pistolPanel));

        UIController.IfClick_GoTo(upperBodyBtn, () => UIController.Enable_DisableUI(upperBodyPanel, lowerBodyPanel, headPanel));
        UIController.IfClick_GoTo(loweBodyBtn, () => UIController.Enable_DisableUI(lowerBodyPanel, upperBodyPanel, headPanel));
        UIController.IfClick_GoTo(headBtn, () => UIController.Enable_DisableUI(headPanel, upperBodyPanel, lowerBodyPanel));

        UIController.IfClick_GoTo(specialWeaponsBtn, () => UIController.Enable_DisableUI(specialWeaponsPanel, specialCharacterPanel));
        UIController.IfClick_GoTo(specialCharactersBtn, () => UIController.Enable_DisableUI(specialCharacterPanel, specialWeaponsPanel));
    }