You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.6 KiB
58 lines
1.6 KiB
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace UltraCombos
|
|
{
|
|
class Misc
|
|
{
|
|
static List<string> commandLineArgs = null;
|
|
public static bool GetCommandLineArgument(string arg)
|
|
{
|
|
string input;
|
|
return GetCommandLineArgument(arg, out input);
|
|
}
|
|
public static bool GetCommandLineArgument(string arg, out string input)
|
|
{
|
|
if (commandLineArgs == null)
|
|
{
|
|
commandLineArgs = new List<string>();
|
|
string[] args = System.Environment.GetCommandLineArgs();
|
|
commandLineArgs.AddRange(args);
|
|
}
|
|
|
|
bool res = false;
|
|
input = "";
|
|
if (commandLineArgs.Contains(arg))
|
|
{
|
|
res = true;
|
|
int index = commandLineArgs.FindIndex(
|
|
delegate (string argument)
|
|
{
|
|
return (argument == arg);
|
|
});
|
|
if (index > -1)
|
|
{
|
|
index++;
|
|
if (index < commandLineArgs.Count)
|
|
input = commandLineArgs[index];
|
|
}
|
|
}
|
|
return res;
|
|
}
|
|
|
|
public static void Verbose(string module, string msg, int level = 0)
|
|
{
|
|
msg = string.Format("<b>[{0}]</b> {1}", module, msg);
|
|
switch (level)
|
|
{
|
|
case 0: Debug.Log(msg); break;
|
|
case 1: Debug.LogWarning(msg); break;
|
|
case 2: Debug.LogError(msg); break;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|