Пример #1
0
    private void Start()
    {
        loadoutLoader = LoadoutSwitcharoo.Instance;
        UnitWeaponLoadout curSelectedUnit = loadoutLoader.GetTeam1UnitLoadouts[loadoutLoader.GetUnit];
        WeaponBase        hoveredWeapon   = curSelectedUnit.availableWeapons[int.Parse("" + transform.name[5])];


        //if (GameConfig.Instance.IsSandbox)
        //{
        //}
        //else
        //{

        //}

        //Debug.Log("" + transform.name[5]);
        //Debug.Log(int.Parse("" + transform.name[5]));
        //Debug.Log(loadoutLoader.GetTeam1UnitLoadouts[loadoutLoader.GetUnit]);
        //Debug.Log(loadoutLoader.GetTeam1UnitLoadouts[loadoutLoader.GetUnit].unlockedWeapons[int.Parse("" + transform.name[5])]);
        curText = "Name: " + hoveredWeapon.name + "\nMax ammo before rearm: " + (hoveredWeapon.maxAmmo > 50000 ? Mathf.Infinity : hoveredWeapon.maxAmmo == 0 ? Mathf.Infinity : hoveredWeapon.maxAmmo)
                  + "\nRearmament time: " + hoveredWeapon.reloadTime + "\nDamage per projectile: " + hoveredWeapon.damage + "\nWeapon type: " + FormatString("" + hoveredWeapon.typeOfWeapon)
                  + "\nExtra desc: " + hoveredWeapon.GetComponent <WeaponAdditionalInfo>().desc;
        imgObj.color  = new Color(imgObj.color.r, imgObj.color.g, imgObj.color.b, 0f);
        textObj.color = new Color(textObj.color.r, textObj.color.g, textObj.color.b, 0f);
    }
Пример #2
0
    private void Start()
    {
        loadoutLoader = LoadoutSwitcharoo.Instance;
        wepInfo       = wep.GetComponent <WeaponAdditionalInfo>();
        CheckWhichUnitUsesWeapon();

        curText = "Name: " + wep.name + "\nUnlocked: " + wep.unlocked + "\nMax ammo before rearm: " + (wep.maxAmmo > 50000 ? Mathf.Infinity : wep.maxAmmo == 0 ? Mathf.Infinity : wep.maxAmmo)
                  + "\nRearmament time: " + wep.reloadTime + "\nDamage per projectile: " + wep.damage + "\nWeapon type: " + FormatString("" + wep.typeOfWeapon)
                  + "\nExtra desc: " + wepInfo.desc + "Cost: " + wep.ShopCost + "\nUnits that can use this: ";

        foreach (UnitWeaponLoadout loadout in loadoutsThatUseWeapon)
        {
            if (loadout == loadoutsThatUseWeapon[loadoutsThatUseWeapon.Count - 1])
            {
                curText += loadout.name;
            }
            else
            {
                curText += loadout.name + ", ";
            }
        }

        //if (GameConfig.Instance.IsSandbox)
        //{
        //}
        //else
        //{

        //}

        //Debug.Log("" + transform.name[5]);
        //Debug.Log(int.Parse("" + transform.name[5]));
        //Debug.Log(loadoutLoader.GetTeam1UnitLoadouts[loadoutLoader.GetUnit]);
        //Debug.Log(loadoutLoader.GetTeam1UnitLoadouts[loadoutLoader.GetUnit].unlockedWeapons[int.Parse("" + transform.name[5])]);
        imgObj.color  = new Color(imgObj.color.r, imgObj.color.g, imgObj.color.b, 0f);
        textObj.color = new Color(textObj.color.r, textObj.color.g, textObj.color.b, 0f);
    }
Пример #3
0
 private void Start()
 {
     loadoutScript = LoadoutSwitcharoo.Instance;
 }