Hey,
I've made a subclass of MuzzleFlash.cs so I can make a custom muzzle script without touching the original script.
But in ShootableWeapon.cs, it will never find my subclass because of this line:
var muzzleFlashObj = m_SpawnedMuzzleFlash.GetCachedComponent<MuzzleFlash>();
So I started to subclass ShootableWeapon.cs to be able to change the line above without modifying the original ShootableWeapon script.
But I see there are a lot of private variables and functions, making it more complicated that I thought to subclass this one.
Maybe there is a simpler way to do this kind of thing.
If anyone can give some guidance
I've made a subclass of MuzzleFlash.cs so I can make a custom muzzle script without touching the original script.
But in ShootableWeapon.cs, it will never find my subclass because of this line:
var muzzleFlashObj = m_SpawnedMuzzleFlash.GetCachedComponent<MuzzleFlash>();
So I started to subclass ShootableWeapon.cs to be able to change the line above without modifying the original ShootableWeapon script.
But I see there are a lot of private variables and functions, making it more complicated that I thought to subclass this one.
Maybe there is a simpler way to do this kind of thing.
If anyone can give some guidance