public GameModelSetupInteractive GetCurrentGame() { Ray ray = _camera.ScreenPointToRay(new Vector3(Screen.width * 0.5f, Screen.height * 0.5f, 0f)); if (Physics.Raycast(ray, out RaycastHit hitInfo, _raycastMaxDistance)) { GameModelSetupInteractive gameFromRay = hitInfo.transform.GetComponent <GameModelSetupInteractive>(); if (_currentGame != gameFromRay) { _currentGame = gameFromRay; } }
public override void OnEnter() { _controls.InputEnabled = false; _currentGame = _interactions.GetCurrentGame(); _currentGame.InputEnabled = true; }
public override void OnExit() { _currentGame.InputEnabled = false; _currentGame = null; _controls.InputEnabled = true; }