Exemplo n.º 1
0
    private IEnumerator DelayBeforeActive(bool active, float timer, bool isMatchOver, string winnerName, GameState nextState)
    {
        m_DelayManager.AddDelay(float.MaxValue);
        PlayerSpawner.instance.FlushAlivePlayerInputs();
        yield return(new WaitForSeconds(timer));

        SwitchBGM();
        m_RoundPanel.SetActive(active);
        DisplayPlayers(isMatchOver, winnerName);
        GameManager.instance.SetGameState(nextState);
        m_DelayManager.Reset();
        m_DelayManager.AddDelay(Database.instance.LongMenuInputDelay);
        SoundManager.PlaySFX(MenuOpen);
        UpdateBoolAnimator("GoDown", true);
    }
Exemplo n.º 2
0
 private void DartOnDartDestroyed(object sender, EventArgs eventArgs)
 {
     _currentDartShot = null;
     _delayManager.SetDelay(0);
     _delayManager.AddDelay(Settings._shootDelay);
     CoolDownEffects();
     if (m_SappingAudioSource != null && m_SappingAudioSource.isPlaying)
     {
         m_SappingAudioSource.Stop();
     }
     if (m_FireSound.isPlaying)
     {
         m_FireSound.Stop();
     }
     SoundManager.PlaySFX(WireSnapping);
 }
Exemplo n.º 3
0
    public void FlushAlivePlayerInputs()
    {
        foreach (GameObject pg in m_Players)
        {
            if (pg != null)
            {
                IPlatformer2DUserControl controls = pg.GetComponent <IPlatformer2DUserControl>();
                if (controls != null)
                {
                    controls.FlushInputs();
                }

                PlatformerCharacter2D charac = pg.GetComponent <PlatformerCharacter2D>();
                if (charac != null)
                {
                    charac.FlushAnimState();
                }

                DelayManager dm = pg.GetComponent <DelayManager>();
                if (dm != null)
                {
                    dm.AddDelay(Database.instance.MenuInputDelay);
                    dm.AddShieldDelay(Database.instance.MenuInputDelay);
                }
            }
        }
    }
Exemplo n.º 4
0
 private void EnterScreens()
 {
     SetDisplay();
     _loadingState = LoadingState.Enter;
     _animator.SetInteger("Target", UnityEngine.Random.Range(1, 4));
     _delayManager.AddDelay(_minimumLoadTime);
     _displayLoading = true;
     StartCoroutine(ChangeLoadingText());
 }
Exemplo n.º 5
0
    private void ConfirmSelection()
    {
        switch (m_CurrentSelectionState)
        {
        case SelectionState.Selection:
            if (!Database.instance.ListofSponsors[m_SponsorSelection].isTaken)
            {
                SoundManager.PlaySFX(Database.instance.MenuClickName);
                m_CurrentSelectionState = SetStateAndTexts(true);
                //sponsor
                m_Player.PlayerSponsor = Database.instance.ListofSponsors[m_SponsorSelection];
                Database.instance.ListofSponsors[m_SponsorSelection].TakeSponsor();
                OnSponsorTaken(new SponsorTakenEventArgs {
                    Sender = this, SponsorTaken = Database.instance.ListofSponsors[m_SponsorSelection], Status = SponsorStatus.Taken
                });
            }
            else
            {
                SoundManager.PlaySFX(Database.instance.MenuErrorName);
            }

            break;

        case SelectionState.Confirmation:

            //ability
            m_Player.PlayerAbility  = Database.instance.ListofAbilities[m_AbilitySelection].AbilityEnum;
            m_CurrentSelectionState = SetStateAndTexts(true);
            m_ParentMenu.ReadyUp(true);
            m_ConfirmedOverlay.SetActive(true);

            SoundManager.PlaySFX(Database.instance.MenuClickName);

            CheckReady();
            break;
        }
        m_DelayManager.AddDelay(Database.instance.MenuInputDelay);
    }
Exemplo n.º 6
0
    private bool StartAnimatedSwing()
    {
        _SwingReset = false;
        _feedBack.SetBool();
        _hasPlayedSheath = false;
        _delayManager.AddDelay(10000);
        if (!_collider.enabled)
        {
            _collider.enabled = true;
        }
        _isAerial = !_mouvementManager.IsGrounded;
        string animationToUse = "Grounded";

        if (isAbility)
        {
            _mouvementManager.ChangeCanFlip();

            if (_isAerial)
            {
                _sound         = SoundManager.PlaySFX(AbilityAerial);
                animationToUse = "Air";
                m_animator.SetBool(animationToUse, true);
            }
            else
            {
                _sound = SoundManager.PlaySFX(Swipe);
                m_animator.SetBool(animationToUse, true);
            }
        }
        else
        {
            _sound = SoundManager.PlaySFX(Swipe);
            m_animator.SetBool(animationToUse, true);
        }
        StartCoroutine(ResetBoolNextFrame(animationToUse, false));
        //StartTrail();
        return(true);
    }