public virtual void Init() { CoreTools.GetManager <Updater>().AddTo(this); body = GetComponent <Rigidbody>(); gameManager = CoreTools.GetManager <GameManager>(); bounds = BoundsCalculate(gameObject); SetScreenBoundaries(bounds); render = GetComponent <MeshRenderer>(); shipCollider = GetComponent <Collider>(); source = GetComponent <AudioSource>(); pool = CoreTools.GetManager <RegulatoryPools>(); timerManager = CoreTools.GetManager <TimerManager>(); }
public void Init() { gameManager = CoreTools.GetManager <GameManager>(); pool = CoreTools.GetManager <RegulatoryPools>(); timerManager = CoreTools.GetManager <TimerManager>(); inputManager = CoreTools.GetManager <InputManager>(); FindCamera(); DefiningScreenBoundaries(); AddEventSystem(); CreatePools(); state = GameState.Start; gameCanvas = GameObject.Instantiate(gameManager.GameCanvasPrefab); gameUi = gameCanvas.GetComponent <GameUI>(); gameUi.Init(); gameCanvas.SetActive(false); lobbyCanvas = GameObject.Instantiate(gameManager.LobbyCanvasPrefab); lobbyMenu = lobbyCanvas.GetComponent <LobbyMenu>(); lobbyMenu.Init(); lobbyCanvas.SetActive(false); SetInput(inputManager.CurrentType); inputManager.GetInput().SetActive(false); gameManager.sceneRightEdge = sceneRightEdge; gameManager.sceneLeftEdge = sceneLeftEdge; gameManager.sceneTopEdge = sceneTopEdge; gameManager.sceneBottomEdge = sceneBottomEdge; gameManager.sceneWidth = sceneWidth; gameManager.sceneHeight = sceneHeight; startAsteroidCount = gameManager.StartAsteroidsCount; player = GameObject.Instantiate(gameManager.PlayerPrefab); ship = player.GetComponent <Ship>(); ship.Init(); player.SetActive(false); Ufo = GameObject.Instantiate(gameManager.UfoPrefab); ufo = Ufo.GetComponent <UFO>(); ufo.Init(); Ufo.SetActive(false); EnteringGameMenu(); }
public void Init() { gameManager = CoreTools.GetManager <GameManager>(); changeButtonText = ChangeInput.GetComponentInChildren <Text>(); ScoreText.text = ""; }