public void UpdateGun(int updatedGunIndex) { Debug.Log("Updating gun"); if (egb.isReloading) { Debug.Log("Cancelled Reload"); egb.isReloading = false; } egb.OnChange(allGuns[updatedGunIndex]); if (equippedGunObject.GetComponent <MeshFilter>() == null) { equippedGunObject.AddComponent <MeshFilter>(); Debug.Log("Adding shit!"); } equippedGunObject.GetComponent <MeshFilter>().sharedMesh = allGuns[updatedGunIndex].model; }
public void Start() { currentGun = allGuns[currentGunIndex]; egb = egb.GetComponent <EquippedGunBehaviour>(); egb.OnChange(allGuns[currentGunIndex]); }