コード例 #1
0
 private void DisplaySets()
 {
     CustomAudio.PlayEffect(_slideAudioFileID);
     _setP1.GetComponent <Animator> ().Play("DisplayScore01");
     _setP2.GetComponent <Animator> ().Play("DisplayScore02");
     Invoke("ChangeAllSets", 0.75f);
 }
コード例 #2
0
 private void GoBackVersusMenu()
 {
     Time.timeScale = 1.0f;
     CustomAudio.PlayEffect(MenuBipReturnAudioFileID);
     GenericHelpers.ResetGameInProgress();
     SceneManager.LoadScene("CharSelScene");
 }
コード例 #3
0
    private void ChangeAllScores()
    {
        if (ScorePlayerOne > 0 || ScorePlayerTwo > 0)
        {
            CustomAudio.PlayEffect(_pointAudioFileID);
        }

        if (ScorePlayerTwo >= 20)
        {
            _scoreP1_2.transform.position = new Vector3(_playerTwoXAxisOver20, _scoreP1_2.transform.position.y, _scoreP1_2.transform.position.z);
            _scoreP2_2.transform.position = new Vector3(-_playerTwoXAxisOver20, _scoreP2_2.transform.position.y, _scoreP2_2.transform.position.z);
        }
        else if (ScorePlayerTwo != 0)
        {
            _scoreP1_2.transform.position = new Vector3(_playerTwoXAxisUnder20, _scoreP1_2.transform.position.y, _scoreP1_2.transform.position.z);
            _scoreP2_2.transform.position = new Vector3(-_playerTwoXAxisUnder20, _scoreP2_2.transform.position.y, _scoreP2_2.transform.position.z);
        }

        if (_winnerOnNewBall == CurrentPlayer.PlayerOne)
        {
            _scoreP1_1.GetComponent <ScoreContainerBehavior> ().Stretch();
            _scoreP2_1.GetComponent <ScoreContainerBehavior> ().Stretch();
        }
        else
        {
            _scoreP1_2.GetComponent <ScoreContainerBehavior> ().Stretch();
            _scoreP2_2.GetComponent <ScoreContainerBehavior> ().Stretch();
        }

        ChangeScore(ScorePlayerOne, _scoreP1_1);
        ChangeScore(ScorePlayerTwo, _scoreP1_2);
        ChangeScore(ScorePlayerOne, _scoreP2_1);
        ChangeScore(ScorePlayerTwo, _scoreP2_2);
    }
コード例 #4
0
    private void PlayEffectSound()
    {
        switch (Effect)
        {
        case EffectType.CastSP:
            CustomAudio.PlayEffect(_gameManagerBehavior.CastSPAudioFileID);
            break;

        case EffectType.Catch:
            CustomAudio.PlayEffect(_gameManagerBehavior.CatchAudioFileID);
            break;

        case EffectType.Dash:
            CustomAudio.PlayEffect(_gameManagerBehavior.DashAudioFileID);
            break;

        case EffectType.Goal:
            CustomAudio.PlayEffect(_gameManagerBehavior.GoalAudioFileID);
            break;

        case EffectType.Lift:
            CustomAudio.PlayEffect(_gameManagerBehavior.LiftAudioFileID);
            break;

        case EffectType.QuickEffect:
        case EffectType.Super01:
            CustomAudio.PlayEffect(_gameManagerBehavior.QuickEffectAudioFileID);
            break;

        case EffectType.WallHit:
            CustomAudio.PlayEffect(_gameManagerBehavior.WallHitAudioFileID);
            break;
        }
    }
コード例 #5
0
    private void SuperAfterDelay()
    {
        var superEffectParticlesModel    = Resources.Load <GameObject> ("Prefabs/SuperEffectParticles01");
        var superEffectParticlesInstance = Instantiate(superEffectParticlesModel, superEffectParticlesModel.transform.position, superEffectParticlesModel.transform.rotation);

        if (Player == CurrentPlayer.PlayerTwo)
        {
            superEffectParticlesInstance.transform.position = new Vector3(superEffectParticlesInstance.transform.position.x, -superEffectParticlesInstance.transform.position.y, 0.0f);
            superEffectParticlesInstance.transform.Rotate(180.0f, 0.0f, 0.0f);
        }
        CustomAudio.PlayEffect(_gameManager.GetComponent <GameManagerBehavior>().ThrowAudioFileID);
        //Ball = GetBall();
        if (Ball != null && Ball.GetComponent <BallBehavior> ().IsThrownBy != CurrentPlayer.None)
        {
            return;
        }
        if (Ball != null)
        {
            GetComponent <SuperBehavior>().LaunchSuper(_directionalVector + new Vector2(_throwAngle, 0.0f), Player, Power, _directionalVector, Ball);
        }
        _throwAngle = 0;
        var tmpSpEffect = Instantiate(CastSPEffect, transform.position, transform.rotation);

        tmpSpEffect.GetComponent <SpriteRenderer> ().color = SuperColor;
    }
