private IEnumerator HideInGameMessageSequence()
    {
        messageAnimation.Play("BossHealthRemainingHide");
        yield return(WaitCache.WaitForSeconds(1.0f));

        _messageBox.SetActive(false);
    }
Esempio n. 2
0
    protected override IEnumerator DestroyBrickSequence(bool playSound = true)
    {
        BrickHasBeenDestroyed = true;
        StartItemFallingFromDestroyedBrick();

        // based on the boss starting health, award points
        var pointsForBoss = Points.BossPointsValue * resetHitsToDestroyCount;

        CoreConnector.GameManager.scoreManager.PointsCollected(pointsForBoss);
        SpawnParticles(ParticleTypes.BossExplosion, transform.position);

        if (playSound)
        {
            PlaySound(SoundList.brickDestroyed);
        }

        yield return(0);

        DisableColliders();

        LeanTween.cancel(visualObjects.gameObject);
        LeanTween.scale(visualObjects.gameObject, Vector3.one * 0.1f, 0.35f);
        yield return(WaitCache.WaitForSeconds(0.35f));

        DisableVisuals();
        HideGooglyEyes();
        CoreConnector.GameManager.brickManager.BrickDestroyed();
    }
Esempio n. 3
0
 /// <summary>
 /// 数据缓存初始化
 /// </summary>
 static Loader()
 {
     if (sqlTable != null)
     {
         Cache = WaitCache.Set(sqlCache);
         sqlLoaded();
     }
 }
Esempio n. 4
0
    private IEnumerator ShowMessageSequence()
    {
        messageAnimation.Play(Show);

        yield return(WaitCache.WaitForSeconds(3.0f));

        // todo possibly add extra effects during the message

        messageAnimation.Play(Hide);

        yield return(WaitCache.WaitForSeconds(1.0f));

        // Enforce disabled.
        HideInGameMessageInstantly();
    }
Esempio n. 5
0
    private IEnumerator InstantiateNewBall()
    {
        ballStartPosition.y = GameVariables.BallStartHeight;
        ballStartPosition.x = 0;
        SpawnParticles(ParticleTypes.NewBallOne, ballStartPosition);

        // wait a little while
        yield return(WaitCache.WaitForSeconds(0.4f));

        AddBall(0);

        yield return(WaitCache.WaitForSeconds(0.5f));

        LaunchAllBalls();
    }
Esempio n. 6
0
    private IEnumerator AllLettersCollected()
    {
        ShowInGameMessage(Message.BonusPoints);
        PlaySound(SoundList.AllBONUSLettersCollected);

        CoreConnector.GameManager.scoreManager.PointsCollected(Points.AllLettersOfBONUSCollectedPoints);
        // now we need to reset the objects for it to start over again

        yield return(WaitCache.WaitForSeconds(0.5f));

        foreach (var letterAnimator in letterAnimators)
        {
            letterAnimator.PlayCollected();
        }

        yield return(WaitCache.WaitForSeconds(1.5f));

        ResetFallingObjectsAvailable();
    }
Esempio n. 7
0
    private IEnumerator InstantiateMultiBalls(float xPosition)
    {
        ballStartPosition.y = GameVariables.BallStartHeight;

        ballStartPosition.x = xPosition;
        SpawnParticles(ParticleTypes.NewBallOne, ballStartPosition);

        ballStartPosition.x = -xPosition;
        SpawnParticles(ParticleTypes.NewBallTwo, ballStartPosition);

        yield return(WaitCache.WaitForSeconds(0.5f));

        // add ball 1 & 2
        AddBall(xPosition);
        AddBall(-xPosition);

        yield return(WaitCache.WaitForSeconds(0.5f));

        LaunchAllBalls();
    }
Esempio n. 8
0
    private IEnumerator StartGameSequence()
    {
        ballManager.ResetAllBalls();
        playersBatManager.HideAllBats();
        Time.timeScale = 1.0f;
        CoreConnector.UIManager.DisplayLevelLoader();

        var levelNumber = PlayerPrefs.GetInt(Constants.CurrentLevel);

        CoreConnector.GameUIManager.playerLifeDisplay.Show();
        CoreConnector.LevelManager.DisplayLevel(levelNumber);

        yield return(WaitCache.WaitForSeconds(0.1f));

        brickManager.LoadLevelsBricks();
        yield return(WaitCache.WaitForSeconds(0.1f));

        backgrounds.DisplayForLevel(levelNumber);
        yield return(WaitCache.WaitForSeconds(0.1f));

        fallingObjectsManager.HideAll();
        yield return(WaitCache.WaitForSeconds(0.1f));

        CoreConnector.UIManager.HideAllScreens();

        yield return(WaitCache.WaitForSeconds(0.1f));

        CoreConnector.UIManager.DisplayScreen(UIScreens.Game);
        CoreConnector.GameUIManager.DisplayInGameButtons(true);
        bonusManager.RestartGame();
        playerLifeManager.RestartLevel();
        yield return(WaitCache.WaitForSeconds(0.1f));

        touchPosition.ResumeGame();
        StartPlay(0.25f);
    }
Esempio n. 9
0
    private IEnumerator StartSequence()
    {
        DisableVisuals();
        SetAlpha(0.0f);
        LeanTween.cancel(visualObjects.gameObject);
        yield return(WaitCache.WaitForSeconds(0.5f));

        var randomScale = Random.Range(0.2f, 2.0f);

        SetVisualScale(randomScale);
        EnableVisuals();

        // scale the brick up from tiny.

        targetScale = 1.0f;

        var timeToTake = Random.Range(0.3f, 0.5f);

        LeanTween.value(0.0f, 1.0f, timeToTake).setOnUpdate(SetPercent)
        .setEase(LeanTweenType.easeOutBack)
        .setDelay(delayCounter);

        yield return(WaitCache.WaitForSeconds(timeToTake));
    }
Esempio n. 10
0
 private void Awake()
 {
     _waitCache = this;
     Debug.Log("WaitCache.Awake()\n");
     cache = new Dictionary <string, YieldInstruction>();
 }