unity-jsb icon indicating copy to clipboard operation
unity-jsb copied to clipboard

UNITY_EDITOR conflicting with binding

Open FreakTheMighty opened this issue 2 years ago • 0 comments

With jsb.Editor.UnityBinding enabled, the generated bindings produce

        public static ClassDecl Bind(TypeRegister register)
        {
            var cls = register.CreateClass("ScriptableObject", typeof(UnityEngine.ScriptableObject), QuickJS.Binding.CommonFix.CrossBindConstructor);
            cls.AddMethod(true, "CreateInstance", QuickJS.Unity.ScriptableObjectFix.BindStatic_CreateInstance);
            return cls;
        }

However, this method ScriptableObjectFix.BindStatic_CreateInstance, is wrapped inside of a #if UNITY_EDITOR, so it fails on build.

Am I missing something? Is there a way to indicate that the bindings for editor only methods should be skipped or wrapped in their own directives?

FreakTheMighty avatar Sep 20 '22 15:09 FreakTheMighty