コード例 #6
0
 private void OnBackButtonPressed()
 {
     if (BackSceneName != string.Empty && BackSceneName != null)
     {
         SceneManager.LoadScene(BackSceneName);
         CustomAudio.PlayEffect(MenuBipReturnAudioFileID);
     }
 }
コード例 #7
0
 private void DisplayPopupNotImplemented()
 {
     _isDisplayingPopup = true;
     CustomAudio.PlayEffect(_genericMenuManagerBehavior.MenuBipReturnAudioFileID);
     _tmpPopup = Instantiate(PopupSingle, new Vector3(0.0f, 0.0f, 0.0f), PopupSingle.transform.rotation);
     GameObject.Find("PopupTitle").GetComponent <UnityEngine.UI.Text>().text = "OOPS!";
     GameObject.Find("PopupText").GetComponent <UnityEngine.UI.Text>().text  = "NOT IMPLEMENTED YET";
     GameObject.Find("Button01Background").GetComponent <GenericMenuButtonBehavior>().buttonDelegate = PopupReturn;
     GameObject.Find("PopupBackground").GetComponent <GenericMenuButtonBehavior>().buttonDelegate    = PopupReturn;
 }
コード例 #8
0
 private void GoBackTitleScreen()
 {
     Time.timeScale = 1.0f;
     CustomAudio.PlayEffect(MenuBipReturnAudioFileID);
     if (IsHowToPlay)
     {
         Destroy(GameObject.FindGameObjectWithTag("MenuBackground"));
     }
     SceneManager.LoadScene("TitleScene");
 }
コード例 #9
0
 private void DisplayPopupCheat()
 {
     _isDisplayingPopup = true;
     CustomAudio.PlayEffect(_genericMenuManagerBehavior.MenuBipReturnAudioFileID);
     _tmpPopup = Instantiate(PopupSingle, new Vector3(0.0f, 0.0f, 0.0f), PopupSingle.transform.rotation);
     GameObject.Find("PopupTitle").GetComponent <UnityEngine.UI.Text>().text = "HEHE BOY";
     GameObject.Find("PopupText").GetComponent <UnityEngine.UI.Text>().text  = "Give your meat a good old rub!";
     GameObject.Find("Button01Background").GetComponent <GenericMenuButtonBehavior>().buttonDelegate = PopupReturn;
     GameObject.Find("PopupBackground").GetComponent <GenericMenuButtonBehavior>().buttonDelegate    = PopupReturn;
 }
コード例 #10
0
 private void DisplayPopupQuit()
 {
     _isDisplayingPopup = true;
     CustomAudio.PlayEffect(_genericMenuManagerBehavior.MenuBipReturnAudioFileID);
     _tmpPopup = Instantiate(PopupYesNo, new Vector3(0.0f, 0.0f, 0.0f), PopupYesNo.transform.rotation);
     GameObject.Find("PopupTitle").GetComponent <UnityEngine.UI.Text>().text = "LEAVING GAME";
     GameObject.Find("PopupText").GetComponent <UnityEngine.UI.Text>().text  = "DO YOU WANT TO LEAVE THE GAME?";
     GameObject.Find("Button01Background").GetComponent <GenericMenuButtonBehavior>().buttonDelegate = Application.Quit;
     GameObject.Find("Button02Background").GetComponent <GenericMenuButtonBehavior>().buttonDelegate = PopupReturn;
     GameObject.Find("PopupBackground").GetComponent <GenericMenuButtonBehavior>().buttonDelegate    = PopupReturn;
 }
コード例 #11
0
 private void PopupPauseReturn()
 {
     if (StageMusic != null)
     {
         StageMusic.Play();
     }
     Time.timeScale = 1.0f;
     Destroy(_tmpPopup);
     IsPaused = false;
     CustomAudio.PlayEffect(MenuBipGoToAudioFileID);
 }
コード例 #12
0
 private void DisplayPopupEraseData()
 {
     _isDisplayingPopup = true;
     CustomAudio.PlayEffect(_genericMenuManagerBehavior.MenuBipReturnAudioFileID);
     _tmpPopup = Instantiate(PopupYesNo, new Vector3(0.0f, 0.0f, 0.0f), PopupYesNo.transform.rotation);
     GameObject.Find("PopupTitle").GetComponent <UnityEngine.UI.Text>().text = "Watchout";
     GameObject.Find("PopupText").GetComponent <UnityEngine.UI.Text>().text  = "DO YOU WANT TO ERASE YOUR PROGRESSION?";
     GameObject.Find("Button01Background").GetComponent <GenericMenuButtonBehavior>().buttonDelegate = DeletePlayerPrefsAndPopupReturn;
     GameObject.Find("Button02Background").GetComponent <GenericMenuButtonBehavior>().buttonDelegate = PopupReturn;
     GameObject.Find("PopupBackground").GetComponent <GenericMenuButtonBehavior>().buttonDelegate    = PopupReturn;
 }
