Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
guo450212436
et
提交
a064917d
E
et
项目概览
guo450212436
/
et
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
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,发现更多精彩内容 >>
提交
a064917d
编写于
11月 27, 2018
作者:
T
tanghai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
整理代码
上级
5e33a62a
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
37 addition
and
110 deletion
+37
-110
Unity/Assets/Editor/Proto2CsEditor/InnerProto2CS.cs
Unity/Assets/Editor/Proto2CsEditor/InnerProto2CS.cs
+1
-1
Unity/Assets/Hotfix/Base/Object/Entity.cs
Unity/Assets/Hotfix/Base/Object/Entity.cs
+26
-41
Unity/Assets/Hotfix/Module/Actor/IActorMessage.cs
Unity/Assets/Hotfix/Module/Actor/IActorMessage.cs
+0
-5
Unity/Assets/Hotfix/Module/UI/UIComponent.cs
Unity/Assets/Hotfix/Module/UI/UIComponent.cs
+1
-1
Unity/Assets/Model/Base/Object/Entity.cs
Unity/Assets/Model/Base/Object/Entity.cs
+0
-3
Unity/Assets/Model/Entity/Hotfix.cs
Unity/Assets/Model/Entity/Hotfix.cs
+5
-5
Unity/Assets/Model/Helper/ActionHelper.cs
Unity/Assets/Model/Helper/ActionHelper.cs
+1
-1
Unity/Assets/Model/Init.cs
Unity/Assets/Model/Init.cs
+0
-2
Unity/Assets/Model/Module/Actor/IActorMessage.cs
Unity/Assets/Model/Module/Actor/IActorMessage.cs
+0
-5
Unity/Assets/Model/Module/Demo/PlayerComponent.cs
Unity/Assets/Model/Module/Demo/PlayerComponent.cs
+0
-4
Unity/Assets/Model/Module/UI/UIComponent.cs
Unity/Assets/Model/Module/UI/UIComponent.cs
+1
-1
Unity/Assets/Res/Code/Hotfix.mdb.bytes.meta
Unity/Assets/Res/Code/Hotfix.mdb.bytes.meta
+0
-8
Unity/Assets/Scenes/Init.unity
Unity/Assets/Scenes/Init.unity
+2
-33
未找到文件。
Unity/Assets/Editor/Proto2CsEditor/InnerProto2CS.cs
浏览文件 @
a064917d
...
...
@@ -78,7 +78,7 @@ namespace ETEditor
sb
.
Append
(
$"\t[Message(
{
opcodeClassName
}
.
{
msgName
}
)]\n"
);
sb
.
Append
(
$"\tpublic partial class
{
msgName
}
"
);
if
(
parentClass
==
"IActorMessage"
||
parentClass
==
"IActorRequest"
||
parentClass
==
"IActorResponse"
||
parentClass
==
"IFrameMessage"
)
if
(
parentClass
==
"IActorMessage"
||
parentClass
==
"IActorRequest"
||
parentClass
==
"IActorResponse"
)
{
sb
.
Append
(
$":
{
parentClass
}
\n"
);
}
...
...
Unity/Assets/Hotfix/Base/Object/Entity.cs
浏览文件 @
a064917d
...
...
@@ -10,21 +10,17 @@ namespace ETHotfix
{
[
BsonElement
(
"C"
)]
[
BsonIgnoreIfNull
]
private
HashSet
<
Component
>
components
;
private
HashSet
<
Component
>
components
=
new
HashSet
<
Component
>()
;
[
BsonIgnore
]
private
Dictionary
<
Type
,
Component
>
componentDict
;
private
Dictionary
<
Type
,
Component
>
componentDict
=
new
Dictionary
<
Type
,
Component
>()
;
public
Entity
()
{
this
.
components
=
new
HashSet
<
Component
>();
this
.
componentDict
=
new
Dictionary
<
Type
,
Component
>();
}
protected
Entity
(
long
id
):
base
(
id
)
{
this
.
components
=
new
HashSet
<
Component
>();
this
.
componentDict
=
new
Dictionary
<
Type
,
Component
>();
}
public
override
void
Dispose
()
...
...
@@ -47,12 +43,12 @@ namespace ETHotfix
Log
.
Error
(
e
);
}
}
this
.
components
.
Clear
();
this
.
componentDict
.
Clear
();
}
public
Component
AddComponent
(
Component
component
)
public
virtual
Component
AddComponent
(
Component
component
)
{
Type
type
=
component
.
GetType
();
if
(
this
.
componentDict
.
ContainsKey
(
type
))
...
...
@@ -62,15 +58,11 @@ namespace ETHotfix
component
.
Parent
=
this
;
if
(
component
is
ISerializeToEntity
)
{
this
.
components
.
Add
(
component
);
}
this
.
componentDict
.
Add
(
type
,
component
);
return
component
;
}
public
Component
AddComponent
(
Type
type
)
public
virtual
Component
AddComponent
(
Type
type
)
{
if
(
this
.
componentDict
.
ContainsKey
(
type
))
{
...
...
@@ -79,15 +71,11 @@ namespace ETHotfix
Component
component
=
ComponentFactory
.
CreateWithParent
(
type
,
this
);
if
(
component
is
ISerializeToEntity
)
{
this
.
components
.
Add
(
component
);
}
this
.
componentDict
.
Add
(
type
,
component
);
return
component
;
}
public
K
AddComponent
<
K
>()
where
K
:
Component
,
new
()
public
virtual
K
AddComponent
<
K
>()
where
K
:
Component
,
new
()
{
Type
type
=
typeof
(
K
);
if
(
this
.
componentDict
.
ContainsKey
(
type
))
...
...
@@ -97,15 +85,11 @@ namespace ETHotfix
K
component
=
ComponentFactory
.
CreateWithParent
<
K
>(
this
);
if
(
component
is
ISerializeToEntity
)
{
this
.
components
.
Add
(
component
);
}
this
.
componentDict
.
Add
(
type
,
component
);
return
component
;
}
public
K
AddComponent
<
K
,
P1
>(
P1
p1
)
where
K
:
Component
,
new
()
public
virtual
K
AddComponent
<
K
,
P1
>(
P1
p1
)
where
K
:
Component
,
new
()
{
Type
type
=
typeof
(
K
);
if
(
this
.
componentDict
.
ContainsKey
(
type
))
...
...
@@ -115,15 +99,11 @@ namespace ETHotfix
K
component
=
ComponentFactory
.
CreateWithParent
<
K
,
P1
>(
this
,
p1
);
if
(
component
is
ISerializeToEntity
)
{
this
.
components
.
Add
(
component
);
}
this
.
componentDict
.
Add
(
type
,
component
);
return
component
;
}
public
K
AddComponent
<
K
,
P1
,
P2
>(
P1
p1
,
P2
p2
)
where
K
:
Component
,
new
()
public
virtual
K
AddComponent
<
K
,
P1
,
P2
>(
P1
p1
,
P2
p2
)
where
K
:
Component
,
new
()
{
Type
type
=
typeof
(
K
);
if
(
this
.
componentDict
.
ContainsKey
(
type
))
...
...
@@ -133,15 +113,11 @@ namespace ETHotfix
K
component
=
ComponentFactory
.
CreateWithParent
<
K
,
P1
,
P2
>(
this
,
p1
,
p2
);
if
(
component
is
ISerializeToEntity
)
{
this
.
components
.
Add
(
component
);
}
this
.
componentDict
.
Add
(
type
,
component
);
return
component
;
}
public
K
AddComponent
<
K
,
P1
,
P2
,
P3
>(
P1
p1
,
P2
p2
,
P3
p3
)
where
K
:
Component
,
new
()
public
virtual
K
AddComponent
<
K
,
P1
,
P2
,
P3
>(
P1
p1
,
P2
p2
,
P3
p3
)
where
K
:
Component
,
new
()
{
Type
type
=
typeof
(
K
);
if
(
this
.
componentDict
.
ContainsKey
(
type
))
...
...
@@ -151,15 +127,11 @@ namespace ETHotfix
K
component
=
ComponentFactory
.
CreateWithParent
<
K
,
P1
,
P2
,
P3
>(
this
,
p1
,
p2
,
p3
);
if
(
component
is
ISerializeToEntity
)
{
this
.
components
.
Add
(
component
);
}
this
.
componentDict
.
Add
(
type
,
component
);
return
component
;
}
public
void
RemoveComponent
<
K
>()
where
K
:
Component
public
v
irtual
v
oid
RemoveComponent
<
K
>()
where
K
:
Component
{
if
(
this
.
IsDisposed
)
{
...
...
@@ -172,13 +144,12 @@ namespace ETHotfix
return
;
}
this
.
components
.
Remove
(
component
);
this
.
componentDict
.
Remove
(
type
);
component
.
Dispose
();
}
public
void
RemoveComponent
(
Type
type
)
public
v
irtual
v
oid
RemoveComponent
(
Type
type
)
{
if
(
this
.
IsDisposed
)
{
...
...
@@ -190,7 +161,6 @@ namespace ETHotfix
return
;
}
this
.
components
?.
Remove
(
component
);
this
.
componentDict
.
Remove
(
type
);
component
.
Dispose
();
...
...
@@ -221,6 +191,21 @@ namespace ETHotfix
return
this
.
componentDict
.
Values
.
ToArray
();
}
public
override
void
BeginInit
()
{
base
.
BeginInit
();
this
.
components
.
Clear
();
foreach
(
var
kv
in
this
.
componentDict
)
{
if
(
kv
.
Value
is
ISerializeToEntity
)
{
this
.
components
.
Add
(
kv
.
Value
);
}
}
}
public
override
void
EndInit
()
{
try
...
...
Unity/Assets/Hotfix/Module/Actor/IActorMessage.cs
浏览文件 @
a064917d
...
...
@@ -14,9 +14,4 @@ namespace ETHotfix
public
interface
IActorResponse
:
IResponse
{
}
public
interface
IFrameMessage
:
IMessage
{
long
Id
{
get
;
set
;
}
}
}
\ No newline at end of file
Unity/Assets/Hotfix/Module/UI/UIComponent.cs
浏览文件 @
a064917d
...
...
@@ -9,7 +9,7 @@ namespace ETHotfix
{
public
override
void
Awake
(
UIComponent
self
)
{
self
.
Camera
=
GameObject
.
Find
(
"/Global/
Camera/
UICamera"
);
self
.
Camera
=
GameObject
.
Find
(
"/Global/UICamera"
);
}
}
...
...
Unity/Assets/Model/Base/Object/Entity.cs
浏览文件 @
a064917d
...
...
@@ -2,9 +2,6 @@
using
System.Collections.Generic
;
using
System.Linq
;
using
MongoDB.Bson.Serialization.Attributes
;
#if !SERVER
using
UnityEngine
;
#endif
namespace
ETModel
{
...
...
Unity/Assets/Model/Entity/Hotfix.cs
浏览文件 @
a064917d
...
...
@@ -58,12 +58,12 @@ namespace ETModel
Game
.
Scene
.
GetComponent
<
ResourcesComponent
>().
LoadBundle
(
$"code.unity3d"
);
GameObject
code
=
(
GameObject
)
Game
.
Scene
.
GetComponent
<
ResourcesComponent
>().
GetAsset
(
"code.unity3d"
,
"Code"
);
byte
[]
assBytes
=
code
.
Get
<
TextAsset
>(
"Hotfix.dll"
).
bytes
;
byte
[]
pdbBytes
=
code
.
Get
<
TextAsset
>(
"Hotfix.pdb"
).
bytes
;
#if ILRuntime
Log
.
Debug
(
$"当前使用的是ILRuntime模式"
);
this
.
appDomain
=
new
ILRuntime
.
Runtime
.
Enviorment
.
AppDomain
();
byte
[]
assBytes
=
code
.
Get
<
TextAsset
>(
"Hotfix.dll"
).
bytes
;
byte
[]
pdbBytes
=
code
.
Get
<
TextAsset
>(
"Hotfix.pdb"
).
bytes
;
using
(
MemoryStream
fs
=
new
MemoryStream
(
assBytes
))
using
(
MemoryStream
p
=
new
MemoryStream
(
pdbBytes
))
...
...
@@ -74,13 +74,13 @@ namespace ETModel
this
.
start
=
new
ILStaticMethod
(
this
.
appDomain
,
"ETHotfix.Init"
,
"Start"
,
0
);
#else
Log
.
Debug
(
$"当前使用的是Mono模式"
);
byte
[]
assBytes
=
code
.
Get
<
TextAsset
>(
"Hotfix.dll"
).
bytes
;
byte
[]
pdbBytes
=
code
.
Get
<
TextAsset
>(
"Hotfix.pdb"
).
bytes
;
this
.
assembly
=
Assembly
.
Load
(
assBytes
,
pdbBytes
);
Type
hotfixInit
=
this
.
assembly
.
GetType
(
"ETHotfix.Init"
);
this
.
start
=
new
MonoStaticMethod
(
hotfixInit
,
"Start"
);
#endif
Game
.
Scene
.
GetComponent
<
ResourcesComponent
>().
UnloadBundle
(
$"code.unity3d"
);
}
}
...
...
Unity/Assets/Model/Helper/ActionHelper.cs
浏览文件 @
a064917d
...
...
@@ -7,7 +7,7 @@ namespace ETModel
{
public
static
void
Add
(
this
Button
.
ButtonClickedEvent
buttonClickedEvent
,
Action
action
)
{
buttonClickedEvent
.
AddListener
(()=>
{
action
();
});
buttonClickedEvent
.
AddListener
(()
=>
{
action
();
});
}
}
}
\ No newline at end of file
Unity/Assets/Model/Init.cs
浏览文件 @
a064917d
using
System
;
using
System.IO
;
using
System.Threading
;
using
Google.Protobuf
;
using
UnityEngine
;
namespace
ETModel
...
...
Unity/Assets/Model/Module/Actor/IActorMessage.cs
浏览文件 @
a064917d
...
...
@@ -14,9 +14,4 @@
public
interface
IActorResponse
:
IResponse
{
}
public
interface
IFrameMessage
:
IMessage
{
long
Id
{
get
;
set
;
}
}
}
\ No newline at end of file
Unity/Assets/Model/Module/Demo/PlayerComponent.cs
浏览文件 @
a064917d
...
...
@@ -31,10 +31,6 @@ namespace ETModel
}
}
public
int
A
=
1
;
public
AppType
AppType
;
private
readonly
Dictionary
<
long
,
Player
>
idPlayers
=
new
Dictionary
<
long
,
Player
>();
public
void
Awake
()
...
...
Unity/Assets/Model/Module/UI/UIComponent.cs
浏览文件 @
a064917d
...
...
@@ -8,7 +8,7 @@ namespace ETModel
{
public
override
void
Awake
(
UIComponent
self
)
{
self
.
Camera
=
GameObject
.
Find
(
"/Global/
Camera/
UICamera"
);
self
.
Camera
=
GameObject
.
Find
(
"/Global/UICamera"
);
}
}
...
...
Unity/Assets/Res/Code/Hotfix.mdb.bytes.meta
已删除
100644 → 0
浏览文件 @
5e33a62a
fileFormatVersion: 2
guid: 23845562ede90da4c8bc06908a4c6667
timeCreated: 1508122562
licenseType: Free
TextScriptImporter:
userData:
assetBundleName: code.unity3d
assetBundleVariant:
Unity/Assets/Scenes/Init.unity
浏览文件 @
a064917d
...
...
@@ -219,7 +219,7 @@ Transform:
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
-
{
fileID
:
1
518071807
}
-
{
fileID
:
1
245951402
}
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
1
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
...
...
@@ -269,7 +269,7 @@ Transform:
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
1518071807
}
m_Father
:
{
fileID
:
575235020
}
m_RootOrder
:
0
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!81
&1245951403
...
...
@@ -338,34 +338,3 @@ Camera:
m_OcclusionCulling
:
1
m_StereoConvergence
:
10
m_StereoSeparation
:
0.022
---
!u!1
&1518071806
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
1518071807
}
m_Layer
:
0
m_Name
:
Camera
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!4
&1518071807
Transform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1518071806
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
-
{
fileID
:
1245951402
}
m_Father
:
{
fileID
:
575235020
}
m_RootOrder
:
0
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录