vexe / VFW

MIT License
492 stars 67 forks source link

Update for use with latest Unity/Runtime/API #110

Open izackp opened 5 years ago

izackp commented 5 years ago

The current code doesn't compile with the latest Unity stuff.

I tried fixing some compiler errors, but I get a bunch of Null Reference Exceptions with GetKey in FastReflection, so I figured I'd make a formal request here.

vexe commented 5 years ago

Can you post the full callstack for that exception?

izackp commented 5 years ago

@vexe Sorry, I deleted vexe/VFW + my changes. Vexe should result in few compile time errors as it is.

Unity Version: 2018.3.1f1 Scripting Runtime Version: .Net 4.x Equivalent API Compatibility Level: .Net 4.x

JSowald commented 5 years ago

hello! @vexe While i do not know if the issue is identical to izackp's. Upon placing the Editor folder in my editor project there are many ambiguous reference errors for extension methods in the project that are already implemented in the system library.

I have solved these issues by commenting lines 10-13 and 60-87 of the Vexe/Runtime/Libs/Extensions/MemberInfoExtensions.cs class

Unity Version: 2019.1.0f2

JSowald commented 5 years ago

Sorry, that fix allowed it to build, but I had not tried it in the editor yet. I get several exceptions like this upon attempting to view a new BaseBehaviour like so. nothing appears in the editor under the script component. This error continues to throw whenever i move my mouse.

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

using System.Collections; using System.Collections.Generic; using UnityEngine; using Vexe.Runtime.Types;

public class IHAVEPROPERTIES : BaseBehaviour { public float prop { get { return 1; } set { } } public float hithere = 0; // Start is called before the first frame update void Start() {

}

// Update is called once per frame
void Update()
{

}

}

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

NullReferenceException: Object reference not set to an instance of an object Vexe.Runtime.Extensions.FastReflection.GetKey[T,R] (System.Reflection.MemberInfo member, System.String dynMethodName) (at Assets/Vexe/Runtime/Libs/Extensions/FastReflection.cs:287) Vexe.Runtime.Extensions.FastReflection.DelegateForCall[TTarget,TReturn] (System.Reflection.MethodInfo method) (at Assets/Vexe/Runtime/Libs/Extensions/FastReflection.cs:167) Vexe.Editor.GUIs.RabbitGUI..cctor () (at Assets/Editor/Vexe/GUIs/RabbitGUI/RabbitGUI.cs:124) Rethrow as TypeInitializationException: The type initializer for 'Vexe.Editor.GUIs.RabbitGUI' threw an exception. Vexe.Editor.Editors.BaseEditor.get_gui () (at Assets/Editor/Vexe/Editors/BaseEditor.cs:56) Vexe.Editor.Editors.BaseEditor.OnInspectorGUI () (at Assets/Editor/Vexe/Editors/BaseEditor.cs:193) UnityEditor.UIElements.InspectorElement+<CreateIMGUIInspectorFromEditor>c__AnonStorey1.<>m__0 () (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorElement.cs:445) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Awais6 commented 4 years ago

Same errors are with my script @james7132 when extending my script with BaseBehaviour unity throws bunch of errors unityVersion 2019.2.13f1