文档

Unity Engine

Unity Engine

isBuildingPlayer

Returns true when Unity is actively building a Player or AssetBundles
阅读时间1 分钟最后更新于 1 个月前

Definition

  • Type: Property
  • Namespace: UnityEditor
  • Assembly: UnityEditor
public static bool isBuildingPlayer { get; }

Remarks

This returns true during Player builds (BuildPipeline.BuildPlayer) and AssetBundle builds (BuildPipeline.BuildAssetBundles). It can be used to check the context inside script code that could be triggered during a build, for example when ExecuteAlways is being used on a MonoBehaviour.