コード例 #1
0
 private void Update()
 {
     if (Input.anyKey || JoyConInputManager.GetJoyConAnykeyDown())
     {
         Utility.MoveNextScene();
     }
 }
コード例 #2
0
    private void Update()
    {
        #region Debug
        if (Input.GetKeyDown(KeyCode.F1))
        {
            Utility.ReloadCurrentScene();
        }
        #endregion

        if (playerScore == playerScoreMax && rivalScore == rivalScoreMax)
        {
            resultText.gameObject.SetActive(true);

            // Go next scene
            if (JoyConInputManager.GetJoyConAnykeyDown() || Input.anyKeyDown)
            {
                async.allowSceneActivation = true;
                Resources.UnloadUnusedAssets();
                System.GC.Collect();
            }
            return;
        }

        if (timer >= calcTimeInterval)
        {
            timer = 0.0f;

            // Main process
            float playerScoreAdd = calcStep + UnityEngine.Random.Range(0, calcStepVariety);
            float rivalScoreAdd  = calcStep + UnityEngine.Random.Range(0, calcStepVariety);
            UpdateScore(ref playerScore, ref playerScoreAdd, playerScoreMax);
            UpdateScore(ref rivalScore, ref rivalScoreAdd, rivalScoreMax);
            ProcessScoreBar(playerScoreAdd, rivalScoreAdd);
            ProcessScoreText();
        }
        else
        {
            timer += Time.deltaTime;
        }
    }
コード例 #3
0
 private void Update()
 {
     if (isTutorial)
     {
         if (!isBridgeTut)
         {
             if (JoyConInputManager.GetJoyConButtonDown(readyJoyConButton) ||
                 Input.GetButtonDown(readyKeyboardButton))
             {
                 AudioManager.Instance.Play("ZRTouch");
                 isBridgeTut = true;
                 MarathonTutUIController.Instace.ChangeToBridgeUI();
             }
         }
         else
         {
             if (JoyConInputManager.GetJoyConButtonDown(readyJoyConButton) ||
                 Input.GetButtonDown(readyKeyboardButton))
             {
                 AudioManager.Instance.Play("ZRTouch");
                 async.allowSceneActivation = true;
                 Resources.UnloadUnusedAssets();
                 System.GC.Collect();
             }
         }
     }
     else
     {
         if (MarathonScoreController.Instance.IsFinishedResultTimeline)
         {
             if (Input.anyKeyDown || JoyConInputManager.GetJoyConAnykeyDown())
             {
                 AudioManager.Instance.Play("ZRTouch");
                 async.allowSceneActivation = true;
                 Resources.UnloadUnusedAssets();
                 System.GC.Collect();
             }
         }
     }
 }
コード例 #4
0
 private void Playing()
 {
     if (IsPlaying)
     {
         titleManager.GetComponent <CutSceneManager>().SetInputState(false);
         Timer = 0.0f;
         if (JoyConInputManager.GetJoyConAnykeyDown() || Input.anyKeyDown)
         {
             IsPlaying = false;
             titleManager.GetComponent <CutSceneManager>().SetInputState(true);
         }
         if (PlayTime != 0.0f)
         {
             if (Demovideo.time > PlayTime)
             {
                 IsPlaying = false;
                 titleManager.GetComponent <CutSceneManager>().SetInputState(true);
             }
         }
         else
         {
             if (Demovideo.time >= Demovideo.length)
             {
                 IsPlaying = false;
                 titleManager.GetComponent <CutSceneManager>().SetInputState(true);
             }
         }
     }
     else
     {
         Timer += Time.deltaTime;
         if (Timer >= WaitTime)
         {
             ShouldPlay = true;
         }
         Stop();
     }
 }
コード例 #5
0
 private void HandleInput()
 {
     #region TimelineProcess
     if (JoyConInputManager.GetJoyConAnykeyDown() || Input.anyKeyDown)
     {
         zrSoundEffect.Play();
         canInput = false;
         if (!IsPlaying)
         {
             IsPlaying = true;
             director.Play();
         }
         else
         {
             if (director.time == director.playableAsset.duration)
             {
                 async.allowSceneActivation = true;
                 Resources.UnloadUnusedAssets();
                 System.GC.Collect();
             }
             else
             {
                 var nextTime = director.time + director.playableAsset.duration / jumpTime;
                 if (nextTime > director.playableAsset.duration)
                 {
                     director.time = director.playableAsset.duration;
                 }
                 else
                 {
                     director.time += director.playableAsset.duration / jumpTime;
                 }
             }
         }
     }
     #endregion
 }
コード例 #6
0
    private void Update()
    {
        #region Development
        if (Input.GetKeyDown(KeyCode.F1))
        {
            Utility.ReloadCurrentScene();
        }

        if (Input.GetKeyDown(KeyCode.F2))
        {
            Utility.MoveNextScene();
        }
        #endregion

        if (isTutorial)
        {
            var isUsedJoyCon = HandlePlayerJoyConInput();
            if (!isUsedJoyCon)
            {
                HandlePlayerKeyboardInput();
            }
            if (JoyConInputManager.GetJoyConButtonDown(readyJoyConButton) ||
                Input.GetButtonDown(readyKeyboardButton))
            {
                AudioManager.Instance.Play("ZRTouch");
                async.allowSceneActivation = true;
            }

            return;
        }

        switch (PresentGameState)
        {
        case GameStatus.Standby:
            break;

        case GameStatus.Playing:
            if (GameTime > gameTimeLimit)
            {
                GameTime = 0.0f;
                PrepareData();
                OnGameFinished?.Invoke();
                playableDirector.Play(gameEndTimelineAssert);
                AudioManager.Instance.Stop("TimeHint");
                AudioManager.Instance.Stop("BalloonReady");
                AudioManager.Instance.Play("SceneEnd");
                playerJoyConInputSpeed   = 0.0f;
                playerKeyboardInputSpeed = 0.0f;
                PresentGameState         = GameStatus.End;
            }
            else
            {
                GameTime += Time.deltaTime;
                var timeLeft = gameTimeLimit - GameTime;

                gameInfoText.text = "Time left: " + Mathf.RoundToInt(timeLeft) + "s";
            }

            var isUsedJoyCon = HandlePlayerJoyConInput();
            if (!isUsedJoyCon)
            {
                HandlePlayerKeyboardInput();
            }
            HandleRivalBehaviour();
            ProcessAI();
            break;

        case GameStatus.End:
            if (BalloonGameResultUIController.Instance.IsScoreCalcFinished)
            {
                if (JoyConInputManager.GetJoyConAnykeyDown() || Input.anyKeyDown)
                {
                    AudioManager.Instance.Play("ZRTouch");
                    async.allowSceneActivation = true;
                    Resources.UnloadUnusedAssets();
                    System.GC.Collect();
                }
            }
            break;

        default:
            break;
        }
    }