Beispiel #1
0
 private void InBetweenFades()
 {
     CoroutineHelper.DelayTime(1f, StartScreenFadeOut);
     if (currentlyInCutscene)
     {
         cutsceneCamera.SetActive(false);
         cutsceneCanvas.SetActive(false);
         airBalloon.SetActive(true);
         gameCutsceneCanvas.SetActive(true);
         LevelManager.Instance.SpawnLevel();
     }
     else
     {
         airBalloon.SetActive(false);
         gameCutsceneCanvas.SetActive(false);
         cutsceneCamera.SetActive(true);
         cutsceneCanvas.SetActive(true);
         for (int i = 0; i < gameOverCanvasObjects.Count; i++)
         {
             gameOverCanvasObjects[i].SetActive(true);
         }
         airBalloon.transform.position = airBalloonStartPosition;
         FollowSpline _followSpline = airBalloon.GetComponent <FollowSpline>();
         //MoveObject _moveObject = airBalloon.GetComponent<MoveObject>();
         //_moveObject.speed = 6f;
         _followSpline.StartMoving(0, 0, 0, false);
         LevelManager.Instance.RemoveLevel();
     }
 }
Beispiel #2
0
    private bool CanPerformAction()
    {
        bool canPerformAction = UI.BeatOffset < maxBeatOffset;

        GameObject closestRythmBar = ui.GetRythmBarNextToTarget();

        if (closestRythmBar == null)
        {
            return(false);
        }

        Color originalColor = closestRythmBar.GetComponent <Image>().color;

        if (canPerformAction)
        {
            closestRythmBar.GetComponent <Image>().color = hitColor;
            combo++;
        }
        else
        {
            closestRythmBar.GetComponent <Image>().color = missColor;
            combo = 0;
        }

        CoroutineHelper.DelayTime(colorChangeTime, () =>
        {
            if (closestRythmBar == null)
            {
                return;
            }
            closestRythmBar.GetComponent <Image>().color = originalColor;
        });

        return(canPerformAction);
    }
Beispiel #3
0
    private void Initialize()
    {
        if (VRSwitch.VRState)
        {
            Color _color = sceneFadeImage.color;
            _color.a             = 0;
            sceneFadeImage.color = _color;

            CoroutineHelper.DelayTime(3, () =>
            {
                vrWarningFadeScriptedAnimationController.StartAnimation(ScriptedAnimationType.Out, SwitchSceneFromVRWarning);
            });
        }
        else
        {
            foreach (Image _image in vrWarningImages)
            {
                Color _color = _image.color;
                _color.a     = 0;
                _image.color = _color;
            }
            SceneLoader.Instance.LoadStartScene();
        }

        VRSwitch.SwitchedEvent -= Initialize;
    }
    private void Awake()
    {
        AnimatorClipInfo[] _animatorClipInfos = animator.GetCurrentAnimatorClipInfo(0);
        float _animationLength = _animatorClipInfos[0].clip.length;

        CoroutineHelper.DelayTime(_animationLength, () => {
            if (CompletedEvent != null)
            {
                CompletedEvent();
            }
            Destroy(gameObject);
        });
    }
Beispiel #5
0
    /// <summary>
    /// Switches to a random song in the songlist for the current scene.
    /// </summary>
    public void SwitchSong()
    {
        if (songs.Count == 0)
        {
            return;
        }

        Song _randomSong = RandomSong();

        if (_randomSong == null)
        {
            return;
        }

        GivePriority();

        StartCoroutine(FadeToNewSong(_randomSong));

        float _delay = _randomSong.Clip.length;

        DelayCoroutineCheck();

        delayCoroutine = CoroutineHelper.DelayTime(_delay, () => SwitchSong());
    }