Esempio n. 1
0
    /**********************************************************************************************/
    // устанавливаем конкретное оружие в конкретный слот
    //
    /**********************************************************************************************/
    public void SetWeaponInSlot(PlayerController.WEAPON_SLOT slot, WEAPON weaponType)
    {
        if ((int)slot >= m_weaponImgCtrArr.Count)
        {
            Debug.LogError("ERROR! wrong weaponId: " + slot);
            return;
        }

        WeaponImageSet iconsSet = WeaponLibrary.GetInstance().GetWeaponIcons(weaponType);

        Debug.Log("SetWeaponInSlot");
        if (iconsSet.sprite100 == null)
        {
            Debug.LogError("iconsSet is empty!");
        }

        m_weaponImgCtrArr[(int)slot].SpriteSet = iconsSet;

        // настраиваем цветовую схему
        Color colorForUse = Color.white;

        if (iconsSet.UseColoring)
        {
            colorForUse = ColorChecme;
        }

        m_weaponImgCtrArr[(int)slot].SetColorScheme(colorForUse);
    }
Esempio n. 2
0
    /**********************************************************************************/
    // устанавливаем оружие в соответсвующие им слоты
    //
    /**********************************************************************************/
    private void SetWeaponToSlots()
    {
        // настраиваем оружие
        // тентакли ^_^
        ClassicWeaponCtr ctr = WeaponLibrary.GetInstance().GetWeaponById(WEAPON.TENTAKLES, playerId);

        m_mainWeaponCollection.Add(ctr);
        m_captureWeaponCollection.Add(ctr);
        m_explosionWeaponCollection.Add(ctr);
        m_specialWeaponCollection.Add(ctr);

        m_mainWeaponIds.Add(WEAPON.TENTAKLES);
        m_captureWeaponIds.Add(WEAPON.TENTAKLES);
        m_explosionWeaponIds.Add(WEAPON.TENTAKLES);
        m_specialWeaponIds.Add(WEAPON.TENTAKLES);


        // кислотная пушка
        ctr = WeaponLibrary.GetInstance().GetWeaponById(WEAPON.ACID_GUN, playerId);
        ctr.ChargeAmmo(ctr.NumberOfBullet);
        m_mainWeaponCollection.Add(ctr);
        m_mainWeaponIds.Add(WEAPON.ACID_GUN);

        // дробовик
        ctr = WeaponLibrary.GetInstance().GetWeaponById(WEAPON.SHOTGUN, playerId);
        ctr.ChargeAmmo(0);
        m_mainWeaponCollection.Add(ctr);
        m_mainWeaponIds.Add(WEAPON.SHOTGUN);

        // бластер
        ctr = WeaponLibrary.GetInstance().GetWeaponById(WEAPON.BLUSTER, playerId);
        ctr.ChargeAmmo(0);
        m_mainWeaponCollection.Add(ctr);
        m_mainWeaponIds.Add(WEAPON.BLUSTER);

        // слизь
        ctr = WeaponLibrary.GetInstance().GetWeaponById(WEAPON.MOCUS, playerId);
        ctr.ChargeAmmo(3);
        m_captureWeaponCollection.Add(ctr);
        m_captureWeaponIds.Add(WEAPON.MOCUS);

        // гранаты РГД
        ctr = WeaponLibrary.GetInstance().GetWeaponById(WEAPON.RGD_GRENADE, playerId);
        ctr.ChargeAmmo(0);
        m_explosionWeaponCollection.Add(ctr);
        m_explosionWeaponIds.Add(WEAPON.RGD_GRENADE);

        // гранаты плазменные
        ctr = WeaponLibrary.GetInstance().GetWeaponById(WEAPON.PLASMA_GRENADE, playerId);
        ctr.ChargeAmmo(0);
        m_explosionWeaponCollection.Add(ctr);
        m_explosionWeaponIds.Add(WEAPON.PLASMA_GRENADE);

        // строитель турелей
        ctr = WeaponLibrary.GetInstance().GetWeaponById(WEAPON.TUREL_BUILDER, playerId);
        ctr.ChargeAmmo(0);
        m_specialWeaponCollection.Add(ctr);
        m_specialWeaponIds.Add(WEAPON.TUREL_BUILDER);

        // обновляем оружейные слоты
        UpdateWeaponSlot(WEAPON_SLOT.ALL);
    }