mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
[+] 接入ET8服务端
[+] 接入ET8服务端
This commit is contained in:
10
Assets/GameScripts/DotNet/Core/Method/IStaticMethod.cs
Normal file
10
Assets/GameScripts/DotNet/Core/Method/IStaticMethod.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace ET
|
||||
{
|
||||
public abstract class IStaticMethod
|
||||
{
|
||||
public abstract void Run();
|
||||
public abstract void Run(object a);
|
||||
public abstract void Run(object a, object b);
|
||||
public abstract void Run(object a, object b, object c);
|
||||
}
|
||||
}
|
11
Assets/GameScripts/DotNet/Core/Method/IStaticMethod.cs.meta
Normal file
11
Assets/GameScripts/DotNet/Core/Method/IStaticMethod.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f0cc0989ea0c5eb4a874d721f2a0cd17
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
44
Assets/GameScripts/DotNet/Core/Method/StaticMethod.cs
Normal file
44
Assets/GameScripts/DotNet/Core/Method/StaticMethod.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.Reflection;
|
||||
|
||||
namespace ET
|
||||
{
|
||||
public class StaticMethod : IStaticMethod
|
||||
{
|
||||
private readonly MethodInfo methodInfo;
|
||||
|
||||
private readonly object[] param;
|
||||
|
||||
public StaticMethod(Assembly assembly, string typeName, string methodName)
|
||||
{
|
||||
this.methodInfo = assembly.GetType(typeName).GetMethod(methodName);
|
||||
this.param = new object[this.methodInfo.GetParameters().Length];
|
||||
}
|
||||
|
||||
public override void Run()
|
||||
{
|
||||
this.methodInfo.Invoke(null, param);
|
||||
}
|
||||
|
||||
public override void Run(object a)
|
||||
{
|
||||
this.param[0] = a;
|
||||
this.methodInfo.Invoke(null, param);
|
||||
}
|
||||
|
||||
public override void Run(object a, object b)
|
||||
{
|
||||
this.param[0] = a;
|
||||
this.param[1] = b;
|
||||
this.methodInfo.Invoke(null, param);
|
||||
}
|
||||
|
||||
public override void Run(object a, object b, object c)
|
||||
{
|
||||
this.param[0] = a;
|
||||
this.param[1] = b;
|
||||
this.param[2] = c;
|
||||
this.methodInfo.Invoke(null, param);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
11
Assets/GameScripts/DotNet/Core/Method/StaticMethod.cs.meta
Normal file
11
Assets/GameScripts/DotNet/Core/Method/StaticMethod.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fdd300b0cfa10f74a85807aad908db63
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user