当前位置:网站首页>Unity uses macros
Unity uses macros
2022-07-25 23:07:00 【The cat is not here】
Can be in player setting It defines macros

It can also be defined by code
PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.Standalone, item.Symbol);// Save information to macro information . Parameters 1: To which platform Parameters 2: What to save .
Official explanation
- I used to think that after defining a symbol , It is necessary to judge whether this symbol exists . But there is no need to .

C# Instructions explain in detail
Use multi-channel packaging sdk
- This is very useful because it can be packaged through multiple channels sdk
- Define different channels symbol
- And these sdk All relevant access property codes take precompiled instructions
- When automated packaging , Define these symbol, Output different packages
- But I have another problem , That is to say , How to distinguish different files .
- That is to say oppo Need to rely on oppo.dll, Huawei needs to rely on huawei.dll
- How to eliminate these documents when typing different kinds of packages .
[CreateAssetMenu(order =12,menuName =" Create channel settings ")]
public class ChannelSetting : ScriptableObject
{
public string Channel;
public string Symbol;
}
[MenuItem("Build/BuildAll")]
static void BuildAllPlatform()
{
var settings = Resources.LoadAll<ChannelSetting>("ChannelSettings");
foreach (var item in settings)
{
PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.Standalone, item.Symbol);// Save information to macro information . Parameters 1: To which platform Parameters 2: What to save .
var path =Path.Combine( System.Environment.CurrentDirectory, item.Channel, $"{
item.Channel}.exe");
BuildPlayerOptions buildPlayerOptions = new BuildPlayerOptions();
buildPlayerOptions.locationPathName = path;
buildPlayerOptions.target = BuildTarget.StandaloneWindows;
buildPlayerOptions.targetGroup = BuildTargetGroup.Standalone;
var res = BuildPipeline.BuildPlayer(buildPlayerOptions);
}
}
- One of the more pitfalls is , When packaging, you need to specify the output folder , I always thought it was to specify folders , The results have been consistent Report errors
UnityException: Build path contains project built with "Create Visual Studio Solution" option, which is incompatible with current build settings. Consider building your project into an empty directory. - In fact, you need to add the name of the file
边栏推荐
- Ssh server CBC encryption mode vulnerability (cve-2008-5161)
- ZCMU--5015: 完成任务
- Ip--- ia review
- uvm_hdl——DPI在UVM中的实现(四)
- Network Security Learning (XIV) IP protocol
- JS makes elements get or lose focus
- Solve the problem phpstudy failed to import the database
- 5 ROS simulation modeling (3-rviz+gazebo+ control simulation robot)
- HCIE终到手,路才开始
- Shanghai Second Polytechnic University - Health Daily autocheck
猜你喜欢

Websocket summary

Understanding of forward proxy and reverse proxy

Review of static routing

Basic knowledge of radar

recyclerview计算滑动距离之computeHorizontalScrollExtent-computeHorizontalScrollRange-computeHorizontalScrol

Mongodb features, differences with MySQL, and application scenarios

【论文笔记】A Meta-Reinforcement Learning Algorithm for Causal Discovery

Enabling partners, how can Amazon cloud technology "get on the horse and get a ride"?

How to obtain the cash flow data of advertising services to help analyze the advertising effect?

Network Security Learning (XIII) data link layer
随机推荐
HCIE终到手,路才开始
Extended configuration of static routing in the second experiment
四旋翼飞行器的飞控实现「建议收藏」
[tensorflow] 关于 seed
Zcmu--5015: complete the task
IPFs of Internet Protocol
Basic knowledge of radar
CTS测试方法「建议收藏」
Qtreewidget control of QT
uvm_ HDL -- implementation of DPI in UVM (4)
Take root downward, grow upward, and explore the "root" power of Huawei cloud AI
Use of qvariant
Madness. Smbms (supermarket order management system)
Single model common sense reasoning first surpasses human beings! HFL summit openbookqa challenge
Learning notes of technical art hundred people plan (2) -- vector
Check code generation
Analysis of direction finding error of multi baseline interferometer system
Network Security Learning (16)
HJ9 提取不重复的整数
invalid syntax