Esempio n. 1
0
        private void Update()
        {
            movementZ = InputSplitter.GetVerticalAxis(PlayerID);
            movementX = InputSplitter.GetHorizontalAxis(PlayerID);
            if (InputSplitter.GetSlidePressed(PlayerID))
            {
                shouldSlide = true;
            }

            if (InputSplitter.GetJumpPressed(PlayerID))
            {
                shouldJump = true;
            }
        }
Esempio n. 2
0
 internal void Update()
 {
     if (Enabled)
     {
         if (currentLocation + 1 != Locations.Length)
         {
             ApplyCameraLerp();
         }
         if (!runClose && currentLocation + 1 == Locations.Length)
         {
             fadeController.KillPlayer();
             runClose = true;
         }
         if (runClose)
         {
             if (fadeController.FadeoutAlpha > 0.99f)
             {
                 IntroDialog.Stop();
                 this.gameObject.camera.enabled = false;
                 foreach (GameObject cameraObj in playerCameras)
                 {
                     cameraObj.camera.enabled = true;
                 }
                 playerOneLifeHander.BlackToClear();
                 playerTwoLifeHander.BlackToClear();
                 //fadeController.enabled = false;
             }
             if (playerOneLifeHander.FadeoutAlpha > 0.99f && playerTwoLifeHander.FadeoutAlpha > 0.99f && !CountDownTimer.IsActive)
             {
                 CountDownTimer.IsActive = true;
             }
             else if (playerOneLifeHander.FadeoutAlpha < 0.05f && playerTwoLifeHander.FadeoutAlpha < 0.05f && CountDownTimer.Finished)
             {
                 EnablePlayerMode();
             }
         }
         for (int i = 0; i < PopUpMessageStart.Length; ++i)
         {
             if (currentLocation == PopUpMessageStart[i])
             {
                 if (popUpMessageCanvas[i].alpha < 1.0f)
                 {
                     popUpMessageCanvas[i].alpha += Time.deltaTime * 1;
                 }
             }
         }
         for (int i = 0; i < PopUpMessageEnd.Length; ++i)
         {
             if (currentLocation == PopUpMessageEnd[i])
             {
                 if (popUpMessageCanvas[i].alpha > 0.0f)
                 {
                     popUpMessageCanvas[i].alpha -= Time.deltaTime * 1;
                 }
             }
         }
     }
     if (Enabled && !runClose && (InputSplitter.GetJumpPressed(0) || InputSplitter.GetJumpPressed(1)))
     {
         fadeController.KillPlayer();
         runClose = true;
     }
 }