Exemplo n.º 1
0
 /// <summary>
 /// Find module installer components for auto install with settings from unity editor.
 /// </summary>
 /// <param name="_gamemanagerGO"></param>
 public void ModuleAutoInstallerOverride(GameObject _gamemanagerGO)
 {
     // DataModule
     if (_gamemanagerGO.GetComponentInChildren <ModuleInstaller <IDataModule> >())
     {
         IDataModule dm = _gamemanagerGO.GetComponentInChildren <ModuleInstaller <IDataModule> >().InstallModule();
         DataModule.SetupModule(dm, dm.Settings);
         //typeof(IMyInterface).IsAssignableFrom(typeof(MyType))
         //typeof().GetInterfaces().Contains(typeof(IMyInterface))
     }
     // LocalizationModule
     if (_gamemanagerGO.GetComponentInChildren <ModuleInstaller <ILocalizationModule> >())
     {
         ILocalizationModule dm = _gamemanagerGO.GetComponentInChildren <ModuleInstaller <ILocalizationModule> >().InstallModule();
         LocalizationModule.SetupModule(dm, dm.Settings);
     }
     // PlayerProfileModule Install
     if (_gamemanagerGO.GetComponentInChildren <ModuleInstaller <IPlayerProfileModule> >())
     {
         IPlayerProfileModule moduleInstance = _gamemanagerGO.GetComponentInChildren <ModuleInstaller <IPlayerProfileModule> >().InstallModule();
         PlayerProfile.SetupModule(moduleInstance, moduleInstance.Settings);
     }
     // UIModule Install
     if (_gamemanagerGO.GetComponentInChildren <ModuleInstaller <IUIModule> >())
     {
         IUIModule moduleInstance = _gamemanagerGO.GetComponentInChildren <ModuleInstaller <IUIModule> >().InstallModule();
         UIModule.SetupModule(moduleInstance, moduleInstance.Settings);
     }
     // SceneModule Install
     if (_gamemanagerGO.GetComponentInChildren <ModuleInstaller <ISceneModule> >())
     {
         ISceneModule moduleInstance = _gamemanagerGO.GetComponentInChildren <ModuleInstaller <ISceneModule> >().InstallModule();
         SceneModule.SetupModule(moduleInstance, moduleInstance.Settings);
     }
 }
 /// <summary>
 /// Module Setup.
 /// </summary>
 /// <param name="_concreteModule">Concrete module implementation to set as active module behaviour.</param>
 /// <returns></returns>
 public ILocalizationModule SetupModule(ILocalizationModule _concreteModule, IModuleSettings _settings = null)
 {
     ConcreteModuleImplementation = _concreteModule.SetupModule(_concreteModule, _settings);
     if (ConcreteModuleImplementation == null)
     {
         OnSetupError();
     }
     return(ConcreteModuleImplementation);
 }
Exemplo n.º 3
0
        //public SDKPlatformManager sdkManager = SDKPlatformManager.Instance;

        //public UIManager uiManager = UIManager.Instance;


        //private void Awake()
        //{
        //    Application.targetFrameRate = targetFrameRate;
        //    UnityMonoDriver.s_instance = this;
        //    if (base.transform.parent != null)
        //    {
        //        DontDestroyOnLoad(base.transform.parent);
        //    }
        //    InvokeRepeating("Tick",0f, 0.01f);
        //    resourceManager.Init(GameObject.Find("ResourceManager").GetComponent<GameResourceManager>());
        //    uiManager.Init();
        //}
        //private void Start()
        //{
        //    sdkManager.Init();
        //    sdkManager.Install();
        //    AudioManagerBase.Instance.Init();
        //    clientGameStateManager.Init();
        //    clientGameStateManager.EnterDefaultState();
        //}
        //private void Update()
        //{
        //    sdkManager.Update();
        //    resourceManager.Update();
        //    AudioManagerBase.Instance.Update();
        //    uiManager.Update(Time.deltaTime);
        //}
        //private void Tick()
        //{
        //    //StoryManager.singleton.Tick();
        //    TimerManager.Tick();
        //    FrameTimerManager.Tick();
        //}
        //private void OnApplicationFocus(bool focus)
        //{
        //    if (focus)
        //    {
        //        if (GameControllerBase.thePlayer != null)
        //        {
        //            GameControllerBase.thePlayer.m_skillManager.Compensation(prePay);
        //            TimerManager.AddTimer(1000, 0, () => { prePay = 0; });
        //        }
        //    }
        //}
        //private float prePause = 0;
        //private float prePay = 0;
        //private void OnApplicationPause(bool pause)
        //{
        //    if (pause)
        //    {
        //        prePause = Time.realtimeSinceStartup;
        //    }
        //    else
        //    {
        //        float cur = Time.realtimeSinceStartup;
        //        GameControllerBase.StartTime = cur;
        //        float pay = cur - prePause;
        //        if (GameControllerBase.thePlayer != null)
        //        {
        //            GameControllerBase.thePlayer.m_skillManager.Compensation(-prePay);
        //            prePay = 0;
        //            GameControllerBase.thePlayer.m_skillManager.Compensation(pay);
        //        }
        //    }
        //}
        private void Awake()
        {
            CaomaoDriver.Instance = this;
            DontDestroyOnLoad(this.gameObject);
            UIRoot = GameObject.FindGameObjectWithTag("UIRoot").transform;
            DontDestroyOnLoad(UIRoot.gameObject);
            GameSettingModule  = this.CreateModule <GameSettingModule>();
            UIModule           = this.CreateModule <CUIModule>();
            GameStateModule    = this.CreateModule <ClientGameStateModule>();
            ResourceModule     = this.CreateModule <ResourceModule>();
            SceneLoadModule    = this.CreateModule <SceneLoadModule>();
            WordFilterModule   = this.CreateModule <WordFilterModule>();
            LocalizationModule = this.CreateModule <LocalizationModule>();
            WebRequestModule   = this.CreateModule <WebRequestModule>();
            RedPointModule     = this.CreateModule <RedPointModule>();
            HotFixModule       = this.CreateModule <HotFixModule>();
            TimerModule        = this.CreateModule <TimerModule>();
            AudioModule        = this.CreateModule <AudioModule>();
            DataModule         = this.CreateModule <DataModule>();
            NewbieHelpModule   = this.CreateModule <NewbieHelpModule>();
            this.modules.Awake();
        }
Exemplo n.º 4
0
 public static void OnLocalizationUpdated(
     ILocalizationModule localization)
 {
     App.LocalizationFactory
     .OnLocalizationUpdated(localization);
 }
Exemplo n.º 5
0
 public static void OnLocalizationUpdated(
     ILocalizationModule localization)
 {
     CurrentFactory
     .OnLocalizationUpdated(localization);
 }