您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

37 行
838 B

using GameplayIngredients;
using GameplayIngredients.Logic;
using NaughtyAttributes;
using System;
using UnityEngine;
public class CommandLineArgumentLogic : LogicBase
{
public string Option = "--option";
[ReorderableList]
public Callable[] OnArgumentPresent;
[ReorderableList]
public Callable[] OnArgumentAbsent;
public override void Execute(GameObject instigator = null)
{
bool found = false;
string[] args = Environment.GetCommandLineArgs();
for (int i = 0; i < args.Length; i++)
{
if (args[i].ToLower() == Option.ToLower())
{
found = true;
break;
}
}
if (found)
Call(OnArgumentPresent, instigator);
else
Call(OnArgumentAbsent, instigator);
}
}