public void AddPrefab(string assetBundleName, string assetName, PoolPrefabInfo prefabInfo)
        {
            if (_prefabs.ContainsKey(assetName))
            {
                Debug.Log("已经存在资源:" + assetName);
                return;
            }
            if (prefabInfo.Prefab == null)
            {
                //根据assetName,直接从ResourceManager里面加载
                prefabInfo.Prefab = GameFrameworkMode.GetModule <ResourceManager>().LoadAsset <GameObject>(assetBundleName, assetName);
                if (prefabInfo.Prefab == null)
                {
                    Debug.Log("预设资源为null:" + assetName);
                    return;
                }
            }
            _prefabs[assetName]  = prefabInfo;
            _spawneds[assetName] = new List <GameObject>();

            Initialization(assetName, prefabInfo);
        }
Esempio n. 2
0
 public DataTableManager()
 {
     _allDataTabvles = new Dictionary <int, DataTableBase>();
     _resource       = GameFrameworkMode.GetModule <ResourceManager>();
 }
 public AudioManager()
 {
     _resourceManager = GameFrameworkMode.GetModule <ResourceManager>();
 }
Esempio n. 4
0
        IEnumerator Start()
        {
            //默认不销毁
            DontDestroyOnLoad(gameObject);

            #region Module
            Event        = GameFrameworkMode.GetModule <EventManager>();
            State        = GameFrameworkMode.GetModule <GameStateManager>();
            Node         = GameFrameworkMode.GetModule <NodeManager>();
            Resource     = GameFrameworkMode.GetModule <ResourceManager>();
            UI           = GameFrameworkMode.GetModule <UIManager>();
            WebRequest   = GameFrameworkMode.GetModule <WebRequestManager>();
            Audio        = GameFrameworkMode.GetModule <AudioManager>();
            Localization = GameFrameworkMode.GetModule <LocalizationManager>();
            Setting      = GameFrameworkMode.GetModule <SettingManager>();
            System       = GameFrameworkMode.GetModule <SystemManager>();
            Network      = GameFrameworkMode.GetModule <NetworkManager>();
            Pool         = GameFrameworkMode.GetModule <PoolManager>();
            #endregion

            #region resource
            Resource.ResUpdateType = ResUpdateType;
            Resource.ResUpdatePath = ResUpdatePath;
            Resource.LocalPathType = LocalPathType;

            //添加对象池管理器
            GameObject gameObjectPoolHelper = new GameObject("IGameObjectPoolHelper");
            gameObjectPoolHelper.transform.SetParent(transform);
            Resource.SetGameObjectPoolHelper(gameObjectPoolHelper.AddComponent <GameObjectPoolHelper>());
            #endregion

            #region auido
            //设置音频播放
            GameObject audioPlayer = new GameObject("AudioSourcePlayer");
            audioPlayer.transform.SetParent(transform);
            //添加AduioSource
            Audio.SetDefaultAudioSource(audioPlayer.AddComponent <AudioSource>(), audioPlayer.AddComponent <AudioSource>(),
                                        audioPlayer.AddComponent <AudioSource>());
            #endregion

            #region WebRequest
            //设置帮助类
            GameObject webRequestHelper = new GameObject("IWebRequestHelper");
            webRequestHelper.transform.SetParent(transform);
            GameObject webDownloadHelper = new GameObject("IWebDownloadMonoHelper");
            webDownloadHelper.transform.SetParent(transform);
            WebRequest.SetWebRequestHelper(webRequestHelper.AddComponent <WebRquestMonoHelper>());
            WebRequest.SetWebDownloadHelper(webDownloadHelper.AddComponent <WebDownloadMonoHelper>());
            #endregion

            #region state
            //开启整个项目的流程
            Assembly = typeof(GameMode).Assembly;
            State.CreateContext(Assembly);
            yield return(new WaitForEndOfFrame());

            State.SetStateStart();
            #endregion

            #region Setting
            GameObject debugHelper = new GameObject("DebugHelper");
            debugHelper.transform.SetParent(transform);
            Setting.SetDebugHelper(debugHelper.AddComponent <DebugHelper>());
            Setting.DebugEnable = DebugEnable;
            #endregion
        }
Esempio n. 5
0
 private void OnDestroy()
 {
     GameFrameworkMode.ShutDown();
 }
Esempio n. 6
0
 private void FixedUpdate()
 {
     GameFrameworkMode.FixedUpdate();
 }
Esempio n. 7
0
 private void Update()
 {
     GameFrameworkMode.Update();
 }
 private void SetUIText(string key)
 {
     _uiText.text = GameFrameworkMode.GetModule <LocalizationManager>().Get(key);
 }