选自过去1~2周的内容: https://twitter.com/unity3d 和各种其他来源吧
1)、 取消DontDestroyOnLoad效果
DontDestroyOnLoad效果的原理是把物体移动到一个特殊的场景里,这个场景在加载场景时不会被卸载,这个场景里的物体也就不会随着加载场景被销毁。
取消DontDestroyOnLoad效果就是进行一个逆操作,把这个物体移回到活跃场景里。
2) Anti-piracy APK checking
an anti-piracy check, which is used to determine if your app was altered after it was submitted to the Google Play Store
Restrict features in your app like level progression or store fronts
反盗版APK检查
反盗版检查,用于确定您的应用在提交到Google Play商店后是否被更改
限制应用中的功能,例如关卡进度, 商店使用等等
https://docs.unity3d.com/ScriptReference/Application-genuine.html
https://docs.unity3d.com/ScriptReference/Application-genuineCheckAvailable.html
3)
安卓的 ADB 拥有专门为Unity 添加的过滤器
adb logcat -s Unity
4)、 http://baba-s.hatenablog.com/entry/2018/12/12/183000
编辑器扩展,输出日志用于测量构建所需的时间
usingSystem;
usingUnityEditor.Build;
usingUnityEditor.Build.Reporting;
usingUnityEngine;
publicclassExample : IPreprocessBuildWithReport, IPostprocessBuildWithReport {
privateDateTimem_startTime;
publicintcallbackOrder { get { return0; } }
publicvoidOnPreprocessBuild (BuildReportreport) {
m_startTime = DateTime.Now;
Debug.LogFormat ("【ビルド】開始:{0}", m_startTime.ToString ("HH:mm:ss"));
}
publicvoidOnPostprocessBuild (BuildReportreport) {
varendTime = DateTime.Now;
vardeltaTime = endTime - m_startTime;
varhours = deltaTime.Hours.ToString ("00");
varminutes = deltaTime.Minutes.ToString ("00");
varseconds = deltaTime.Seconds.ToString ("00");
Debug.LogFormat ("【ビルド】終了:{0}", endTime.ToString ("HH:mm:ss"));
Debug.LogFormat ("【ビルド】経過時間:{0}:{1}:{2}", hours, minutes, seconds);
}
}
将上述脚本添加到Unity项目的“Editor”文件夹中
右键单击Console窗口的选项卡,选择“Open Editor Log”,然后按
“Editor.log”进行*** Completed 'Build.Player.搜索
***在7秒内完成'Build.Player.WindowsStandaloneSupport'(6905毫秒)
5)、 AnimationCurve 类型变量的初始化可以使用「AnimationCurve.Constant」「AnimationCurve.Linear」「AnimationCurve.EaseInOut」
using UnityEngine;
public class Example : MonoBehaviour {
public AnimationCurve m_curve1 =
AnimationCurve.Constant (0, 1, 0.5f);
public AnimationCurve m_curve2 =
AnimationCurve.Linear (0, 0, 1, 1);
public AnimationCurve m_curve3 =