private void RegisterService() { IServiceContainer container = context.GetContainer(); /* Initialize the ui view locator and register UIViewLocator */ container.Register <IUIViewLocator>(new ResourcesViewLocator()); /* register IUpdateSystem */ container.Register(new GlobalUpdateSystem()); /* register IUpdateSystem */ container.Register(new SoundManager()); globalUpdateSystem = context.GetService <GlobalUpdateSystem>(); soundManager = context.GetService <SoundManager>(); #if UNITY_EDITOR windowManager = FindObjectOfType <GlobalWindowManager>(); if (windowManager != null) { throw new NotFoundException("Exist the GlobalWindowManager."); } #endif windowManager = GetComponentInChildren <Canvas>().gameObject.AddComponent <GlobalWindowManager>(); /* register GlobalWindowManager */ container.Register(windowManager); }
private void InitUpdateSystem() { updateSystem = new GlobalUpdateSystem(); context.GetContainer().Register(updateSystem); }