private void Start() { m_RigidBody = GetComponent <Rigidbody>(); m_Capsule = GetComponent <CapsuleCollider>(); mouseLook.Init(transform, cam.transform); CrossPlatformInputManager.SwitchActiveInputMethod(CrossPlatformInputManager.ActiveInputMethod.Hardware); }
void Awake() { headCollider = GetComponent <CircleCollider2D>(); feetCollider = GetComponent <BoxCollider2D>(); bodyCollider = GetComponent <CapsuleCollider2D>(); CrossPlatformInputManager.SwitchActiveInputMethod(CrossPlatformInputManager.ActiveInputMethod.Touch); }
public void Initialize() { if (_levelConfig.desktopControls) { CrossPlatformInputManager.SwitchActiveInputMethod(CrossPlatformInputManager.ActiveInputMethod.Hardware); _uiController.HideControls(); } }
// Use this for initialization private void Start() { step = false; m_CharacterController = GetComponentInParent <CharacterController>(); m_StepCycle = 0f; m_NextStep = m_StepCycle / 2f; m_AudioSource = GetComponentInParent <AudioSource>(); CrossPlatformInputManager.SwitchActiveInputMethod(CrossPlatformInputManager.ActiveInputMethod.Hardware); }
private void Start() { CrossPlatformInputManager.SwitchActiveInputMethod(InputMethod); CharacterController = GetComponent <CharacterController>(); Camera = UnityEngine.Camera.main; StepCycle = 0f; NextStep = StepCycle / 2f; Jumping = false; AudioSource = GetComponent <AudioSource>(); MouseLook.Init(transform, Camera.transform); }
// Use this for initialization private void Start() { m_CharacterController = GetComponent <CharacterController>(); m_Camera = Camera.main; m_OriginalCameraPosition = m_Camera.transform.localPosition; m_FovKick.Setup(m_Camera); m_HeadBob.Setup(m_Camera, m_StepInterval); m_StepCycle = 0f; m_NextStep = m_StepCycle / 2f; m_Jumping = false; m_AudioSource = GetComponent <AudioSource>(); m_MouseLook.Init(transform, m_Camera.transform); CrossPlatformInputManager.SwitchActiveInputMethod(CrossPlatformInputManager.ActiveInputMethod.Hardware); }
// Use this for initialization void Start() { rigidBody = GetComponent <Rigidbody2D>(); spriteRenderer = GetComponent <SpriteRenderer>(); animator = GetComponent <Animator>(); levelMgr = FindObjectOfType <LevelMgr> (); atStart = new Vector3(transform.position.x, transform.position.y, transform.position.z); canMove = true; #if UNITY_STANDALONE CrossPlatformInputManager.SwitchActiveInputMethod(CrossPlatformInputManager.ActiveInputMethod.Hardware); #else CrossPlatformInputManager.SwitchActiveInputMethod(CrossPlatformInputManager.ActiveInputMethod.Touch); #endif }
private void CloseTutorial() { CrossPlatformInputManager.SwitchActiveInputMethod(SettingsManager.touchControlsEnabled ? CrossPlatformInputManager.ActiveInputMethod.Touch : CrossPlatformInputManager.ActiveInputMethod.Hardware); if (proceedToGame) { //MenuPhase = MenuPhase.Main; GameController.current.LoadGame(true); //PlayButtonClicked(); } else { _tutorialController.HideTutorial(); _anim.SetTrigger("CloseTutorial"); MenuPhase = MenuState.Settings; } }
public void StartTutorial(bool proceedToGame) { PlayerPrefs.SetInt("SeenTutorial", 1); CrossPlatformInputManager.SwitchActiveInputMethod(CrossPlatformInputManager.ActiveInputMethod.Touch); this.proceedToGame = proceedToGame; _tutorialController.ShowTutorial(); GameController.backButtonLeavesApp = false; MenuPhase = MenuState.Tutorial; tutorialCanvasGroup.interactable = true; if (this.proceedToGame) { _anim.SetTrigger("OpenTutorialFirstTime"); } else { _anim.SetTrigger("OpenTutorial"); } _controlRig.EnableControlRig(true); }
public void Start() { _loadingAnimator = loadingScreen.GetComponent <Animator>(); _leaderboard = FindObjectOfType <LeaderboardController>(); _mobileControlRig = FindObjectOfType <MobileControlRig>(); _waterController = FindObjectOfType <WaterController>(); _garbageCollector = FindObjectOfType <DeactivateOnLeave>(); _player = FindObjectOfType <PlayerController>(); _generator = FindObjectOfType <RandomTerrainGenerator>(); _cameraController = FindObjectOfType <CameraController>(); _easyMode = SettingsManager.easyMode; bool enableTouchControls = SettingsManager.touchControlsEnabled; _mobileControlRig.EnableControlRig(enableTouchControls); CrossPlatformInputManager.SwitchActiveInputMethod(enableTouchControls ? CrossPlatformInputManager.ActiveInputMethod.Touch : CrossPlatformInputManager.ActiveInputMethod.Hardware); audioController.FadeIn(1); if (!PlayerPrefs.HasKey("SeenScoreInfo") && _easyMode) { PlayerPrefs.SetInt("SeenScoreInfo", 1); ShowScoreInfoPopup(); } _generator.GenerateChunk(); }
void onDestroy() { CrossPlatformInputManager.SwitchActiveInputMethod(CrossPlatformInputManager.ActiveInputMethod.Touch); this.m_MouseLook.SetCursorLock(false); }
// Use this for initialization private void Start() { m_Camera = Camera.main; m_MouseLook.Init(transform, m_Camera.transform); CrossPlatformInputManager.SwitchActiveInputMethod(CrossPlatformInputManager.ActiveInputMethod.Hardware); }