Exemplo n.º 1
0
        private static bool IsBuildTargetObsolete(BuildTarget buildTarget)
        {
            FieldInfo field = buildTarget.GetType().GetField(buildTarget.ToString());

            ObsoleteAttribute[] attributes = (ObsoleteAttribute[])field.GetCustomAttributes(typeof(ObsoleteAttribute), false);
            return(attributes != null && attributes.Length > 0);
        }
Exemplo n.º 2
0
    /// <summary>
    /// ビルド開始
    /// </summary>
    /// <param name="target">Target.</param>
    /// <param name="option">Option.</param>
    /// <param name="buildPath">Build path.</param>
    static void Building(BuildTarget target, BuildOptions option, string buildPath)
    {
        string targetName = System.Enum.GetName(target.GetType(), target);

        Debug.Log("Begin Build Player : " + targetName);
        // プラットフォームの確認
        if (EditorUserBuildSettings.activeBuildTarget != target)
        {
            EditorUserBuildSettings.SwitchActiveBuildTarget(target);
        }

        string message = BuildPipeline.BuildPlayer(GetActiveAllScenePaths(), buildPath, target, option);

        Debug.Log("End Build Player : " + targetName);
        if (message != "")
        {
            Debug.LogWarning(message);
        }
    }