startup error on Unity2020.3.29: Type.GetType("UnityEditor.SceneViewOverlay, UnityEditor") .GetMethods(BindingFlags.Public | BindingFlags.Static) .First(x => x.Name == "Window" && x.GetParameters().Length == 5);
See original GitHub issueSystem.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.InvalidOperationException: Sequence contains no matching element
at System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable1[T] source, System.Func
2[T,TResult] predicate) [0x00011] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
at Coffee.UIExtensions.UIParticleEditor.Init () [0x00006] in XXXXXX\Thirdparty\ParticleEffectForUGUI\Scripts\Editor\UIParticleEditor.cs:89
at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <695d1cc93cca45069c528c15c9fdd749>:0
— End of inner exception stack trace —
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00048] in <695d1cc93cca45069c528c15c9fdd749>:0
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
at UnityEditor.EditorAssemblies.ProcessInitializeOnLoadMethodAttributes () [0x00047] in <7ebb9dc74040436998557fc331a964ba>:0
UnityEditor.EditorAssemblies:ProcessInitializeOnLoadMethodAttributes ()
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
As you can see ,there is no 5 parameter method but one with 6 var overlayType = Type.GetType(“UnityEditor.SceneViewOverlay, UnityEditor”); var methods = overlayType.GetMethods(BindingFlags.Public | BindingFlags.Static); var miSceneViewOverlayWindow = methods.First(x => x.Name == “Window” && x.GetParameters().Length == 6); var windowFunction = (Action<UnityEngine.Object, SceneView>)WindowFunction; var windowFunctionType = Type.GetType(“UnityEditor.SceneViewOverlay+WindowFunction, UnityEditor”); var windowFunctionDelegate = Delegate.CreateDelegate(windowFunctionType, windowFunction.Method); var windowTitle = new GUIContent(ObjectNames.NicifyVariableName(typeof(UIParticle).Name)); var sceneViewArgs = new object[] { windowTitle, windowFunctionDelegate, 599, null, 2,null }; codes like this will run without error
🎉 This issue has been resolved in version 4.0.1 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