Unity项目架构设计与开发管理
2016-09-16 14:54
796 查看
原文链接:http://blog.csdn.net/u013108312/article/details/52555617
1.EmptyGO
2.Simple GameManager
3.Manager of Managers
4.MVCS(StrageloC)
5.MVVM(uFrame)
……….
1.EmptyGo
Put all the code without visual representation in the world onto an empty game object.
Use GameObject.Find() or inspector target references to communicate with each other.
3.Manager of Managers
中型以上的游戏。
MainManager customizes and manages all the sub-managers.
Submanagers operate as singletons and can easily address each other to collaborate.
一个中型以上的项目至少有:
最好要有:
内存管理问题:a simple pool design:
上面的设计出现的问题:
This pool is not able to manager the Load/Unload of prefabs.
Only dormant objects are managed in the pool,active objects must be managed out of pool separately.
The total number of dormant objects can be controlled,rather than the instances of each prefab.
A better design
PoolManager
– SpawnPool
— PrefabPool
Active instances.
Inactive instance.
4.StrageIOC
原文链接:http://blog.csdn.net/u013108312/article/details/52555617
1.EmptyGO
2.Simple GameManager
3.Manager of Managers
4.MVCS(StrageloC)
5.MVVM(uFrame)
……….
1.EmptyGo
Put all the code without visual representation in the world onto an empty game object.
Use GameObject.Find() or inspector target references to communicate with each other.
3.Manager of Managers
中型以上的游戏。
MainManager customizes and manages all the sub-managers.
Submanagers operate as singletons and can easily address each other to collaborate.
//MainManager EventManager //Streamline messaging between classes. AudioManager //Control audio playback from one place. GUIManager //Centralize the controls to handle clicks.etc. PoolManager //Persist prefab instances in RAM and display them as needed. LevelManager //Queue up leves and perform transitions between them. 这里有个插件可以参考一下:Mad LeveManager GameManager //manage the core game mechanics.usually projects pecific. SaveManger //Save and load user preferences and achievements.这里有个插件可以参考一下:Save Manager MenuManger //Control all menus animations contents and behaviors.
一个中型以上的项目至少有:
1. Level Manager 2. Pool Manager 3. Save Manager
最好要有:
1. GameManager 2. EvemtManager 3. MenuManager 4. GUIManager 5. AudioManager
内存管理问题:a simple pool design:
private List<GameObject> dormantObjects = new List<GameObject>();
public GameObject Spawn(GameOjbect go) { GameObject temp = null; if(dormantObjects.Count > 0) { foreach(GameObject dob in dormantObjects) { if(dob.name == go.name) { temp = dob; dormantObjects.Remove(temp); return temp; } } } temp = GameObject.Instantiate(go) as GameObject; temp.name = go.name; return temp; }
public void Despawn(GameObject go) { go.transform.parent = PoolManager.transform; go.SetActive(false); dormantObjects.Add(go); Trim(); } public void Trim() { while(dormantObjects.Count > Capacity) { GameObject dob = dormantObjects[0]; dormantObjects.RemoveAt(0); Destroy(dob); } }
上面的设计出现的问题:
This pool is not able to manager the Load/Unload of prefabs.
Only dormant objects are managed in the pool,active objects must be managed out of pool separately.
The total number of dormant objects can be controlled,rather than the instances of each prefab.
A better design
PoolManager
– SpawnPool
— PrefabPool
Active instances.
Inactive instance.
4.StrageIOC
IBinder.Bind<Key>().To<Value>(); IBinder.Bind<key>().To<value>().ToName(name);
原文链接:http://blog.csdn.net/u013108312/article/details/52555617
相关文章推荐
- [Unity] Unity项目架构设计与开发管理 - 视频观看记录
- Unity项目架构设计与开发管理观看总结
- 开源软件项目管理系统招设计/开发。。。。。Zend Framework2架构 svn://735.ikwb.com/pms
- 在一个项目中管理好基础架构和开发团队
- 在一个项目中管理好基础架构和开发团队
- 关于架构设计和项目管理的讨论
- ASP.NET架构设计&.NET 分布式架构开发项目实战收集
- (转)软件项目设计开发管理
- IT项目的面向对象分析设计、开发及管理
- 在一个项目中管理好基础架构和开发团队
- 软件项目的面向对象设计、开发及管理——外企真实项目案例分析
- 不是三维——软件项目的设计、开发与管理
- 在一个项目中管理好基础架构和开发团队
- 软件项目的面向对象设计、开发及管理
- 在一个项目中管理好基础架构和开发团队
- 不是三维―软件项目的设计、开发与管理
- 在一个项目中管理好基础架构和开发团队
- 在一个项目中管理好基础架构和开发团队
- 最近安排-看技术书籍如架构设计项目管理等
- IT项目的面向对象分析设计、开发及管理