Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
老鱼er
et
提交
5d56826f
E
et
项目概览
老鱼er
/
et
与 Fork 源项目一致
从无法访问的项目Fork
通知
10
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
et
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5d56826f
编写于
11月 17, 2018
作者:
T
tanghai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
整理代码
上级
f7c3e927
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
12 addition
and
588 deletion
+12
-588
Client-Server.sln.DotSettings.user
Client-Server.sln.DotSettings.user
+2
-0
Server/Hotfix/Handler/G2G_LockReleaseRequestHandler.cs
Server/Hotfix/Handler/G2G_LockReleaseRequestHandler.cs
+0
-32
Server/Hotfix/Handler/G2G_LockRequestHandler.cs
Server/Hotfix/Handler/G2G_LockRequestHandler.cs
+0
-37
Server/Hotfix/Module/BigWorld/LockComponentSystem.cs
Server/Hotfix/Module/BigWorld/LockComponentSystem.cs
+0
-104
Server/Hotfix/Module/BigWorld/MasterComponentSystem.cs
Server/Hotfix/Module/BigWorld/MasterComponentSystem.cs
+0
-49
Server/Hotfix/Module/Demo/Actor_TransferHandler.cs
Server/Hotfix/Module/Demo/Actor_TransferHandler.cs
+0
-0
Server/Hotfix/Module/Demo/M2M_TrasferUnitRequest.cs
Server/Hotfix/Module/Demo/M2M_TrasferUnitRequest.cs
+0
-0
Server/Hotfix/Module/Demo/UnitPathComponentSystem.cs
Server/Hotfix/Module/Demo/UnitPathComponentSystem.cs
+1
-2
Server/Model/Module/BigWorld/LockComponent.cs
Server/Model/Module/BigWorld/LockComponent.cs
+0
-23
Server/Model/Module/BigWorld/MasterComponent.cs
Server/Model/Module/BigWorld/MasterComponent.cs
+0
-29
Server/Model/Module/Demo/UnitPathComponent.cs
Server/Model/Module/Demo/UnitPathComponent.cs
+2
-2
Server/Model/Module/Pathfinding/ABPathWrap.cs
Server/Model/Module/Pathfinding/ABPathWrap.cs
+5
-5
Server/Model/Module/Pathfinding/PathfindingComponent.cs
Server/Model/Module/Pathfinding/PathfindingComponent.cs
+2
-2
Unity/Assets/Model/Other/ECSView.cs
Unity/Assets/Model/Other/ECSView.cs
+0
-184
Unity/Assets/Model/Other/ECSView.cs.meta
Unity/Assets/Model/Other/ECSView.cs.meta
+0
-13
Unity/Assets/Model/Other/IInstanceMethod.cs
Unity/Assets/Model/Other/IInstanceMethod.cs
+0
-8
Unity/Assets/Model/Other/MonoMethod.cs
Unity/Assets/Model/Other/MonoMethod.cs
+0
-84
Unity/Assets/Model/Other/MonoMethod.cs.meta
Unity/Assets/Model/Other/MonoMethod.cs.meta
+0
-12
Unity/Unity.Model.csproj
Unity/Unity.Model.csproj
+0
-2
未找到文件。
Client-Server.sln.DotSettings.user
浏览文件 @
5d56826f
...
...
@@ -52,5 +52,7 @@
<s:String x:Key="/Default/Housekeeping/Layout/DialogWindows/RefactoringWizardWindow/Location/@EntryValue">122,-178</s:String>
<s:Int64 x:Key="/Default/Environment/SearchAndNavigation/DefaultOccurrencesGroupingIndex/@EntryValue">0</s:Int64>
<s:String x:Key="/Default/Profiling/Configurations/=1/@EntryIndexedValue"><data><HostParameters type="LocalHostParameters" /><Argument type="StandaloneArgument"><Arguments IsNull="False"></Arguments><FileName IsNull="False"></FileName><WorkingDirectory IsNull="False"></WorkingDirectory><Scope><ProcessFilters /></Scope></Argument><Info type="TimelineInfo" /><HostOptions type="HostOptions"><HostTempPath IsNull="False"></HostTempPath></HostOptions></data></s:String>
<s:Boolean x:Key="/Default/UnloadedProject/UnloadedProjects/=1c2827bf_002Daa19_002D402a_002Dbfd1_002D1c92e6b8fd84_0023FileServer/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UnloadedProject/UnloadedProjects/=cc55624f_002Dd5cb_002D4705_002Da879_002D9fcaec1fed71_0023Proto2CS/@EntryIndexedValue">True</s:Boolean>
</wpf:ResourceDictionary>
\ No newline at end of file
Server/Hotfix/Handler/G2G_LockReleaseRequestHandler.cs
已删除
100644 → 0
浏览文件 @
f7c3e927
using
System
;
using
ETModel
;
namespace
ETHotfix
{
[
MessageHandler
(
AppType
.
Gate
)]
public
class
G2G_LockReleaseRequestHandler
:
AMRpcHandler
<
G2G_LockReleaseRequest
,
G2G_LockReleaseResponse
>
{
protected
override
void
Run
(
Session
session
,
G2G_LockReleaseRequest
message
,
Action
<
G2G_LockReleaseResponse
>
reply
)
{
G2G_LockReleaseResponse
g2GLockReleaseResponse
=
new
G2G_LockReleaseResponse
();
try
{
Unit
unit
=
Game
.
Scene
.
GetComponent
<
UnitComponent
>().
Get
(
message
.
Id
);
if
(
unit
==
null
)
{
g2GLockReleaseResponse
.
Error
=
ErrorCode
.
ERR_NotFoundUnit
;
reply
(
g2GLockReleaseResponse
);
return
;
}
unit
.
GetComponent
<
MasterComponent
>().
Release
(
NetworkHelper
.
ToIPEndPoint
(
message
.
Address
));
reply
(
g2GLockReleaseResponse
);
}
catch
(
Exception
e
)
{
ReplyError
(
g2GLockReleaseResponse
,
e
,
reply
);
}
}
}
}
\ No newline at end of file
Server/Hotfix/Handler/G2G_LockRequestHandler.cs
已删除
100644 → 0
浏览文件 @
f7c3e927
using
System
;
using
ETModel
;
namespace
ETHotfix
{
[
MessageHandler
(
AppType
.
Gate
)]
public
class
G2G_LockRequestHandler
:
AMRpcHandler
<
G2G_LockRequest
,
G2G_LockResponse
>
{
protected
override
void
Run
(
Session
session
,
G2G_LockRequest
message
,
Action
<
G2G_LockResponse
>
reply
)
{
RunAsync
(
session
,
message
,
reply
).
NoAwait
();
}
protected
async
ETVoid
RunAsync
(
Session
session
,
G2G_LockRequest
message
,
Action
<
G2G_LockResponse
>
reply
)
{
G2G_LockResponse
response
=
new
G2G_LockResponse
();
try
{
Unit
unit
=
Game
.
Scene
.
GetComponent
<
UnitComponent
>().
Get
(
message
.
Id
);
if
(
unit
==
null
)
{
response
.
Error
=
ErrorCode
.
ERR_NotFoundUnit
;
reply
(
response
);
return
;
}
await
unit
.
GetComponent
<
MasterComponent
>().
Lock
(
NetworkHelper
.
ToIPEndPoint
(
message
.
Address
));
reply
(
response
);
}
catch
(
Exception
e
)
{
ReplyError
(
response
,
e
,
reply
);
}
}
}
}
\ No newline at end of file
Server/Hotfix/Module/BigWorld/LockComponentSystem.cs
已删除
100644 → 0
浏览文件 @
f7c3e927
using
System
;
using
System.Net
;
using
ETModel
;
namespace
ETHotfix
{
[
ObjectSystem
]
public
class
LockComponentAwakeSystem
:
AwakeSystem
<
LockComponent
,
IPEndPoint
>
{
public
override
void
Awake
(
LockComponent
self
,
IPEndPoint
a
)
{
self
.
Awake
(
a
);
}
}
/// <summary>
/// 分布式锁组件,Unit对象可能在不同进程上有镜像,访问该对象的时候需要对他加锁
/// </summary>
public
static
class
LockComponentEx
{
public
static
void
Awake
(
this
LockComponent
self
,
IPEndPoint
addr
)
{
self
.
address
=
addr
;
}
public
static
async
ETTask
Lock
(
this
LockComponent
self
)
{
++
self
.
lockCount
;
if
(
self
.
status
==
LockStatus
.
Locked
)
{
return
;
}
if
(
self
.
status
==
LockStatus
.
LockRequesting
)
{
await
self
.
WaitLock
();
return
;
}
self
.
status
=
LockStatus
.
LockRequesting
;
// 真身直接本地请求锁,镜像需要调用Rpc获取锁
MasterComponent
masterComponent
=
self
.
Entity
.
GetComponent
<
MasterComponent
>();
if
(
masterComponent
!=
null
)
{
await
masterComponent
.
Lock
(
self
.
address
);
}
else
{
self
.
RequestLock
().
NoAwait
();
await
self
.
WaitLock
();
}
}
private
static
ETTask
WaitLock
(
this
LockComponent
self
)
{
if
(
self
.
status
==
LockStatus
.
Locked
)
{
return
ETTask
.
FromResult
(
true
);
}
ETTaskCompletionSource
tcs
=
new
ETTaskCompletionSource
();
self
.
queue
.
Enqueue
(
tcs
);
return
tcs
.
Task
;
}
private
static
async
ETVoid
RequestLock
(
this
LockComponent
self
)
{
try
{
Session
session
=
Game
.
Scene
.
GetComponent
<
NetInnerComponent
>().
Get
(
self
.
address
);
string
serverAddress
=
StartConfigComponent
.
Instance
.
StartConfig
.
ServerIP
;
G2G_LockRequest
request
=
new
G2G_LockRequest
{
Id
=
self
.
Entity
.
Id
,
Address
=
serverAddress
};
await
session
.
Call
(
request
);
self
.
status
=
LockStatus
.
Locked
;
foreach
(
ETTaskCompletionSource
taskCompletionSource
in
self
.
queue
)
{
taskCompletionSource
.
SetResult
();
}
self
.
queue
.
Clear
();
}
catch
(
Exception
e
)
{
Log
.
Error
(
$"获取锁失败:
{
self
.
address
}
{
self
.
Entity
.
Id
}
{
e
}
"
);
}
}
public
static
async
ETTask
Release
(
this
LockComponent
self
)
{
--
self
.
lockCount
;
if
(
self
.
lockCount
!=
0
)
{
return
;
}
self
.
status
=
LockStatus
.
LockedNot
;
Session
session
=
Game
.
Scene
.
GetComponent
<
NetInnerComponent
>().
Get
(
self
.
address
);
G2G_LockReleaseRequest
request
=
new
G2G_LockReleaseRequest
();
await
session
.
Call
(
request
);
}
}
}
\ No newline at end of file
Server/Hotfix/Module/BigWorld/MasterComponentSystem.cs
已删除
100644 → 0
浏览文件 @
f7c3e927
using
System.Net
;
using
ETModel
;
namespace
ETHotfix
{
public
static
class
MasterComponentEx
{
public
static
void
AddGhost
(
this
MasterComponent
self
,
IPEndPoint
address
)
{
self
.
ghostsAddress
.
Add
(
address
);
}
public
static
void
RemoveGhost
(
this
MasterComponent
self
,
IPEndPoint
address
)
{
self
.
ghostsAddress
.
Remove
(
address
);
}
public
static
ETTask
Lock
(
this
MasterComponent
self
,
IPEndPoint
address
)
{
if
(
self
.
lockedAddress
==
null
)
{
self
.
lockedAddress
=
address
;
return
ETTask
.
FromResult
(
true
);
}
ETTaskCompletionSource
tcs
=
new
ETTaskCompletionSource
();
LockInfo
lockInfo
=
new
LockInfo
(
address
,
tcs
);
self
.
queue
.
Enqueue
(
lockInfo
);
return
tcs
.
Task
;
}
public
static
void
Release
(
this
MasterComponent
self
,
IPEndPoint
address
)
{
if
(!
self
.
lockedAddress
.
Equals
(
address
))
{
Log
.
Error
(
$"解锁地址与锁地址不匹配!
{
self
.
lockedAddress
}
{
address
}
"
);
return
;
}
if
(
self
.
queue
.
Count
==
0
)
{
self
.
lockedAddress
=
null
;
return
;
}
LockInfo
lockInfo
=
self
.
queue
.
Dequeue
();
self
.
lockedAddress
=
lockInfo
.
Address
;
lockInfo
.
Tcs
.
SetResult
();
}
}
}
\ No newline at end of file
Server/Hotfix/
Handler
/Actor_TransferHandler.cs
→
Server/Hotfix/
Module/Demo
/Actor_TransferHandler.cs
浏览文件 @
5d56826f
文件已移动
Server/Hotfix/
Handler
/M2M_TrasferUnitRequest.cs
→
Server/Hotfix/
Module/Demo
/M2M_TrasferUnitRequest.cs
浏览文件 @
5d56826f
文件已移动
Server/Hotfix/Module/Demo/UnitPathComponentSystem.cs
浏览文件 @
5d56826f
...
...
@@ -39,8 +39,7 @@ namespace ETHotfix
PathfindingComponent
pathfindingComponent
=
Game
.
Scene
.
GetComponent
<
PathfindingComponent
>();
self
.
ABPath
=
ComponentFactory
.
Create
<
ETModel
.
ABPath
,
Vector3
,
Vector3
>(
unit
.
Position
,
new
Vector3
(
target
.
x
,
target
.
y
,
target
.
z
));
self
.
ABPath
=
ComponentFactory
.
Create
<
ABPathWrap
,
Vector3
,
Vector3
>(
unit
.
Position
,
new
Vector3
(
target
.
x
,
target
.
y
,
target
.
z
));
pathfindingComponent
.
Search
(
self
.
ABPath
);
Log
.
Debug
(
$"find result:
{
self
.
ABPath
.
Result
.
ListToString
()}
"
);
...
...
Server/Model/Module/BigWorld/LockComponent.cs
已删除
100644 → 0
浏览文件 @
f7c3e927
using
System.Collections.Generic
;
using
System.Net
;
namespace
ETModel
{
public
enum
LockStatus
{
LockedNot
,
LockRequesting
,
Locked
,
}
/// <summary>
/// 分布式锁组件,Unit对象可能在不同进程上有镜像,访问该对象的时候需要对他加锁
/// </summary>
public
class
LockComponent
:
Component
{
public
LockStatus
status
=
LockStatus
.
LockedNot
;
public
IPEndPoint
address
;
public
int
lockCount
;
public
readonly
Queue
<
ETTaskCompletionSource
>
queue
=
new
Queue
<
ETTaskCompletionSource
>();
}
}
\ No newline at end of file
Server/Model/Module/BigWorld/MasterComponent.cs
已删除
100644 → 0
浏览文件 @
f7c3e927
using
System.Collections.Generic
;
using
System.Net
;
namespace
ETModel
{
public
class
LockInfo
{
public
IPEndPoint
Address
;
public
ETTaskCompletionSource
Tcs
;
public
LockInfo
(
IPEndPoint
address
,
ETTaskCompletionSource
tcs
)
{
this
.
Address
=
address
;
this
.
Tcs
=
tcs
;
}
}
public
class
MasterComponent
:
Component
{
/// 镜像的地址
public
readonly
List
<
IPEndPoint
>
ghostsAddress
=
new
List
<
IPEndPoint
>();
/// 当前获取锁的进程地址
public
IPEndPoint
lockedAddress
;
/// 请求锁的队列
public
readonly
Queue
<
LockInfo
>
queue
=
new
Queue
<
LockInfo
>();
}
}
\ No newline at end of file
Server/Model/Module/Demo/UnitPathComponent.cs
浏览文件 @
5d56826f
...
...
@@ -8,13 +8,13 @@ namespace ETModel
{
public
Vector3
Target
;
private
ABPath
abPath
;
private
ABPath
Wrap
abPath
;
public
List
<
Vector3
>
Path
;
public
CancellationTokenSource
CancellationTokenSource
;
public
ABPath
ABPath
public
ABPath
Wrap
ABPath
{
get
{
...
...
Server/Model/Module/Pathfinding/ABPath.cs
→
Server/Model/Module/Pathfinding/ABPath
Wrap
.cs
浏览文件 @
5d56826f
...
...
@@ -4,21 +4,21 @@ using PF;
namespace
ETModel
{
[
ObjectSystem
]
public
class
ABPathAwakeSystem
:
AwakeSystem
<
ABPath
,
Vector3
,
Vector3
>
public
class
ABPathAwakeSystem
:
AwakeSystem
<
ABPath
Wrap
,
Vector3
,
Vector3
>
{
public
override
void
Awake
(
ABPath
self
,
Vector3
start
,
Vector3
end
)
public
override
void
Awake
(
ABPath
Wrap
self
,
Vector3
start
,
Vector3
end
)
{
self
.
Awake
(
start
,
end
);
}
}
public
class
ABPath
:
Component
public
class
ABPath
Wrap
:
Component
{
public
Path
Path
{
get
;
private
set
;
}
public
AB
Path
Path
{
get
;
private
set
;
}
public
void
Awake
(
Vector3
start
,
Vector3
end
)
{
this
.
Path
=
PF
.
ABPath
.
Construct
(
start
,
end
);
this
.
Path
=
ABPath
.
Construct
(
start
,
end
);
this
.
Path
.
Claim
(
this
);
}
...
...
Server/Model/Module/Pathfinding/PathfindingComponent.cs
浏览文件 @
5d56826f
...
...
@@ -27,7 +27,7 @@ namespace ETModel
public
AStarConfig
AStarConfig
;
public
bool
Search
(
ABPath
path
)
public
bool
Search
(
ABPath
Wrap
path
)
{
this
.
PathProcessor
.
queue
.
Push
(
path
.
Path
);
while
(
this
.
PathProcessor
.
CalculatePaths
().
MoveNext
())
...
...
@@ -43,7 +43,7 @@ namespace ETModel
return
false
;
}
PathModifyHelper
.
StartEndModify
(
(
PF
.
ABPath
)
path
.
Path
);
PathModifyHelper
.
StartEndModify
(
path
.
Path
);
PathModifyHelper
.
FunnelModify
(
path
.
Path
);
return
true
;
...
...
Unity/Assets/Model/Other/ECSView.cs
已删除
100644 → 0
浏览文件 @
f7c3e927
#
if
UNITY_EDITOR
using
UnityEditor
;
#endif
using
UnityEngine
;
namespace
ETModel
{
/// <summary>
/// ET组件可视化
/// </summary>
public
class
ECSView
:
MonoBehaviour
{
#
region
Static
Parts
/// <summary>
/// 组件与其对应可视化对象map
/// </summary>
private
static
DoubleMap
<
object
,
ECSView
>
_dic
=
new
DoubleMap
<
object
,
ECSView
>();
private
static
Transform
root
;
/// <summary>
/// 可视化对象根节点
/// </summary>
private
static
Transform
Root
{
get
{
if
(
root
==
null
)
{
root
=
new
GameObject
(
"ETViewRoot"
).
transform
;
DontDestroyOnLoad
(
root
);
}
return
root
;
}
}
private
static
Transform
pool
;
/// <summary>
/// 组件放入Pool的可视化根节点
/// </summary>
private
static
Transform
Pool
{
get
{
if
(
pool
==
null
)
{
pool
=
new
GameObject
(
"Pool"
).
transform
;
pool
.
parent
=
Root
;
}
return
pool
;
}
}
/// <summary>
/// 创建组件的可视化节点
/// </summary>
/// <param name="self"></param>
public
static
void
CreateView
(
object
self
)
{
if
(!
Define
.
IsEditorMode
)
return
;
if
(
_dic
.
ContainsKey
(
self
))
return
;
ECSView
view
=
new
GameObject
(
self
.
GetType
().
ToString
()).
AddComponent
<
ECSView
>();
view
.
Component
=
self
;
_dic
.
Add
(
self
,
view
);
SetParent
(
self
);
}
/// <summary>
/// 销毁组件的可视化节点
/// </summary>
/// <param name="self"></param>
public
static
void
DestroyView
(
object
self
)
{
if
(!
Define
.
IsEditorMode
)
return
;
if
(
_dic
.
ContainsKey
(
self
))
{
ECSView
view
=
_dic
.
GetValueByKey
(
self
);
if
(
view
!=
null
)
DestroyImmediate
(
view
.
gameObject
);
_dic
.
RemoveByKey
(
self
);
}
}
/// <summary>
/// 根据组件获取可视化节点
/// </summary>
/// <param name="self"></param>
/// <returns></returns>
public
static
ECSView
GetView
(
object
self
)
{
if
(!
Define
.
IsEditorMode
)
return
null
;
if
(
_dic
.
ContainsKey
(
self
))
return
_dic
.
GetValueByKey
(
self
);
return
null
;
}
/// <summary>
/// 根据可视化节点获取其组件
/// </summary>
/// <param name="self"></param>
/// <returns></returns>
public
static
object
GetComponent
(
ECSView
self
)
{
if
(!
Define
.
IsEditorMode
)
return
null
;
if
(
_dic
.
ContainsValue
(
self
))
return
_dic
.
GetKeyByValue
(
self
);
return
null
;
}
/// <summary>
/// 放入Pool操作,修改可视化节点到Pool节点下
/// </summary>
/// <param name="self"></param>
public
static
void
ReturnPool
(
object
self
)
{
if
(!
Define
.
IsEditorMode
)
return
;
if
(
self
==
null
)
return
;
ECSView
selfView
=
GetView
(
self
);
if
(
selfView
==
null
)
{
_dic
.
RemoveByKey
(
self
);
return
;
}
selfView
.
transform
.
parent
=
Pool
;
}
/// <summary>
/// 设置可视化父对象
/// </summary>
/// <param name="self"></param>
/// <param name="parent"></param>
public
static
void
SetParent
(
object
self
,
object
parent
=
null
)
{
if
(!
Define
.
IsEditorMode
)
return
;
if
(
self
==
null
)
return
;
ECSView
selfView
=
GetView
(
self
);
if
(
selfView
==
null
)
{
_dic
.
RemoveByKey
(
self
);
return
;
}
ECSView
parentView
=
GetView
(
parent
);
if
(
parentView
!=
null
)
selfView
.
transform
.
parent
=
parentView
.
transform
;
else
selfView
.
transform
.
parent
=
Root
;
}
#
endregion
/// <summary>
/// 该可视化节点对应的组件,对其属性显示到Inspector视图内
/// </summary>
public
object
Component
;
}
#if UNITY_EDITOR
[
InitializeOnLoad
]
public
class
MyHierarchyEditor
{
static
MyHierarchyEditor
()
{
EditorApplication
.
hierarchyWindowItemOnGUI
+=
OnHierarchyWindowItemOnGUI
;
}
private
static
void
OnHierarchyWindowItemOnGUI
(
int
instanceID
,
Rect
selectionRect
)
{
GameObject
obj
=
EditorUtility
.
InstanceIDToObject
(
instanceID
)
as
GameObject
;
if
(
obj
==
null
)
return
;
if
(
obj
.
GetComponent
<
ECSView
>()
!=
null
)
{
GUIStyle
style
=
new
GUIStyle
(){
padding
={
left
=
EditorStyles
.
label
.
padding
.
left
-
1
,
top
=
EditorStyles
.
label
.
padding
.
top
},
normal
={
textColor
=
Color
.
red
}
};
GUI
.
Box
(
selectionRect
,
GUIContent
.
none
);
GUI
.
Label
(
selectionRect
,
obj
.
name
,
style
);
}
}
}
#endif
}
Unity/Assets/Model/Other/ECSView.cs.meta
已删除
100644 → 0
浏览文件 @
f7c3e927
fileFormatVersion: 2
guid: f5a40ca22ac5ad54687060716411206f
timeCreated: 1536830842
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Unity/Assets/Model/Other/IInstanceMethod.cs
浏览文件 @
5d56826f
namespace
ETModel
{
public
abstract
class
IInstanceMethod
{
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
);
}
public
abstract
class
IStaticMethod
{
public
abstract
void
Run
();
...
...
Unity/Assets/Model/Other/MonoMethod.cs
已删除
100644 → 0
浏览文件 @
f7c3e927
using
System
;
using
System.Reflection
;
namespace
ETModel
{
public
class
MonoInstanceMethod
:
IInstanceMethod
{
private
readonly
object
obj
;
private
readonly
MethodInfo
methodInfo
;
private
readonly
object
[]
param
;
public
MonoInstanceMethod
(
Type
type
,
string
methodName
)
{
this
.
obj
=
Activator
.
CreateInstance
(
type
);
this
.
methodInfo
=
type
.
GetMethod
(
methodName
);
this
.
param
=
new
object
[
this
.
methodInfo
.
GetParameters
().
Length
];
}
public
override
void
Run
()
{
this
.
methodInfo
.
Invoke
(
this
.
obj
,
param
);
}
public
override
void
Run
(
object
a
)
{
this
.
param
[
0
]
=
a
;
this
.
methodInfo
.
Invoke
(
this
.
obj
,
param
);
}
public
override
void
Run
(
object
a
,
object
b
)
{
this
.
param
[
0
]
=
a
;
this
.
param
[
1
]
=
b
;
this
.
methodInfo
.
Invoke
(
this
.
obj
,
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
(
this
.
obj
,
param
);
}
}
public
class
MonoStaticMethod
:
IStaticMethod
{
private
readonly
MethodInfo
methodInfo
;
private
readonly
object
[]
param
;
public
MonoStaticMethod
(
Type
type
,
string
methodName
)
{
this
.
methodInfo
=
type
.
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
);
}
}
}
Unity/Assets/Model/Other/MonoMethod.cs.meta
已删除
100644 → 0
浏览文件 @
f7c3e927
fileFormatVersion: 2
guid: d2c01f9c277a82b4ca6ba13a14a8214c
timeCreated: 1495179020
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Unity/Unity.Model.csproj
浏览文件 @
5d56826f
...
...
@@ -468,11 +468,9 @@
<Compile
Include=
"Assets\Model\Module\UI\UIType.cs"
/>
<Compile
Include=
"Assets\Model\Other\AppType.cs"
/>
<Compile
Include=
"Assets\Model\Other\Define.cs"
/>
<Compile
Include=
"Assets\Model\Other\ECSView.cs"
/>
<Compile
Include=
"Assets\Model\Other\GizmosDebug.cs"
/>
<Compile
Include=
"Assets\Model\Other\IInstanceMethod.cs"
/>
<Compile
Include=
"Assets\Model\Other\ILMethod.cs"
/>
<Compile
Include=
"Assets\Model\Other\MonoMethod.cs"
/>
<Compile
Include=
"Assets\Model\Other\MotionType.cs"
/>
<Compile
Include=
"Assets\Model\Other\ReferenceCollector.cs"
/>
<Compile
Include=
"Assets\Model\UI\UILoading\Component\UILoadingComponent.cs"
/>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录