Before
var goalEffect = GameObject.Instantiate( goalEffectPrefab ) as GameObject;
After
public static class UnityObjectUtils { public static GameObject Instantiate( UnityEngine.Object original ) { return UnityEngine.Object.Instantiate( original ) as GameObject; } }
var goalEffect = UnityObjectUtils.Instantiate( goalEffectPrefab );