public void RunStats() { myStats.SetBaseParams(); myGrip.RunStatMods(myGrip.currentGrip, myStats); myBarrel.RunStatMods(myBarrel.currentBarrel, myStats); myAmmo.RunStatMods(myAmmo.currentAmmo, myStats); Debug.Log("Element = " + myStats.myElementA); ElementArray(); SetRanges(); Weapon wep = GetComponent <Weapon>(); wep.GetGunStats(myStats, bSpeed, dRange); //myStats.SetStats(myGrip.currentGrip,myAmmo.currentAmmo, myBarrel.currentBarrel); //Debug.Log(myStats.damage + "-Damage, " + myStats.accuracy + "-Accuracy, " + myStats.recoil + " -Recoil, " + myStats.durability + " -Durability, " + myStats.fireRate + " -FireRate"); //Debug.Log(myElements[0]+ myElements[1] +myElements[2]); }
// Start is called before the first frame update void Start() { me = new GunStats(); partUI = Resources.Load <GameObject>("Prefabs/GunCanvas"); WhichPartIsThis(); if (grip != Grip.gripModel.none) { myGrip = new Grip(); myGrip.RunStatMods(grip, me); } else if (barrel != Barrel.barrelModel.none) { myBarrel = new Barrel(); myBarrel.RunStatMods(barrel, me); } else if (ammo != Ammo.ammoModel.none) { myAmmo = new Ammo(); myAmmo.RunStatMods(ammo, me); } FillInvArrays(); }