Skip to content

WEIXINMINIGAME 这个宏运行状态无效 #1011

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

Open
foreversos opened this issue May 29, 2025 · 5 comments
Open

WEIXINMINIGAME 这个宏运行状态无效 #1011

foreversos opened this issue May 29, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@foreversos
Copy link

foreversos commented May 29, 2025

描述Bug

空工程,直接使用脚本打印

public class WXTest : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
#if WEIXINMINIGAME
Debug.LogWarning("我是微信哦");
#else
Debug.LogWarning("进游戏了");
#endif
}
}

运行环境

unity2022.3.14
插件版本:202505120809

###运行结果
进游戏了

@foreversos foreversos added the bug Something isn't working label May 29, 2025
@Rootjhon
Copy link

团结才有这个宏,unity可以自定义

@foreversos
Copy link
Author

团结才有这个宏,unity可以自定义

请教怎么操作?是在微信小游戏工程里面用代码定义吗

@cseYang
Copy link

cseYang commented Jun 3, 2025

团结才有这个宏,unity可以自定义

请教怎么操作?是在微信小游戏工程里面用代码定义吗

buildSettings-->playerSetting-->scriptDefineSymbols。

@foreversos
Copy link
Author

团结才有这个宏,unity可以自定义

请教怎么操作?是在微信小游戏工程里面用代码定义吗

buildSettings-->playerSetting-->scriptDefineSymbols。

谢谢朋友.再请教如何在编辑器里面不生效,而在转换微信工程之后生效呢?

@cseYang
Copy link

cseYang commented Jun 3, 2025

团结才有这个宏,unity可以自定义

请教怎么操作?是在微信小游戏工程里面用代码定义吗

buildSettings-->playerSetting-->scriptDefineSymbols。

谢谢朋友.再请教如何在编辑器里面不生效,而在转换微信工程之后生效呢?

增加后处理,在转换后动态添加宏定义

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants