Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
老鱼er
et
提交
0cce11e2
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,体验更适合开发者的 AI 搜索 >>
提交
0cce11e2
编写于
3月 12, 2021
作者:
T
tanghai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
分离Unit的逻辑跟显示层,Unit的GameObject放到GameObjectComponent组件上
上级
a5f7fc25
变更
36
隐藏空白更改
内联
并排
Showing
36 changed file
with
429 addition
and
102 deletion
+429
-102
Proto/OuterMessage.proto
Proto/OuterMessage.proto
+4
-4
Server/Hotfix/Demo/G2M_CreateUnitHandler.cs
Server/Hotfix/Demo/G2M_CreateUnitHandler.cs
+2
-1
Server/Hotfix/Demo/Unit/UnitComponentSystem.cs
Server/Hotfix/Demo/Unit/UnitComponentSystem.cs
+52
-0
Server/Hotfix/Demo/Unit/UnitPathComponentSystem.cs
Server/Hotfix/Demo/Unit/UnitPathComponentSystem.cs
+0
-0
Server/Hotfix/Demo/Unit/UnitSystem.cs
Server/Hotfix/Demo/Unit/UnitSystem.cs
+10
-0
Server/Model/Demo/Unit.cs
Server/Model/Demo/Unit.cs
+0
-40
Server/Model/Demo/Unit/MoveComponent.cs
Server/Model/Demo/Unit/MoveComponent.cs
+0
-0
Server/Model/Demo/Unit/Unit.cs
Server/Model/Demo/Unit/Unit.cs
+45
-0
Server/Model/Demo/Unit/UnitComponent.cs
Server/Model/Demo/Unit/UnitComponent.cs
+22
-0
Server/Model/Demo/Unit/UnitGateComponent.cs
Server/Model/Demo/Unit/UnitGateComponent.cs
+0
-0
Server/Model/Demo/Unit/UnitPathComponent.cs
Server/Model/Demo/Unit/UnitPathComponent.cs
+0
-0
Server/Model/EventType.cs
Server/Model/EventType.cs
+10
-0
Server/Model/Generate/Message/OuterMessage.cs
Server/Model/Generate/Message/OuterMessage.cs
+5
-2
Unity/Assets/Hotfix/Unit/M2C_CreateUnitsHandler.cs
Unity/Assets/Hotfix/Unit/M2C_CreateUnitsHandler.cs
+1
-2
Unity/Assets/Hotfix/Unit/TurnComponentSystem.cs
Unity/Assets/Hotfix/Unit/TurnComponentSystem.cs
+1
-1
Unity/Assets/Hotfix/Unit/UnitFactory.cs
Unity/Assets/Hotfix/Unit/UnitFactory.cs
+5
-4
Unity/Assets/Hotfix/Unit/UnitSystem.cs
Unity/Assets/Hotfix/Unit/UnitSystem.cs
+10
-0
Unity/Assets/Hotfix/Unit/UnitSystem.cs.meta
Unity/Assets/Hotfix/Unit/UnitSystem.cs.meta
+11
-0
Unity/Assets/HotfixView/AppStart_Init.cs
Unity/Assets/HotfixView/AppStart_Init.cs
+2
-0
Unity/Assets/HotfixView/Global.meta
Unity/Assets/HotfixView/Global.meta
+8
-0
Unity/Assets/HotfixView/Global/GlobalComponentSystem.cs
Unity/Assets/HotfixView/Global/GlobalComponentSystem.cs
+16
-0
Unity/Assets/HotfixView/Global/GlobalComponentSystem.cs.meta
Unity/Assets/HotfixView/Global/GlobalComponentSystem.cs.meta
+11
-0
Unity/Assets/HotfixView/Unit/AfterUnitCreate_CreateUnitView.cs
.../Assets/HotfixView/Unit/AfterUnitCreate_CreateUnitView.cs
+4
-3
Unity/Assets/HotfixView/Unit/AnimatorComponentSystem.cs
Unity/Assets/HotfixView/Unit/AnimatorComponentSystem.cs
+1
-1
Unity/Assets/Model/EventType.cs
Unity/Assets/Model/EventType.cs
+10
-0
Unity/Assets/Model/Generate/Message/OuterMessage.cs
Unity/Assets/Model/Generate/Message/OuterMessage.cs
+5
-2
Unity/Assets/Model/Unit/Unit.cs
Unity/Assets/Model/Unit/Unit.cs
+38
-40
Unity/Assets/ModelView/Global.meta
Unity/Assets/ModelView/Global.meta
+8
-0
Unity/Assets/ModelView/Global/GlobalComponent.cs
Unity/Assets/ModelView/Global/GlobalComponent.cs
+13
-0
Unity/Assets/ModelView/Global/GlobalComponent.cs.meta
Unity/Assets/ModelView/Global/GlobalComponent.cs.meta
+11
-0
Unity/Assets/ModelView/Unit/GameObjectComponent.cs
Unity/Assets/ModelView/Unit/GameObjectComponent.cs
+9
-0
Unity/Assets/ModelView/Unit/GameObjectComponent.cs.meta
Unity/Assets/ModelView/Unit/GameObjectComponent.cs.meta
+11
-0
Unity/Assets/Scenes/Init.unity
Unity/Assets/Scenes/Init.unity
+100
-2
Unity/Unity.Hotfix.csproj
Unity/Unity.Hotfix.csproj
+1
-0
Unity/Unity.HotfixView.csproj
Unity/Unity.HotfixView.csproj
+1
-0
Unity/Unity.ModelView.csproj
Unity/Unity.ModelView.csproj
+2
-0
未找到文件。
Proto/OuterMessage.proto
浏览文件 @
0cce11e2
...
...
@@ -52,10 +52,10 @@ message G2C_EnterMap // IResponse
message
UnitInfo
{
int64
UnitId
=
1
;
float
X
=
2
;
float
Y
=
3
;
float
Z
=
4
;
int32
ConfigId
=
2
;
float
X
=
3
;
float
Y
=
4
;
float
Z
=
5
;
}
message
M2C_CreateUnits
// IActorMessage
...
...
Server/Hotfix/Demo/G2M_CreateUnitHandler.cs
浏览文件 @
0cce11e2
...
...
@@ -8,7 +8,7 @@ namespace ET
{
protected
override
async
ETTask
Run
(
Scene
scene
,
G2M_CreateUnit
request
,
M2G_CreateUnit
response
,
Action
reply
)
{
Unit
unit
=
EntityFactory
.
CreateWithId
<
Unit
>(
scene
,
IdGenerater
.
Instance
.
GenerateId
()
);
Unit
unit
=
EntityFactory
.
CreateWithId
<
Unit
,
int
>(
scene
,
IdGenerater
.
Instance
.
GenerateId
(),
1001
);
unit
.
AddComponent
<
MoveComponent
>();
unit
.
AddComponent
<
UnitPathComponent
>();
unit
.
Position
=
new
Vector3
(-
10
,
0
,
-
10
);
...
...
@@ -30,6 +30,7 @@ namespace ET
unitInfo
.
Y
=
u
.
Position
.
y
;
unitInfo
.
Z
=
u
.
Position
.
z
;
unitInfo
.
UnitId
=
u
.
Id
;
unitInfo
.
ConfigId
=
u
.
ConfigId
;
createUnits
.
Units
.
Add
(
unitInfo
);
}
MessageHelper
.
Broadcast
(
unit
,
createUnits
);
...
...
Server/Hotfix/Demo/Unit/UnitComponentSystem.cs
0 → 100644
浏览文件 @
0cce11e2
using
System.Linq
;
namespace
ET
{
public
class
UnitComponentAwakeSystem
:
AwakeSystem
<
UnitComponent
>
{
public
override
void
Awake
(
UnitComponent
self
)
{
}
}
public
class
UnitComponentDestroySystem
:
DestroySystem
<
UnitComponent
>
{
public
override
void
Destroy
(
UnitComponent
self
)
{
self
.
idUnits
.
Clear
();
}
}
public
static
class
UnitComponentSystem
{
public
static
void
Add
(
this
UnitComponent
self
,
Unit
unit
)
{
unit
.
Parent
=
self
;
self
.
idUnits
.
Add
(
unit
.
Id
,
unit
);
}
public
static
Unit
Get
(
this
UnitComponent
self
,
long
id
)
{
self
.
idUnits
.
TryGetValue
(
id
,
out
Unit
unit
);
return
unit
;
}
public
static
void
Remove
(
this
UnitComponent
self
,
long
id
)
{
Unit
unit
;
self
.
idUnits
.
TryGetValue
(
id
,
out
unit
);
self
.
idUnits
.
Remove
(
id
);
unit
?.
Dispose
();
}
public
static
void
RemoveNoDispose
(
this
UnitComponent
self
,
long
id
)
{
self
.
idUnits
.
Remove
(
id
);
}
public
static
Unit
[]
GetAll
(
this
UnitComponent
self
)
{
return
self
.
idUnits
.
Values
.
ToArray
();
}
}
}
\ No newline at end of file
Server/Hotfix/Demo/UnitPathComponentSystem.cs
→
Server/Hotfix/Demo/Unit
/Unit
PathComponentSystem.cs
浏览文件 @
0cce11e2
文件已移动
Server/Hotfix/Demo/Unit/UnitSystem.cs
0 → 100644
浏览文件 @
0cce11e2
namespace
ET
{
public
class
UnitSystem
:
AwakeSystem
<
Unit
,
int
>
{
public
override
void
Awake
(
Unit
self
,
int
configId
)
{
self
.
ConfigId
=
configId
;
}
}
}
\ No newline at end of file
Server/Model/Demo/Unit.cs
已删除
100644 → 0
浏览文件 @
a5f7fc25
using
UnityEngine
;
namespace
ET
{
public
enum
UnitType
{
Hero
,
Npc
}
public
class
UnitAwakeSystem
:
AwakeSystem
<
Unit
,
UnitType
>
{
public
override
void
Awake
(
Unit
self
,
UnitType
a
)
{
self
.
Awake
(
a
);
}
}
public
sealed
class
Unit
:
Entity
{
public
UnitType
UnitType
{
get
;
private
set
;
}
public
Vector3
Position
{
get
;
set
;
}
public
void
Awake
(
UnitType
unitType
)
{
this
.
UnitType
=
unitType
;
}
public
override
void
Dispose
()
{
if
(
this
.
IsDisposed
)
{
return
;
}
base
.
Dispose
();
}
}
}
\ No newline at end of file
Server/Model/Demo/MoveComponent.cs
→
Server/Model/Demo/
Unit/
MoveComponent.cs
浏览文件 @
0cce11e2
文件已移动
Server/Model/Demo/Unit/Unit.cs
0 → 100644
浏览文件 @
0cce11e2
using
System
;
using
MongoDB.Bson.Serialization.Attributes
;
using
UnityEngine
;
namespace
ET
{
[
BsonIgnoreExtraElements
]
public
sealed
class
Unit
:
Entity
{
public
int
ConfigId
;
//配置表id
[
BsonIgnore
]
public
UnitConfig
Config
=>
UnitConfigCategory
.
Instance
.
Get
(
this
.
ConfigId
);
private
Vector3
position
;
//坐标
public
Vector3
Position
{
get
=>
this
.
position
;
set
{
this
.
position
=
value
;
Game
.
EventSystem
.
Publish
(
new
EventType
.
ChangePosition
()
{
Unit
=
this
}).
Coroutine
();
}
}
[
BsonIgnore
]
public
Vector3
Forward
{
get
=>
this
.
Rotation
*
Vector3
.
forward
;
set
=>
this
.
Rotation
=
Quaternion
.
LookRotation
(
value
,
Vector3
.
up
);
}
private
Quaternion
rotation
;
public
Quaternion
Rotation
{
get
=>
this
.
rotation
;
set
{
this
.
rotation
=
value
;
Game
.
EventSystem
.
Publish
(
new
EventType
.
ChangeRotation
()
{
Unit
=
this
}).
Coroutine
();
}
}
}
}
\ No newline at end of file
Server/Model/Demo/UnitComponent.cs
→
Server/Model/Demo/Unit
/Unit
Component.cs
浏览文件 @
0cce11e2
...
...
@@ -9,48 +9,8 @@ namespace ET
{
[
BsonElement
]
[
BsonDictionaryOptions
(
DictionaryRepresentation
.
ArrayOfArrays
)]
private
readonly
Dictionary
<
long
,
Unit
>
idUnits
=
new
Dictionary
<
long
,
Unit
>();
public
override
void
Dispose
()
{
if
(
this
.
IsDisposed
)
{
return
;
}
base
.
Dispose
();
foreach
(
Unit
unit
in
this
.
idUnits
.
Values
)
{
unit
.
Dispose
();
}
this
.
idUnits
.
Clear
();
}
public
void
Add
(
Unit
unit
)
{
this
.
idUnits
.
Add
(
unit
.
Id
,
unit
);
unit
.
Parent
=
this
;
}
public
Unit
Get
(
long
id
)
{
this
.
idUnits
.
TryGetValue
(
id
,
out
Unit
unit
);
return
unit
;
}
public
void
Remove
(
long
id
)
{
Unit
unit
;
this
.
idUnits
.
TryGetValue
(
id
,
out
unit
);
this
.
idUnits
.
Remove
(
id
);
unit
?.
Dispose
();
}
public
void
RemoveNoDispose
(
long
id
)
{
this
.
idUnits
.
Remove
(
id
);
}
public
readonly
Dictionary
<
long
,
Unit
>
idUnits
=
new
Dictionary
<
long
,
Unit
>();
public
int
Count
{
get
...
...
@@ -58,10 +18,5 @@ namespace ET
return
this
.
idUnits
.
Count
;
}
}
public
Unit
[]
GetAll
()
{
return
this
.
idUnits
.
Values
.
ToArray
();
}
}
}
\ No newline at end of file
Server/Model/Demo/UnitGateComponent.cs
→
Server/Model/Demo/Unit
/Unit
GateComponent.cs
浏览文件 @
0cce11e2
文件已移动
Server/Model/Demo/UnitPathComponent.cs
→
Server/Model/Demo/Unit
/Unit
PathComponent.cs
浏览文件 @
0cce11e2
文件已移动
Server/Model/EventType.cs
浏览文件 @
0cce11e2
...
...
@@ -5,5 +5,15 @@
public
struct
AppStart
{
}
public
struct
ChangePosition
{
public
Unit
Unit
;
}
public
struct
ChangeRotation
{
public
Unit
Unit
;
}
}
}
\ No newline at end of file
Server/Model/Generate/Message/OuterMessage.cs
浏览文件 @
0cce11e2
...
...
@@ -111,12 +111,15 @@ namespace ET
public
long
UnitId
{
get
;
set
;
}
[
ProtoMember
(
2
)]
public
float
X
{
get
;
set
;
}
public
int
ConfigId
{
get
;
set
;
}
[
ProtoMember
(
3
)]
public
float
Y
{
get
;
set
;
}
public
float
X
{
get
;
set
;
}
[
ProtoMember
(
4
)]
public
float
Y
{
get
;
set
;
}
[
ProtoMember
(
5
)]
public
float
Z
{
get
;
set
;
}
}
...
...
Unity/Assets/Hotfix/Unit/M2C_CreateUnitsHandler.cs
浏览文件 @
0cce11e2
...
...
@@ -16,8 +16,7 @@ namespace ET
{
continue
;
}
Unit
unit
=
UnitFactory
.
Create
(
session
.
Domain
,
unitInfo
.
UnitId
);
unit
.
Position
=
new
Vector3
(
unitInfo
.
X
,
unitInfo
.
Y
,
unitInfo
.
Z
);
Unit
unit
=
UnitFactory
.
Create
(
session
.
Domain
,
unitInfo
);
}
await
ETTask
.
CompletedTask
;
...
...
Unity/Assets/Hotfix/Unit/TurnComponentSystem.cs
浏览文件 @
0cce11e2
...
...
@@ -37,7 +37,7 @@ namespace ET
/// </summary>
public
static
void
Turn2D
(
this
TurnComponent
self
,
Vector3
dir
,
float
turnTime
=
0.1f
)
{
Vector3
nexpos
=
self
.
GetParent
<
Unit
>().
GameObject
.
transform
.
p
osition
+
dir
;
Vector3
nexpos
=
self
.
GetParent
<
Unit
>().
P
osition
+
dir
;
self
.
Turn
(
nexpos
,
turnTime
);
}
...
...
Unity/Assets/Hotfix/Unit/UnitFactory.cs
浏览文件 @
0cce11e2
...
...
@@ -4,18 +4,19 @@ namespace ET
{
public
static
class
UnitFactory
{
public
static
Unit
Create
(
Entity
domain
,
long
id
)
public
static
Unit
Create
(
Entity
domain
,
UnitInfo
unitInfo
)
{
Unit
unit
=
EntityFactory
.
CreateWithId
<
Unit
>(
domain
,
id
);
Unit
unit
=
EntityFactory
.
CreateWithId
<
Unit
,
int
>(
domain
,
unitInfo
.
UnitId
,
unitInfo
.
ConfigId
);
unit
.
Position
=
new
Vector3
(
unitInfo
.
X
,
unitInfo
.
Y
,
unitInfo
.
Z
);
unit
.
AddComponent
<
MoveComponent
>();
unit
.
AddComponent
<
TurnComponent
>();
unit
.
AddComponent
<
UnitPathComponent
>();
Game
.
EventSystem
.
Publish
(
new
EventType
.
AfterUnitCreate
()
{
Unit
=
unit
});
UnitComponent
unitComponent
=
domain
.
GetComponent
<
UnitComponent
>();
unitComponent
.
Add
(
unit
);
Game
.
EventSystem
.
Publish
(
new
EventType
.
AfterUnitCreate
()
{
Unit
=
unit
});
return
unit
;
}
}
...
...
Unity/Assets/Hotfix/Unit/UnitSystem.cs
0 → 100644
浏览文件 @
0cce11e2
namespace
ET
{
public
class
UnitSystem
:
AwakeSystem
<
Unit
,
int
>
{
public
override
void
Awake
(
Unit
self
,
int
configId
)
{
self
.
ConfigId
=
configId
;
}
}
}
\ No newline at end of file
Unity/Assets/Hotfix/Unit/UnitSystem.cs.meta
0 → 100644
浏览文件 @
0cce11e2
fileFormatVersion: 2
guid: 0daabdf06b115458495f514cc74d9e34
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Unity/Assets/HotfixView/AppStart_Init.cs
浏览文件 @
0cce11e2
...
...
@@ -21,6 +21,8 @@ namespace ET
Game
.
Scene
.
AddComponent
<
NetThreadComponent
>();
Game
.
Scene
.
AddComponent
<
ZoneSceneManagerComponent
>();
Game
.
Scene
.
AddComponent
<
GlobalComponent
>();
ResourcesComponent
.
Instance
.
LoadBundle
(
"unit.unity3d"
);
...
...
Unity/Assets/HotfixView/Global.meta
0 → 100644
浏览文件 @
0cce11e2
fileFormatVersion: 2
guid: 75b45c480953e4122a340e39a52bb914
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Unity/Assets/HotfixView/Global/GlobalComponentSystem.cs
0 → 100644
浏览文件 @
0cce11e2
using
UnityEngine
;
namespace
ET
{
public
class
GlobalComponentAwakeSystem
:
AwakeSystem
<
GlobalComponent
>
{
public
override
void
Awake
(
GlobalComponent
self
)
{
GlobalComponent
.
Instance
=
self
;
self
.
Global
=
GameObject
.
Find
(
"/Global"
).
transform
;
self
.
Unit
=
GameObject
.
Find
(
"/Global/Unit"
).
transform
;
self
.
UI
=
GameObject
.
Find
(
"/Global/UI"
).
transform
;
}
}
}
\ No newline at end of file
Unity/Assets/HotfixView/Global/GlobalComponentSystem.cs.meta
0 → 100644
浏览文件 @
0cce11e2
fileFormatVersion: 2
guid: 4cfd49fb001474252a4e9c0c6a5db6c9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Unity/Assets/HotfixView/Unit/AfterUnitCreate_CreateUnitView.cs
浏览文件 @
0cce11e2
...
...
@@ -7,12 +7,13 @@ namespace ET
protected
override
async
ETTask
Run
(
EventType
.
AfterUnitCreate
args
)
{
// Unit View层
// 这里可以改成异步加载,demo就不搞了
GameObject
bundleGameObject
=
(
GameObject
)
ResourcesComponent
.
Instance
.
GetAsset
(
"Unit.unity3d"
,
"Unit"
);
GameObject
prefab
=
bundleGameObject
.
Get
<
GameObject
>(
"Skeleton"
);
GameObject
go
=
UnityEngine
.
Object
.
Instantiate
(
prefab
);
GameObject
.
DontDestroyOnLoad
(
go
)
;
args
.
Unit
.
GameObject
=
go
;
GameObject
go
=
UnityEngine
.
Object
.
Instantiate
(
prefab
,
GlobalComponent
.
Instance
.
Unit
,
true
);
go
.
transform
.
position
=
args
.
Unit
.
Position
;
args
.
Unit
.
AddComponent
<
GameObjectComponent
>().
GameObject
=
go
;
args
.
Unit
.
AddComponent
<
AnimatorComponent
>();
await
ETTask
.
CompletedTask
;
}
...
...
Unity/Assets/HotfixView/Unit/AnimatorComponentSystem.cs
浏览文件 @
0cce11e2
...
...
@@ -33,7 +33,7 @@ namespace ET
{
public
static
void
Awake
(
this
AnimatorComponent
self
)
{
Animator
animator
=
self
.
GetParent
<
Uni
t
>().
GameObject
.
GetComponent
<
Animator
>();
Animator
animator
=
self
.
Parent
.
GetComponent
<
GameObjectComponen
t
>().
GameObject
.
GetComponent
<
Animator
>();
if
(
animator
==
null
)
{
...
...
Unity/Assets/Model/EventType.cs
浏览文件 @
0cce11e2
...
...
@@ -6,6 +6,16 @@
{
}
public
struct
ChangePosition
{
public
Unit
Unit
;
}
public
struct
ChangeRotation
{
public
Unit
Unit
;
}
public
struct
PingChange
{
public
Scene
ZoneScene
;
...
...
Unity/Assets/Model/Generate/Message/OuterMessage.cs
浏览文件 @
0cce11e2
...
...
@@ -111,12 +111,15 @@ namespace ET
public
long
UnitId
{
get
;
set
;
}
[
ProtoMember
(
2
)]
public
float
X
{
get
;
set
;
}
public
int
ConfigId
{
get
;
set
;
}
[
ProtoMember
(
3
)]
public
float
Y
{
get
;
set
;
}
public
float
X
{
get
;
set
;
}
[
ProtoMember
(
4
)]
public
float
Y
{
get
;
set
;
}
[
ProtoMember
(
5
)]
public
float
Z
{
get
;
set
;
}
}
...
...
Unity/Assets/Model/Unit/Unit.cs
浏览文件 @
0cce11e2
using
UnityEngine
;
using
Quaternion
=
UnityEngine
.
Quaternion
;
using
Vector3
=
UnityEngine
.
Vector3
;
using
System
;
using
MongoDB.Bson.Serialization.Attributes
;
using
UnityEngine
;
namespace
ET
{
public
sealed
class
Unit
:
Entity
{
// 先放这里,去掉ViewGO,后面挪到显示层
public
GameObject
GameObject
;
public
int
ConfigId
;
[
BsonIgnoreExtraElements
]
public
sealed
class
Unit
:
Entity
{
public
int
ConfigId
;
//配置表id
public
UnitConfig
Config
{
get
{
return
UnitConfigCategory
.
Instance
.
Get
(
this
.
ConfigId
);
}
}
public
Vector3
Position
{
get
{
return
GameObject
.
transform
.
position
;
}
set
{
GameObject
.
transform
.
position
=
value
;
}
}
[
BsonIgnore
]
public
UnitConfig
Config
=>
UnitConfigCategory
.
Instance
.
Get
(
this
.
ConfigId
);
public
Quaternion
Rotation
{
get
{
return
GameObject
.
transform
.
rotation
;
}
set
{
GameObject
.
transform
.
rotation
=
value
;
}
}
private
Vector3
position
;
//坐标
}
public
Vector3
Position
{
get
=>
this
.
position
;
set
{
this
.
position
=
value
;
Game
.
EventSystem
.
Publish
(
new
EventType
.
ChangePosition
()
{
Unit
=
this
}).
Coroutine
();
}
}
[
BsonIgnore
]
public
Vector3
Forward
{
get
=>
this
.
Rotation
*
Vector3
.
forward
;
set
=>
this
.
Rotation
=
Quaternion
.
LookRotation
(
value
,
Vector3
.
up
);
}
private
Quaternion
rotation
;
public
Quaternion
Rotation
{
get
=>
this
.
rotation
;
set
{
this
.
rotation
=
value
;
Game
.
EventSystem
.
Publish
(
new
EventType
.
ChangeRotation
()
{
Unit
=
this
}).
Coroutine
();
}
}
}
}
\ No newline at end of file
Unity/Assets/ModelView/Global.meta
0 → 100644
浏览文件 @
0cce11e2
fileFormatVersion: 2
guid: 762e0f6284e284dce99c41909e26c785
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Unity/Assets/ModelView/Global/GlobalComponent.cs
0 → 100644
浏览文件 @
0cce11e2
using
UnityEngine
;
namespace
ET
{
public
class
GlobalComponent
:
Entity
{
public
static
GlobalComponent
Instance
;
public
Transform
Global
;
public
Transform
Unit
;
public
Transform
UI
;
}
}
\ No newline at end of file
Unity/Assets/ModelView/Global/GlobalComponent.cs.meta
0 → 100644
浏览文件 @
0cce11e2
fileFormatVersion: 2
guid: d18ded40beb444ba2a1f8e97028953c3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Unity/Assets/ModelView/Unit/GameObjectComponent.cs
0 → 100644
浏览文件 @
0cce11e2
using
UnityEngine
;
namespace
ET
{
public
class
GameObjectComponent
:
Entity
{
public
GameObject
GameObject
;
}
}
\ No newline at end of file
Unity/Assets/ModelView/Unit/GameObjectComponent.cs.meta
0 → 100644
浏览文件 @
0cce11e2
fileFormatVersion: 2
guid: 3d4aec20cfdbe40fdbed5c2555047f8e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Unity/Assets/Scenes/Init.unity
浏览文件 @
0cce11e2
...
...
@@ -43,7 +43,7 @@ RenderSettings:
---
!u!157
&3
LightmapSettings
:
m_ObjectHideFlags
:
0
serializedVersion
:
1
1
serializedVersion
:
1
2
m_GIWorkflowMode
:
0
m_GISettings
:
serializedVersion
:
2
...
...
@@ -98,7 +98,7 @@ LightmapSettings:
m_TrainingDataDestination
:
TrainingData
m_LightProbeSampleCountMultiplier
:
4
m_LightingDataAsset
:
{
fileID
:
0
}
m_
UseShadowmask
:
0
m_
LightingSettings
:
{
fileID
:
94338416
}
---
!u!196
&4
NavMeshSettings
:
serializedVersion
:
2
...
...
@@ -118,9 +118,72 @@ NavMeshSettings:
manualTileSize
:
0
tileSize
:
256
accuratePlacement
:
0
maxJobWorkers
:
0
preserveTilesOutsideBounds
:
0
debug
:
m_Flags
:
0
m_NavMeshData
:
{
fileID
:
0
}
---
!u!850595691
&94338416
LightingSettings
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_Name
:
Settings.lighting
serializedVersion
:
3
m_GIWorkflowMode
:
0
m_EnableBakedLightmaps
:
1
m_EnableRealtimeLightmaps
:
1
m_RealtimeEnvironmentLighting
:
1
m_BounceScale
:
1
m_AlbedoBoost
:
1
m_IndirectOutputScale
:
1
m_UsingShadowmask
:
0
m_BakeBackend
:
0
m_LightmapMaxSize
:
1024
m_BakeResolution
:
40
m_Padding
:
2
m_TextureCompression
:
1
m_AO
:
0
m_AOMaxDistance
:
1
m_CompAOExponent
:
0
m_CompAOExponentDirect
:
0
m_ExtractAO
:
0
m_MixedBakeMode
:
1
m_LightmapsBakeMode
:
1
m_FilterMode
:
1
m_LightmapParameters
:
{
fileID
:
15204
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
m_ExportTrainingData
:
0
m_TrainingDataDestination
:
TrainingData
m_RealtimeResolution
:
2
m_ForceWhiteAlbedo
:
0
m_ForceUpdates
:
0
m_FinalGather
:
0
m_FinalGatherRayCount
:
1024
m_FinalGatherFiltering
:
1
m_PVRCulling
:
1
m_PVRSampling
:
1
m_PVRDirectSampleCount
:
32
m_PVRSampleCount
:
500
m_PVREnvironmentSampleCount
:
500
m_PVREnvironmentReferencePointCount
:
2048
m_LightProbeSampleCountMultiplier
:
4
m_PVRBounces
:
2
m_PVRMinBounces
:
2
m_PVREnvironmentMIS
:
0
m_PVRFilteringMode
:
2
m_PVRDenoiserTypeDirect
:
0
m_PVRDenoiserTypeIndirect
:
0
m_PVRDenoiserTypeAO
:
0
m_PVRFilterTypeDirect
:
0
m_PVRFilterTypeIndirect
:
0
m_PVRFilterTypeAO
:
0
m_PVRFilteringGaussRadiusDirect
:
1
m_PVRFilteringGaussRadiusIndirect
:
5
m_PVRFilteringGaussRadiusAO
:
2
m_PVRFilteringAtrousPositionSigmaDirect
:
0.5
m_PVRFilteringAtrousPositionSigmaIndirect
:
2
m_PVRFilteringAtrousPositionSigmaAO
:
1
---
!u!1
&251107983
GameObject
:
m_ObjectHideFlags
:
0
...
...
@@ -198,6 +261,7 @@ MonoBehaviour:
m_FallbackScreenDPI
:
96
m_DefaultSpriteDPI
:
96
m_DynamicPixelsPerUnit
:
1
m_PresetInfoIsWorld
:
0
---
!u!223
&251107987
Canvas
:
m_ObjectHideFlags
:
0
...
...
@@ -362,6 +426,7 @@ MonoBehaviour:
m_FallbackScreenDPI
:
96
m_DefaultSpriteDPI
:
96
m_DynamicPixelsPerUnit
:
1
m_PresetInfoIsWorld
:
0
---
!u!223
&493985073
Canvas
:
m_ObjectHideFlags
:
0
...
...
@@ -425,6 +490,7 @@ Transform:
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
-
{
fileID
:
1784017108
}
-
{
fileID
:
630054496
}
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
1
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
...
...
@@ -444,6 +510,36 @@ MonoBehaviour:
-
key
:
Unit
gameObject
:
{
fileID
:
1610378981859644
,
guid
:
cfaf4529ce2243c4c85126e9d008897b
,
type
:
3
}
---
!u!1
&630054495
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
630054496
}
m_Layer
:
0
m_Name
:
Unit
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!4
&630054496
Transform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
630054495
}
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
:
[]
m_Father
:
{
fileID
:
575235020
}
m_RootOrder
:
1
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!1
&872594939
GameObject
:
m_ObjectHideFlags
:
0
...
...
@@ -521,6 +617,7 @@ MonoBehaviour:
m_FallbackScreenDPI
:
96
m_DefaultSpriteDPI
:
96
m_DynamicPixelsPerUnit
:
1
m_PresetInfoIsWorld
:
0
---
!u!223
&872594943
Canvas
:
m_ObjectHideFlags
:
0
...
...
@@ -711,6 +808,7 @@ MonoBehaviour:
m_FallbackScreenDPI
:
96
m_DefaultSpriteDPI
:
96
m_DynamicPixelsPerUnit
:
1
m_PresetInfoIsWorld
:
0
---
!u!223
&1439952252
Canvas
:
m_ObjectHideFlags
:
0
...
...
Unity/Unity.Hotfix.csproj
浏览文件 @
0cce11e2
...
...
@@ -74,6 +74,7 @@
<Compile
Include=
"Assets\Hotfix\Module\Message\SessionAcceptTimeoutComponentSystem.cs"
/>
<Compile
Include=
"Assets\Hotfix\Scene\ZoneSceneFlagComponentSystem.cs"
/>
<Compile
Include=
"Assets\Hotfix\Scene\ZoneSceneManagerComponentSystem.cs"
/>
<Compile
Include=
"Assets\Hotfix\Unit\UnitSystem.cs"
/>
<None
Include=
"Assets\Hotfix\Unity.Hotfix.asmdef"
/>
<Reference
Include=
"UnityEngine"
>
<HintPath>
/Applications/Unity/Hub/Editor/2020.2.2f1c1/Unity.app/Contents/Managed/UnityEngine/UnityEngine.dll
</HintPath>
...
...
Unity/Unity.HotfixView.csproj
浏览文件 @
0cce11e2
...
...
@@ -76,6 +76,7 @@
<Compile
Include=
"Assets\HotfixView\Helper\LoadConfigHelper.cs"
/>
<Compile
Include=
"Assets\HotfixView\Unit\AnimatorComponentSystem.cs"
/>
<Compile
Include=
"Assets\HotfixView\Scene\AfterCreateZoneScene_AddComponent.cs"
/>
<Compile
Include=
"Assets\HotfixView\Global\GlobalComponentSystem.cs"
/>
<None
Include=
"Assets\HotfixView\Unity.HotfixView.asmdef"
/>
<Reference
Include=
"UnityEngine"
>
<HintPath>
/Applications/Unity/Hub/Editor/2020.2.2f1c1/Unity.app/Contents/Managed/UnityEngine/UnityEngine.dll
</HintPath>
...
...
Unity/Unity.ModelView.csproj
浏览文件 @
0cce11e2
...
...
@@ -71,6 +71,8 @@
<Compile
Include=
"Assets\ModelView\UI\UILoading\UILoadingComponent.cs"
/>
<Compile
Include=
"Assets\ModelView\Module\UI\CanvasConfig.cs"
/>
<Compile
Include=
"Assets\ModelView\Module\UI\UIEventAttribute.cs"
/>
<Compile
Include=
"Assets\ModelView\Unit\GameObjectComponent.cs"
/>
<Compile
Include=
"Assets\ModelView\Global\GlobalComponent.cs"
/>
<None
Include=
"Assets\ModelView\Unity.ModelView.asmdef"
/>
<Reference
Include=
"UnityEngine"
>
<HintPath>
/Applications/Unity/Hub/Editor/2020.2.2f1c1/Unity.app/Contents/Managed/UnityEngine/UnityEngine.dll
</HintPath>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录