Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
老鱼er
et
提交
1e011287
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 搜索 >>
提交
1e011287
编写于
2月 08, 2017
作者:
T
tanghai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复行为树编辑器一些错误
上级
bf5a32b6
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
52 addition
and
48 deletion
+52
-48
Unity/Assets/Editor/BehaviorTreeEditor/BehaviorDesignerUtility.cs
...sets/Editor/BehaviorTreeEditor/BehaviorDesignerUtility.cs
+16
-6
Unity/Assets/Editor/BehaviorTreeEditor/BehaviorDesignerWindow.cs
...ssets/Editor/BehaviorTreeEditor/BehaviorDesignerWindow.cs
+2
-1
Unity/Assets/Editor/BehaviorTreeEditor/BehaviorManager.cs
Unity/Assets/Editor/BehaviorTreeEditor/BehaviorManager.cs
+3
-2
Unity/Assets/Editor/BehaviorTreeEditor/BehaviorTreeConfigExtension.cs
.../Editor/BehaviorTreeEditor/BehaviorTreeConfigExtension.cs
+2
-3
Unity/Assets/Editor/BehaviorTreeEditor/BehaviorTreeOperateUtility.cs
...s/Editor/BehaviorTreeEditor/BehaviorTreeOperateUtility.cs
+3
-1
Unity/Assets/Editor/BehaviorTreeEditor/ExportNodeTypeConfig.cs
.../Assets/Editor/BehaviorTreeEditor/ExportNodeTypeConfig.cs
+1
-10
Unity/Assets/Editor/EditorInit.cs
Unity/Assets/Editor/EditorInit.cs
+2
-0
Unity/Assets/Scripts/Entity/Game.cs
Unity/Assets/Scripts/Entity/Game.cs
+13
-12
Unity/Assets/Scripts/Helper/DllHelper.cs
Unity/Assets/Scripts/Helper/DllHelper.cs
+1
-0
Unity/Assets/Scripts/ReferenceCollector.cs
Unity/Assets/Scripts/ReferenceCollector.cs
+0
-9
Unity/Unity.Editor.csproj
Unity/Unity.Editor.csproj
+9
-4
未找到文件。
Unity/Assets/Editor/BehaviorTreeEditor/BehaviorDesignerUtility.cs
浏览文件 @
1e011287
using
System.Collections.Generic
;
using
System
;
using
System.Collections.Generic
;
using
Base
;
using
UnityEditor
;
using
UnityEngine
;
...
...
@@ -12,15 +14,23 @@ namespace MyEditor
public
static
Texture2D
GetTexture
(
string
imageName
)
{
if
(!
mTextureDict
.
ContainsKey
(
imageName
))
try
{
Texture2D
tex
=
AssetDatabase
.
LoadAssetAtPath
<
Texture2D
>(
ImagePathName
+
imageName
+
".png"
);
if
(
tex
!=
null
)
if
(!
mTextureDict
.
ContainsKey
(
imageName
))
{
mTextureDict
.
Add
(
imageName
,
tex
);
Texture2D
tex
=
AssetDatabase
.
LoadAssetAtPath
<
Texture2D
>(
ImagePathName
+
imageName
+
".png"
);
if
(
tex
!=
null
)
{
mTextureDict
.
Add
(
imageName
,
tex
);
}
}
return
mTextureDict
[
imageName
];
}
return
mTextureDict
[
imageName
];
catch
(
Exception
e
)
{
throw
new
Exception
(
$"无法找到资源:
{
imageName
}
"
,
e
);
}
}
public
static
void
DrawConnection
(
Vector2
src
,
Vector2
dst
)
...
...
Unity/Assets/Editor/BehaviorTreeEditor/BehaviorDesignerWindow.cs
浏览文件 @
1e011287
...
...
@@ -48,9 +48,10 @@ namespace MyEditor
}
public
static
void
ShowWindow
()
{
BehaviorDesignerWindow
target
=
GetWindow
<
BehaviorDesignerWindow
>(
"行为树编辑器"
,
false
);
BehaviorDesignerWindow
target
=
GetWindow
<
BehaviorDesignerWindow
>(
"行为树编辑器"
,
false
);
target
.
minSize
=
new
Vector2
(
600f
,
500f
);
}
public
void
ShowSubWin
(
Vector2
pos
,
SubWinType
subWinType
)
{
mShowSubWin
=
true
;
...
...
Unity/Assets/Editor/BehaviorTreeEditor/BehaviorManager.cs
浏览文件 @
1e011287
...
...
@@ -101,7 +101,9 @@ namespace MyEditor
public
void
NewLoadData
()
{
LoadNodeTypeProto
();
Game
.
EntityEventManager
.
Register
(
"Controller"
,
DllHelper
.
GetController
());
LoadNodeTypeProto
();
NewLoadPrefabTree
();
FilterClassify
();
}
...
...
@@ -426,7 +428,6 @@ namespace MyEditor
return
;
}
selectNodeName
=
""
;
ExportNodeTypeConfig
.
LoadAssembly
();
CurTreeGO
=
go
;
NewLoadData
();
BehaviorDesignerWindow
.
ShowWindow
();
...
...
Unity/Assets/Editor/BehaviorTreeEditor/BehaviorTreeConfigExtension.cs
浏览文件 @
1e011287
...
...
@@ -34,14 +34,13 @@ namespace Model
}
private
static
BehaviorNodeConfig
CreateNodeConfig
(
this
BehaviorTreeConfig
treeConfig
,
string
name
)
{
ExportNodeTypeConfig
.
LoadAssembly
();
ClientNodeTypeProto
proto
=
ExportNodeTypeConfig
.
GetNodeTypeProtoFromDll
(
name
);
GameObject
go
=
new
GameObject
();
go
.
name
=
name
;
go
.
transform
.
parent
=
treeConfig
.
gameObject
.
transform
;
BehaviorNodeConfig
node
=
go
.
AddComponent
<
BehaviorNodeConfig
>();
((
UnityEngine
.
Object
)
node
)
.
name
=
name
;
//
node.describe = proto.describe;
node
.
name
=
name
;
node
.
describe
=
proto
.
describe
;
foreach
(
var
args
in
proto
.
new_args_desc
)
{
...
...
Unity/Assets/Editor/BehaviorTreeEditor/BehaviorTreeOperateUtility.cs
浏览文件 @
1e011287
...
...
@@ -103,7 +103,9 @@ namespace MyEditor
GameObject
prefab
=
null
;
try
{
GameObject
go
=
new
GameObject
();
Game
.
EntityEventManager
.
Register
(
"Controller"
,
DllHelper
.
GetController
());
GameObject
go
=
new
GameObject
();
BehaviorTreeConfig
newConfig
=
go
.
AddComponent
<
BehaviorTreeConfig
>();
BehaviorNodeConfig
root
=
newConfig
.
AddRootNode
(
rootNodeName
);
...
...
Unity/Assets/Editor/BehaviorTreeEditor/ExportNodeTypeConfig.cs
浏览文件 @
1e011287
...
...
@@ -51,15 +51,6 @@ namespace MyEditor
return
Game
.
EntityEventManager
.
GetAssembly
(
"Controller"
);
}
public
static
Assembly
LoadAssembly
()
{
AssetDatabase
.
Refresh
();
Assembly
assembly
=
DllHelper
.
GetController
();
Game
.
EntityEventManager
.
Register
(
"Controller"
,
assembly
);
return
assembly
;
}
public
static
ClientNodeTypeProto
GetNodeTypeProtoFromDll
(
string
name
)
{
Type
type
=
GetNodeType
(
name
);
...
...
@@ -281,7 +272,7 @@ namespace MyEditor
Type
nodeType
=
assembly
.
GetType
(
"Controller."
+
nodeName
);
if
(
nodeType
==
null
)
{
Log
.
Error
(
string
.
Format
(
"不存在此节点:{0}"
,
nodeName
)
);
Log
.
Error
(
$"不存在此节点:
{
nodeName
}
"
);
return
null
;
}
return
nodeType
;
...
...
Unity/Assets/Editor/EditorInit.cs
浏览文件 @
1e011287
...
...
@@ -11,6 +11,8 @@ namespace MyEditor
{
static
EditorInit
()
{
Game
.
EntityEventManager
.
Register
(
"Model"
,
typeof
(
Game
).
Assembly
);
Game
.
EntityEventManager
.
Register
(
"Editor"
,
typeof
(
EditorInit
).
Assembly
);
}
}
}
Unity/Assets/Scripts/Entity/Game.cs
浏览文件 @
1e011287
...
...
@@ -12,22 +12,15 @@ namespace Model
private
static
Scene
scene
;
static
Game
()
{
disposers
=
new
HashSet
<
Disposer
>();
entityEventManager
=
new
EntityEventManager
();
entityEventManager
.
Register
(
"Model"
,
typeof
(
Game
).
Assembly
);
entityEventManager
.
Register
(
"Controller"
,
DllHelper
.
GetController
());
scene
=
new
Scene
();
scene
.
AddComponent
<
EventComponent
>();
}
public
static
Scene
Scene
{
get
{
if
(
scene
==
null
)
{
scene
=
new
Scene
();
scene
.
AddComponent
<
EventComponent
>();
}
return
scene
;
}
}
...
...
@@ -36,6 +29,10 @@ namespace Model
{
get
{
if
(
disposers
==
null
)
{
disposers
=
new
HashSet
<
Disposer
>();
}
return
disposers
;
}
}
...
...
@@ -60,6 +57,10 @@ namespace Model
{
get
{
if
(
entityEventManager
==
null
)
{
entityEventManager
=
new
EntityEventManager
();
}
return
entityEventManager
;
}
set
...
...
Unity/Assets/Scripts/Helper/DllHelper.cs
浏览文件 @
1e011287
using
System.Reflection
;
using
Base
;
using
UnityEngine
;
namespace
Model
...
...
Unity/Assets/Scripts/ReferenceCollector.cs
浏览文件 @
1e011287
...
...
@@ -106,15 +106,6 @@ public class ReferenceCollector: MonoBehaviour, ISerializationCallbackReceiver
{
return
null
;
}
if
(
typeof
(
T
)
==
typeof
(
GameObject
))
{
return
dictGo
as
T
;
}
var
go
=
dictGo
as
GameObject
;
if
(
go
!=
null
)
{
return
(
dictGo
as
GameObject
).
GetComponent
<
T
>();
}
return
dictGo
as
T
;
}
...
...
Unity/Unity.Editor.csproj
浏览文件 @
1e011287
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project
ToolsVersion=
"4.0"
DefaultTargets=
"Build"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<PropertyGroup>
<Configuration
Condition=
" '$(Configuration)' == '' "
>
Debug
</Configuration>
...
...
@@ -13,11 +13,13 @@
<TargetFrameworkIdentifier>
.NETFramework
</TargetFrameworkIdentifier>
<TargetFrameworkVersion>
v3.5
</TargetFrameworkVersion>
<TargetFrameworkProfile>
Unity Full v3.5
</TargetFrameworkProfile>
<CompilerResponseFile></CompilerResponseFile>
<CompilerResponseFile>
</CompilerResponseFile>
<UnityProjectType>
Editor:5
</UnityProjectType>
<UnityBuildTarget>
StandaloneWindows:5
</UnityBuildTarget>
<UnityVersion>
5.4.3f1
</UnityVersion>
<RootNamespace></RootNamespace>
<RootNamespace>
</RootNamespace>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "
>
<DebugType>
pdbonly
</DebugType>
...
...
@@ -157,6 +159,9 @@
<None
Include=
"Assets\CSharp 6.0 Support\AsyncTools\Plugins\AsyncBridge.Net35.xml"
/>
<None
Include=
"Assets\CSharp 6.0 Support\AsyncTools\Plugins\System.Threading.xml"
/>
</ItemGroup>
<ItemGroup>
<Folder
Include=
"Assets\Editor\MenuEditor\"
/>
</ItemGroup>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
/>
<Target
Name=
"GenerateTargetFrameworkMonikerAttribute"
/>
</Project>
</Project>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录