Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.

Commit acd11d8

Browse files
committed
增加poolmanager
1 parent 6825208 commit acd11d8

File tree

14 files changed

+331
-175
lines changed

14 files changed

+331
-175
lines changed

Assets/Game/Scripts/Base/GameMode.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public class GameMode : MonoBehaviour
2727
public static SettingManager Setting;
2828
public static SystemManager System;
2929
public static NetworkManager Network;
30+
public static PoolManager Pool;
3031

3132
/// <summary>
3233
/// 当前程序集
@@ -76,10 +77,11 @@ IEnumerator Start()
7677
Setting = GameFrameworkMode.GetModule<SettingManager>();
7778
System= GameFrameworkMode.GetModule<SystemManager>();
7879
Network= GameFrameworkMode.GetModule<NetworkManager>();
79-
#endregion
80+
Pool = GameFrameworkMode.GetModule<PoolManager>();
81+
#endregion
8082

81-
#region resource
82-
Resource.ResUpdateType = ResUpdateType;
83+
#region resource
84+
Resource.ResUpdateType = ResUpdateType;
8385
Resource.ResUpdatePath = ResUpdatePath;
8486
Resource.LocalPathType = LocalPathType;
8587

Assets/Game/Scripts/Editor/GameModeEditor.cs

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -380,52 +380,7 @@ void DrawNodeDataGUI()
380380
return;
381381

382382
GUILayout.BeginVertical("HelpBox");
383-
//int
384-
// if (VrCoreEntity.Node.IntNodes.Count > 0)
385-
{
386-
GUILayout.Label("Int Node", EditorStyles.boldLabel);
387-
foreach (var item in GameMode.Node.IntNodes)
388-
{
389-
GUILayout.Label(item.Key + ":" + item.Value);
390-
}
391-
}
392-
//float
393-
// if (VrCoreEntity.Node.FloatNodes.Count > 0)
394-
{
395-
GUILayout.Label("Float Node", EditorStyles.boldLabel);
396-
foreach (var item in GameMode.Node.FloatNodes)
397-
{
398-
GUILayout.Label(item.Key + ":" + item.Value);
399-
}
400-
}
401-
//bool
402-
// if (VrCoreEntity.Node.BoolNodes.Count > 0)
403-
{
404-
GUILayout.Label("Bool Node", EditorStyles.boldLabel);
405-
foreach (var item in GameMode.Node.BoolNodes)
406-
{
407-
GUILayout.Label(item.Key + ":" + item.Value);
408-
}
409-
}
410-
//string
411-
// if (VrCoreEntity.Node.StringNodes.Count > 0)
412-
{
413-
GUILayout.Label("String Node", EditorStyles.boldLabel);
414-
foreach (var item in GameMode.Node.StringNodes)
415-
{
416-
GUILayout.Label(item.Key + ":" + item.Value);
417-
}
418-
}
419-
//object
420-
//if (VrCoreEntity.Node.ObjectNodes.Count > 0)
421-
{
422-
GUILayout.Label("Float Node", EditorStyles.boldLabel);
423-
foreach (var item in GameMode.Node.ObjectNodes)
424-
{
425-
GUILayout.Label(item.Key + ":" + item.Value);
426-
}
427-
}
428-
383+
429384
GUILayout.EndVertical();
430385
}
431386

Assets/GameFramework/Node/NodeData.cs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
//-----------------------------------------------------------------------
2+
// <copyright>
3+
// Copyright (c) 2018 Zhang Yang. All rights reserved.
4+
// </copyright>$
5+
// <describe> #数据节点# </describe>
6+
// <email> [email protected] </email>
7+
// <time> #2018年8月26日 17点35# </time>
8+
//-----------------------------------------------------------------------
9+
using System;
10+
using System.Collections.Generic;
11+
12+
namespace GameFramework.Taurus
13+
{
14+
public class NodeData<T>:NodeDataBase
15+
{
16+
private readonly Dictionary<string, T> _nodeDatas = new Dictionary<string, T>();
17+
18+
public T Get(string key,T defaultValue = default(T))
19+
{
20+
T t;
21+
if (!_nodeDatas.TryGetValue(key, out t))
22+
t = defaultValue;
23+
return t;
24+
}
25+
26+
public void Set(string key,T value)
27+
{
28+
_nodeDatas[key] = value;
29+
}
30+
31+
public bool Has(string key)
32+
{
33+
return _nodeDatas.ContainsKey(key);
34+
}
35+
36+
public void Remove(string key)
37+
{
38+
if (_nodeDatas.ContainsKey(key))
39+
_nodeDatas.Remove(key);
40+
}
41+
42+
public override void Clear()
43+
{
44+
_nodeDatas.Clear();
45+
}
46+
}
47+
}

Assets/GameFramework/Node/NodeData.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//-----------------------------------------------------------------------
2+
// <copyright>
3+
// Copyright (c) 2018 Zhang Yang. All rights reserved.
4+
// </copyright>$
5+
// <describe> #数据节点的基类# </describe>
6+
// <email> [email protected] </email>
7+
// <time> #2018年8月26日 17点34# </time>
8+
//-----------------------------------------------------------------------
9+
10+
namespace GameFramework.Taurus
11+
{
12+
public abstract class NodeDataBase
13+
{
14+
public abstract void Clear();
15+
}
16+
}

Assets/GameFramework/Node/NodeDataBase.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)