This commit is contained in:
SoulliesOfficial
2026-06-09 11:21:59 -04:00
parent 7c60c40d6b
commit 021e76efe7
493 changed files with 50500 additions and 2211 deletions

View File

@@ -0,0 +1,38 @@
/*
Yarn Spinner is licensed to you under the terms found in the file LICENSE.md.
*/
using System.Linq;
#nullable enable
namespace Yarn.Unity.Editor
{
[System.Serializable]
public class FunctionInfo
{
public string Name = "unknown";
public string ReturnType = "unknown";
public string[] Parameters = System.Array.Empty<string>();
public static FunctionInfo CreateFunctionInfoFromMethodGroup(System.Reflection.MethodInfo method)
{
var returnType = $"-> {method.ReturnType.Name}";
var parameters = method.GetParameters();
var p = new string[parameters.Count()];
for (int i = 0; i < parameters.Count(); i++)
{
var q = parameters[i].ParameterType;
p[i] = parameters[i].Name;
}
return new FunctionInfo
{
Name = method.Name,
ReturnType = returnType,
Parameters = p,
};
}
}
}