Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Unity] UnityEngine.Vector2.op_Implicit is not a function #767

Closed
lsx1994 opened this issue Apr 15, 2022 · 3 comments
Closed

[Unity] UnityEngine.Vector2.op_Implicit is not a function #767

lsx1994 opened this issue Apr 15, 2022 · 3 comments
Assignees

Comments

@lsx1994
Copy link

lsx1994 commented Apr 15, 2022

问题描述: 旧版本运行正常,升级Unity后报错。

Unity版本 2021.3.0f1c1

#log

Exception: E:/LsxGithub/skygame-U3D/Assets/StreamingAssets/JavaScript/GameLanch.js:3: TypeError: _csharp.UnityEngine.Vector2.op_Implicit is not a function

TypeError: _csharp.UnityEngine.Vector2.op_Implicit is not a function
    at E:/LsxGithub/skygame-U3D/Assets/StreamingAssets/JavaScript/GameLanch.js:3:37
    at executeModule (puerts/modular.mjs:41:5)
    at require (puerts/modular.mjs:90:13)
    at chunk:1:1
Puerts.JsEnv.Eval (System.String chunk, System.String chunkName) (at Assets/Puerts/Runtime/Src/JsEnv.cs:278)
PuertsMgr.Begin () (at Assets/Scripts/Engine/Puerts/PuertsMgr.cs:30)
GameLanch.Start () (at Assets/Scripts/GameLanch.cs:33)

#testcode

import { UnityEngine } from "csharp";
let a = UnityEngine.Vector2.op_Implicit(new UnityEngine.Vector3(0,0,0))
@zombieyang zombieyang self-assigned this Apr 15, 2022
@zombieyang
Copy link
Contributor

@lsx1994
Copy link
Author

lsx1994 commented Apr 15, 2022

op_Implicit也是全版本不允许使用的 https://github.com/Tencent/puerts/blob/master/unity/Assets/Puerts/Editor/Src/Generator/Wrapper.cs#L181

好的, 我看index.d.ts里面还有这个api以为可以正常使用

@lsx1994 lsx1994 closed this as completed Apr 15, 2022
@zombieyang
Copy link
Contributor

我更正下,只是全版本不允许生成。
看上去旧版是可以调用的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants