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; }
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); }
public ScreenFactory() { var resources = CustomResources.Load <Canvas>(AssetsPathGameObject.GameObjects[GameObjectType.Canvas]); _canvas = Object.Instantiate(resources, Vector3.one, Quaternion.identity); }
private static T Load <T>(string resourcesPath) where T : Object => CustomResources.Load <T>(Path.ChangeExtension(resourcesPath, null));