zombieyang / puerts_unity_webgl_demo

在Unity里用Typescript写小游戏/Web游戏
BSD 3-Clause "New" or "Revised" License
181 stars 63 forks source link

[unity] Struct开启[BlittableCopy] 生成wrap时编译报错 #23

Closed lovepurple closed 1 year ago

lovepurple commented 2 years ago

error log | 日志或报错信息

public static void InitBlittableCopy(Puerts.JsEnv jsEnv)
        {
            Puerts.StaticTranslate<UnityEngine.Vector3>.ReplaceDefault(StaticSetter, StaticGetter);
            int jsEnvIdx = jsEnv.Index;
            jsEnv.RegisterGeneralGetSet(typeof(UnityEngine.Vector3), (IntPtr isolate, Puerts.IGetValueFromJs getValueApi, IntPtr value, bool isByRef) =>
            {
                return StaticGetter(jsEnvIdx, isolate, getValueApi, value, isByRef);
            }, (IntPtr isolate, Puerts.ISetValueToJs setValueApi, IntPtr value, object obj) => 
            {
                StaticSetter(jsEnvIdx, isolate, setValueApi, value, (UnityEngine.Vector3)obj);
            });
        }

Assets\Gen\UnityEngine_Vector3_Wrap.cs(2053,16): error CS1593: Delegate 'GeneralSetter' does not take 4 arguments

context | 编译/运行环境

Windows 10 Unity2020.3.36f1 LTS Puerts版本 1.4.0 PuertTs-webgl 版本 1.0.0

how to reproduce | 复现步骤

1.Binding中配置 Vector3类型,同时在BlittableCopy中也配置Vecor3 2.开启Unity Allow 'unsafe' code

  1. PuerTS->Generate Code
zombieyang commented 1 year ago

主仓中已修复