add: Agent, ProxyMethod, LoadingScene
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
<RootNamespace>Polonium.Tasks</RootNamespace>
|
<RootNamespace>Polonium.Tasks</RootNamespace>
|
||||||
<AssemblyName>Polonium.Tasks</AssemblyName>
|
<AssemblyName>Polonium.Tasks</AssemblyName>
|
||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||||
<Version>0.0.92-d</Version>
|
<Version>0.1.0</Version>
|
||||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||||
<GenerateDependencyFile>true</GenerateDependencyFile>
|
<GenerateDependencyFile>true</GenerateDependencyFile>
|
||||||
<TargetsForTfmSpecificBuildOutput>
|
<TargetsForTfmSpecificBuildOutput>
|
||||||
|
|||||||
@@ -68,7 +68,29 @@ public class GenerateProxyNodesTask : Task
|
|||||||
.AppendLine("using _BINDINGS_NAMESPACE_;")
|
.AppendLine("using _BINDINGS_NAMESPACE_;")
|
||||||
.AppendLine("using System;")
|
.AppendLine("using System;")
|
||||||
.AppendLine("public partial class _CLASS_ : GlobalClasses._CLASS_")
|
.AppendLine("public partial class _CLASS_ : GlobalClasses._CLASS_")
|
||||||
.AppendLine("{")
|
.AppendLine("{");
|
||||||
|
IEnumerable<MethodDeclarationSyntax> methods = cls.Members
|
||||||
|
.OfType<MethodDeclarationSyntax>()
|
||||||
|
.Where(m => m.AttributeLists
|
||||||
|
.SelectMany(a => a.Attributes)
|
||||||
|
.Any(attr => attr.Name.ToString().Contains("ProxyMethod"))
|
||||||
|
);
|
||||||
|
foreach (MethodDeclarationSyntax proxyMethod in methods)
|
||||||
|
{
|
||||||
|
string methodReturnType = proxyMethod.ReturnType.ToString();
|
||||||
|
string methodName = proxyMethod.Identifier.Text;
|
||||||
|
string methodArgs = string.Join(", ", proxyMethod.ParameterList.Parameters.Select(p => p.ToString()));
|
||||||
|
string paramNames = string.Join(", ", proxyMethod.ParameterList.Parameters.Select(p => p.Identifier.Text));
|
||||||
|
sbx
|
||||||
|
.AppendLine($" public override {methodReturnType} {methodName}({methodArgs})")
|
||||||
|
.AppendLine(" {");
|
||||||
|
if(methodReturnType=="void")
|
||||||
|
sbx.AppendLine($" base.{methodName}({paramNames});");
|
||||||
|
else
|
||||||
|
sbx.AppendLine($" return base.{methodName}({paramNames});");
|
||||||
|
sbx.AppendLine(" }");
|
||||||
|
}
|
||||||
|
sbx
|
||||||
.AppendLine("}");
|
.AppendLine("}");
|
||||||
if(!Directory.Exists($"{TemplateDirectory}/{className}"))
|
if(!Directory.Exists($"{TemplateDirectory}/{className}"))
|
||||||
Directory.CreateDirectory($"{TemplateDirectory}/{className}");
|
Directory.CreateDirectory($"{TemplateDirectory}/{className}");
|
||||||
|
|||||||
Reference in New Issue
Block a user