コード例 #13
0
 private void DisplayName()
 {
     if (_isDuringLogo)
     {
         return;
     }
     _isDuringLogo = true;
     CustomAudio.PlayEffect(GameObject.Find("$GenericMenuManager").GetComponent <GenericMenuManagerBehavior>().NamePresentationFileID);
     _abjectPresents.SetActive(false);
     _gameName.GetComponent <SpriteRenderer> ().enabled          = true;
     _touchToStart.GetComponent <UnityEngine.UI.Text> ().enabled = true;
 }
コード例 #14
0
 private void Lift()
 {
     if (_gameManager == null)
     {
         GetGameManager();
     }
     _currentBall.GetComponent <BallBehavior> ().CatchCount = 1;
     CustomAudio.PlayEffect(_gameManager.GetComponent <GameManagerBehavior>().ThrowAudioFileID);
     _currentBall.transform.position = new Vector3(transform.position.x, transform.position.y - 0.25f, 0.0f);
     _currentBall.GetComponent <BallBehavior>().Throw(Vector2.down + new Vector2(_throwAngle, 0.0f), CurrentPlayer.PlayerTwo, _power, true);
     _throwAngle = 0;
 }
コード例 #15
0
    private void PlayButtonSound()
    {
        switch (ButtonSound)
        {
        case ButtonSoundType.MenuBipSelect:
            CustomAudio.PlayEffect(_genericMenuManager.MenuBipSelectAudioFileID);
            break;

        case ButtonSoundType.MenuBipConfirm:
            CustomAudio.PlayEffect(_genericMenuManager.MenuBipConfirmAudioFileID);
            break;
        }
    }
コード例 #16
0
 private void DisplayPopupNumbersSets()
 {
     if (_isDisplayingPopup)
     {
         return;
     }
     _isDisplayingPopupSets = true;
     CustomAudio.PlayEffect(_genericMenuManagerBehavior.MenuBipReturnAudioFileID);
     _tmpPopup = Instantiate(PopupNumbers, new Vector3(0.0f, 0.0f, 0.0f), PopupNumbers.transform.rotation);
     GameObject.Find("PopupTitle").GetComponent <UnityEngine.UI.Text>().text = "SETS";
     GameObject.Find("ButtonBackBackground").GetComponent <GenericMenuButtonBehavior>().buttonDelegate = PopupNumbersSetsReturn;
     GameObject.Find("PopupBackground").GetComponent <GenericMenuButtonBehavior>().buttonDelegate      = PopupNumbersSetsReturn;
 }
コード例 #17
0
 public void PlayTitleAnimation()
 {
     _camera.GetComponent <CameraBehavior>().WallHit();
     CustomAudio.PlayEffect(GameObject.Find("$GenericMenuManager").GetComponent <GenericMenuManagerBehavior>().BorderMovementFileID);
     _movingBackground.GetComponent <MenuBackgroundBehavior> ().PlayAudio();
     _touchToStart.SetActive(false);
     _borderTop.GetComponent <Animator> ().Play("BorderGoesUp");
     _borderBot.GetComponent <Animator> ().Play("BorderGoesDown");
     _gameName.GetComponent <Animator> ().Play("GameNameGoesUp");
     //_scanLines.GetComponent<Animator> ().Play ("FadeOut");
     _movingBackground.GetComponent <MenuBackgroundBehavior> ().ScrollSpeed = -1.0f;
     Invoke("GoToTitle", 0.5f);
 }
コード例 #18
0
 private void LiftBallAfterDelay()
 {
     CustomAudio.PlayEffect(_gameManager.GetComponent <GameManagerBehavior>().ThrowAudioFileID, 0.65f);
     //Ball = GetBall();
     if (Ball != null && Ball.GetComponent <BallBehavior> ().IsThrownBy != CurrentPlayer.None)
     {
         return;
     }
     if (Ball != null)
     {
         Ball.GetComponent <BallBehavior>().Throw(_directionalVector + new Vector2(_throwAngle, 0.0f), Player, Power, true);
     }
     _throwAngle = 0;
 }
コード例 #19
0
 private void SwitchTVON()
 {
     if (_isDuringTVON)
     {
         return;
     }
     _isDuringTVON = true;
     CustomAudio.PlayEffect(GameObject.Find("$GenericMenuManager").GetComponent <GenericMenuManagerBehavior>().SwitchTVONFileID);
     _blackBackground.SetActive(false);
     _movingBackground.GetComponent <MeshRenderer> ().enabled = true;
     _movingBackground.GetComponent <MenuBackgroundBehavior>().AdjustHorizontalToCamera();
     _movingBackground.GetComponent <MenuBackgroundBehavior> ().ScrollSpeed = 0.05f;
     Invoke("DisplayAbject", 1.0f);
 }
