Exemple #1
0
 public MainMenuBehaviour GetMainMenu()
 {
     if (_mainMenu == null)
     {
         var resources = CustomResources.Load <MainMenuBehaviour>(AssetsPathScreen.Screens[ScreenType.MainMenu].Screen);
         _mainMenu = Object.Instantiate(resources, _canvas.transform.position, Quaternion.identity, _canvas.transform);
     }
     return(_mainMenu);
 }
        public void Initialization()
        {
            Services.Instance.LevelService.IsSnakeAlive = true;
            var characterBehaviour = CustomResources.Load <CharacterBehaviour>
                                         (AssetsPathGameObject.GameObjects[GameObjectType.Character]);

            _characterBehaviour = Object.Instantiate(characterBehaviour);
            Services.Instance.LevelService.CharacterBehaviour = _characterBehaviour;
        }
Exemple #3
0
 public MainMenuBehaviour GetTestMenu()
 {
     if (_testMenu == null)
     {
         if (_canvas == null)
         {
             var resourcesCanvas = CustomResources.Load <Canvas>(AssetsPathGameObject.GameObjects[GameObjectType.Canvas]);
             _canvas = Object.Instantiate(resourcesCanvas, Vector3.one, Quaternion.identity);
         }
         var resources = CustomResources.Load <MainMenuBehaviour>(AssetsPathScreen.Screens[ScreenType.TestMenu].Screen);
         _testMenu = Object.Instantiate(resources, _canvas.transform.position, Quaternion.identity, _canvas.transform);
     }
     return(_testMenu);
 }
Exemple #4
0
        public ScreenFactory()
        {
            var resources = CustomResources.Load <Canvas>(AssetsPathGameObject.GameObjects[GameObjectType.Canvas]);

            _canvas = Object.Instantiate(resources, Vector3.one, Quaternion.identity);
        }
Exemple #5
0
 private static T Load <T>(string resourcesPath) where T : Object =>
 CustomResources.Load <T>(Path.ChangeExtension(resourcesPath, null));