角色预制体创建
This commit is contained in:
@@ -45,7 +45,6 @@ namespace NBF
|
||||
|
||||
QualitySettings.vSyncCount = 0;
|
||||
InitLanguage();
|
||||
InitService();
|
||||
InitUI();
|
||||
if (!playVideo)
|
||||
{
|
||||
@@ -98,30 +97,6 @@ namespace NBF
|
||||
|
||||
#endregion
|
||||
|
||||
#region Service
|
||||
|
||||
// private static readonly List<MonoService> Services = new List<MonoService>();
|
||||
private static readonly Dictionary<Type, MonoService> Services = new Dictionary<Type, MonoService>();
|
||||
|
||||
private void AddService<T>() where T : MonoService, new()
|
||||
{
|
||||
var service = this.GetComponent<T>();
|
||||
if (!service)
|
||||
{
|
||||
service = gameObject.AddComponent<T>();
|
||||
}
|
||||
|
||||
Services[typeof(T)] = service;
|
||||
}
|
||||
|
||||
private void InitService()
|
||||
{
|
||||
AddService<InputManager>();
|
||||
AddService<Settings>();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public void StartGame()
|
||||
{
|
||||
PermanentCommon.Init();
|
||||
@@ -135,13 +110,6 @@ namespace NBF
|
||||
private void LoadData()
|
||||
{
|
||||
ConfigAssets.Init();
|
||||
|
||||
// var inventoryManager = GetComponent<InventoryManager>();
|
||||
// if (inventoryManager == null)
|
||||
// {
|
||||
// inventoryManager = gameObject.AddComponent<InventoryManager>();
|
||||
// }
|
||||
//InventoryManager
|
||||
}
|
||||
|
||||
#region New
|
||||
|
||||
Reference in New Issue
Block a user