Esempio n. 1
0
    public void SelectWeapon(WeaponAdditionalInfo wepInfo)
    {
        for (int i = 0; i < wepInfo.strongAgainst.Count; i++)
        {
            strongAgainstImageObjs[i].SetActive(true);
            strongAgainstImgs[i].sprite       = wepInfo.strongAgainst[i].Graphics.sprite;
            strongAgainstTooltips[i].unitName = wepInfo.strongAgainst[i].name;
            strongAgainstTooltips[i].unitType = "" + wepInfo.strongAgainst[i].Humanoid.type;
        }

        selectedInfo     = wepInfo;
        wepName.text     = wepInfo.gameObject.name;
        wepDesc.text     = wepInfo.desc;
        weaponImg.sprite = wepInfo.UIImage;
        ChangeUnitTooltip(strongAgainstImageObjs[0].GetComponent <StrongAgainstTooltip>());
    }
Esempio n. 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);
    }