コード例 #20
0
    private void PlayButtonSound()
    {
        switch (ButtonSound)
        {
        case ButtonSoundType.MenuBipGoTo:
            if (_genericMenuManager != null)
            {
                CustomAudio.PlayEffect(_genericMenuManager.MenuBipGoToAudioFileID);
            }
            break;

        default:
            break;
        }
    }
コード例 #21
0
 void Update()
 {
     if (Input.GetKeyUp(KeyCode.Escape))
     {
         if (_isDisplayingPopup)
         {
             CustomAudio.PlayEffect(_genericMenuManagerBehavior.MenuBipGoToAudioFileID);
             PopupReturn();
         }
         else
         {
             DisplayPopupQuit();
         }
     }
 }
コード例 #22
0
 private void DisplayScores()
 {
     CustomAudio.PlayEffect(_slideAudioFileID);
     if (_playerOne.GetComponent <PlayerBehavior>().IsDashing)
     {
         _playerOne.GetComponent <PlayerBehavior>().EndDash();
     }
     _playerOne.GetComponent <PlayerBehavior> ().Recenter();
     if (_playerTwo != null)
     {
         if (_playerTwo.GetComponent <PlayerBehavior>().IsDashing)
         {
             _playerTwo.GetComponent <PlayerBehavior>().EndDash();
         }
         _playerTwo.GetComponent <PlayerBehavior>().Recenter();
     }
     _scoreP1.GetComponent <Animator> ().Play("DisplayScore01");
     _scoreP2.GetComponent <Animator> ().Play("DisplayScore02");
     Invoke("ChangeAllScores", 0.75f);
 }
コード例 #23
0
    private void DisplayPopupPause()
    {
        if (StageMusic != null)
        {
            StageMusic.Pause();
        }
        Time.timeScale = 0.0f;
        IsPaused       = true;
        CustomAudio.PlayEffect(MenuBipReturnAudioFileID);
        _tmpPopup = Instantiate(PopupPause, new Vector3(0.0f, 0.0f, 0.0f), PopupPause.transform.rotation);
        GameObject.Find("Button01Background").GetComponent <GenericMenuButtonBehavior>().buttonDelegate = PopupPauseReturn;
        if (IsHowToPlay)
        {
            GameObject.Find("Button02Background").GetComponent <GenericMenuButtonBehavior> ().PressSprite();
            GameObject.Find("Button02Background").transform.localScale = new Vector3(1.0f, 1.0f, 1.0f);
            GameObject.Find("Button02Background").GetComponent <BoxCollider2D> ().enabled = false;
        }
        else if (PlayerPrefs.GetInt("GameMode") == GameMode.Duel.GetHashCode())
        {
            GameObject.Find("Button02Background").GetComponent <GenericMenuButtonBehavior> ().buttonDelegate = GoBackVersusMenu;
        }
        else
        {
            GameObject.Find("Button02Text").GetComponent <UnityEngine.UI.Text>().text = "Challenges";
            GameObject.Find("Button02Background").GetComponent <GenericMenuButtonBehavior> ().buttonDelegate = GoBackChallengesMenu;
        }
        GameObject.Find("Button03Background").GetComponent <GenericMenuButtonBehavior>().buttonDelegate = GoBackTitleScreen;
        GameObject.Find("PopupBackground").GetComponent <GenericMenuButtonBehavior>().buttonDelegate    = PopupPauseReturn;
        var tmpCurrentScore = "SCORE: " + ScorePlayerOne.ToString("D2") + "/" + ScorePlayerTwo.ToString("D2");

        GameObject.Find("Score01Text").GetComponent <UnityEngine.UI.Text>().text = tmpCurrentScore;
        GameObject.Find("Score02Text").GetComponent <UnityEngine.UI.Text>().text = tmpCurrentScore;
        var tmpCurrentSets = "SETS: " + SetPlayerOne.ToString("D2") + "/" + SetPlayerTwo.ToString("D2");

        GameObject.Find("Set01Text").GetComponent <UnityEngine.UI.Text>().text = tmpCurrentSets;
        GameObject.Find("Set02Text").GetComponent <UnityEngine.UI.Text>().text = tmpCurrentSets;
    }
コード例 #24
0
 private void GoBackChallengesMenu()
 {
     Time.timeScale = 1.0f;
     CustomAudio.PlayEffect(MenuBipReturnAudioFileID);
     SceneManager.LoadScene("ChallengesMenu");
 }