CommandLineReader.GetCustomArgument C# (CSharp) Method

GetCustomArgument() public static method

public static GetCustomArgument ( string argumentName ) : string
argumentName string
return string
    public static string GetCustomArgument(string argumentName)
    {
        Dictionary<string, string> customArgsDict = GetCustomArguments();

        if (customArgsDict.ContainsKey(argumentName))
        {
            return customArgsDict[argumentName];
        }
        else
        {
            Debug.LogError("CommandLineReader.cs - GetCustomArgument() - Can't retrieve any custom argument named [" + argumentName + "] in the command line [" + GetCommandLine() + "].");
            return "";
        }
    }
}

Usage Example

Example #1
0
    static void CommandLineBuildOnCheckinIOS()
    {
        const BuildTarget target = BuildTarget.iPhone;

        // Get build scenes.
        string[]           levels           = GetBuildScenes();
        const string       locationPathName = "iOSbuild";
        const BuildOptions options          = BuildOptions.None;

        // Get command line arguments (if passed in to build job).
        CommandLineData commandLineData = GetCommandLineData(IoSdefaultBundleId);


        PlayerSettings.iOS.scriptCallOptimization = ScriptCallOptimizationLevel.FastButNoExceptions;

        var shortBundleVersion = CommandLineReader.GetCustomArgument("ShortBundleVersion");

        if (shortBundleVersion == String.Empty)
        {
            shortBundleVersion = commandLineData.BuildVersion;
        }

        PlayerSettings.shortBundleVersion = shortBundleVersion;


        if (commandLineData.StreamingAssetsEnabled == "true")
        {
            BuildPipelineBuildAssetBundle(BuildTarget.iPhone);
            DeleteMasterAssetResources();
        }

        // Build all scenes.
        BuildPipelineBuildPlayer(levels, locationPathName, target, options, commandLineData);
    }
All Usage Examples Of CommandLineReader::GetCustomArgument