示例#1
0
    public void FromSerializable(SerializableWeapon weapon, PlayerStats parent)
    {
        Stats = WeaponStats.FromSerializable(weapon);
        AssignAudioAndAnimation();

        playerStats = parent;

        var index = weapon.index;
        var ui    = Instantiate(weaponUIPrefab);

        Renderer = new WeaponRenderer(ui, Stats, weapon.keyCode, index);
        //equipmentBar.transform.GetChild(index + 2).GetComponent<Image>().sprite = Stats.sprite;

        numHalvedFor        = 0;
        Multipliers         = new List <float>(2);
        MultiplierCooldowns = new List <float>(2);

        for (int itemIndex = 0; itemIndex < playerStats.items.Count; ++itemIndex)
        {
            playerStats.items[itemIndex].applyItemEffect(this);
        }
    }