private void Start()
 {
     m_RigidBody = GetComponent <Rigidbody>();
     m_Capsule   = GetComponent <CapsuleCollider>();
     mouseLook.Init(transform, cam.transform);
     CrossPlatformInputManager.SwitchActiveInputMethod(CrossPlatformInputManager.ActiveInputMethod.Hardware);
 }
Exemplo n.º 2
0
    void Awake()
    {
        headCollider = GetComponent <CircleCollider2D>();
        feetCollider = GetComponent <BoxCollider2D>();
        bodyCollider = GetComponent <CapsuleCollider2D>();

        CrossPlatformInputManager.SwitchActiveInputMethod(CrossPlatformInputManager.ActiveInputMethod.Touch);
    }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 5
0
    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);
 }
Exemplo n.º 7
0
    // 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
    }
Exemplo n.º 8
0
 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;
     }
 }
Exemplo n.º 9
0
 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);
 }
Exemplo n.º 10
0
    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();
    }
Exemplo n.º 11
0
 void onDestroy()
 {
     CrossPlatformInputManager.SwitchActiveInputMethod(CrossPlatformInputManager.ActiveInputMethod.Touch);
     this.m_MouseLook.SetCursorLock(false);
 }
Exemplo n.º 12
0
 // Use this for initialization
 private void Start()
 {
     m_Camera = Camera.main;
     m_MouseLook.Init(transform, m_Camera.transform);
     CrossPlatformInputManager.SwitchActiveInputMethod(CrossPlatformInputManager.ActiveInputMethod.Hardware);
 }
Exemplo n.º 13
0