Inheritance: MonoBehaviour
Ejemplo n.º 1
0
        private void FixedUpdate()
        {
            barPosition = (WhiteSize / 2) * (GameplayControllerV2.Instance.GaugePoint / 100);
            StartingPanel.SetActive(GameplayControllerV2.Instance.GameState == 0);
            Initialize();
            if (GameplayControllerV2.Instance.GameState == 1 && !GameplayControllerV2.Instance.GameMoveRequest[1])
            {
                PlayingPanel.SetActive(true);
                UpdateTexts();
                if (GameplayControllerV2.Instance.JudgingScore)
                {
                    barAnimator.GetComponent <Animator>().SetInteger("state", GameplayControllerV2.Instance.ScoreType + 1);
                    sound.PlayOneShot(soundClips[GameplayControllerV2.Instance.ScoreType]);
                    print("Played Sound!");
                }
                else
                {
                    barAnimator.GetComponent <Animator>().SetInteger("state", 0);
                }
            }
            else
            {
                PlayingPanel.SetActive(false);
            }
            EndPanel.SetActive(GameplayControllerV2.Instance.GameState == 2);

            Color _alpha = penaltyAlpha.color;

            _alpha.a           = GameplayControllerV2.Instance.alphaValue;
            penaltyAlpha.color = _alpha;
        }
    // Use this for initialization
    void Start()
    {
        scream    = Resources.Load <AudioClip>("scream");
        breathing = Resources.Load <AudioClip>("rampBreathing2");
        originalAmbientIntensity = RenderSettings.ambientIntensity;

        modalPanel = ModalPanel.Instance();
        endPanel   = EndPanel.Instance();
    }
    // Use this for initialization
    void Start()
    {
        scream = Resources.Load<AudioClip>("scream");
        breathing = Resources.Load<AudioClip>("rampBreathing2");
        originalAmbientIntensity = RenderSettings.ambientIntensity;

        modalPanel = ModalPanel.Instance();
        endPanel = EndPanel.Instance();
    }
Ejemplo n.º 4
0
    public static EndPanel Instance()
    {
        if (!endPanel)
        {
            endPanel = FindObjectOfType(typeof(EndPanel)) as EndPanel;
            if (!endPanel)
                Debug.LogError("There needs to be one active EndPanel script on a GameObject in your scene.");
        }

        return endPanel;
    }
Ejemplo n.º 5
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (CodeBreakerDificulty.Text != "Dificulty")
     {
         Dificulty2    = CodeBreakerDificulty.Text;
         ChalengeMode2 = checkBox1.Checked.ToString();
         Reset();
         ScreenReset();
         ResetPanel.SendToBack();
         EndPanel.SendToBack();
     }
 }
Ejemplo n.º 6
0
    public static EndPanel Instance()
    {
        if (!endPanel)
        {
            endPanel = FindObjectOfType(typeof(EndPanel)) as EndPanel;
            if (!endPanel)
            {
                Debug.LogError("There needs to be one active EndPanel script on a GameObject in your scene.");
            }
        }

        return(endPanel);
    }
Ejemplo n.º 7
0
 // Use this for initialization
 void Awake()
 {
     modalPanel         = ModalPanel.Instance();
     endPanel           = EndPanel.Instance();
     lampOnSound        = Resources.Load <AudioClip>("lampOn");
     lampOffSound       = Resources.Load <AudioClip>("lampOff");
     doorLockedSound    = Resources.Load <AudioClip>("doorLocked");
     itemPickupSound    = Resources.Load <AudioClip>("itemPickup");
     keyPickupSound     = Resources.Load <AudioClip>("keyPickup1");
     knifePickupSound   = Resources.Load <AudioClip>("knifePickup1");
     singleBreathSound1 = Resources.Load <AudioClip>("singleBreath1");
     singleBreathSound2 = Resources.Load <AudioClip>("singleBreath2");
 }
Ejemplo n.º 8
0
 // Use this for initialization
 void Awake()
 {
     modalPanel = ModalPanel.Instance();
     endPanel = EndPanel.Instance();
     lampOnSound = Resources.Load<AudioClip>("lampOn");
     lampOffSound = Resources.Load<AudioClip>("lampOff");
     doorLockedSound = Resources.Load<AudioClip>("doorLocked");
     itemPickupSound = Resources.Load<AudioClip>("itemPickup");
     keyPickupSound = Resources.Load<AudioClip>("keyPickup1");
     knifePickupSound = Resources.Load<AudioClip>("knifePickup1");
     singleBreathSound1 = Resources.Load<AudioClip>("singleBreath1");
     singleBreathSound2 = Resources.Load<AudioClip>("singleBreath2");
 }
Ejemplo n.º 9
0
    public void ShowEndPanel(bool won, string endMessage)
    {
        dramaOutcomePanel.SetActive(false);
        dramaMovePanel.SetActive(false);
        dramaChoicePanel.SetActive(false);
        shipPanel.SetActive(false);

        endPanel.SetActive(true);

        EndPanel endPanelScript = endPanel.GetComponent <EndPanel>();

        endPanelScript.SetCauseText(endMessage);
        endPanelScript.SetStatusText(won ? "SUCCESS !!!" : "Game Over....");
    }
Ejemplo n.º 10
0
        private void Update()
        {
            if (IsStarted && !Paused)
            {
                Dispensor.UpdateNote(Frame);
                Frame      += 60 * Time.deltaTime * FrameSpeed;
                FrameFixed += 60 * Time.deltaTime;
                if (IsPlaying)
                {
                    SongTime += 1 * Time.deltaTime;
                }
            }
            else if (!IsStarted && !HasError && (!BGA.isCustom || (BGA.isCustom && BGA.readyToPlay)))
            {
                StartPanel.SetActive(true);
                StartCount         += 1 * Time.deltaTime;
                StartCountText.text = Mathf.Ceil(3 - StartCount).ToString();
#if UNITY_ANDROID
                if (Social.localUser.authenticated)
                {
                    PlayGamesPlatform.Instance.ReportProgress(GPGSIds.achievement_your_first_step, 100.0f, null);
                }
#elif UNITY_IOS
                Achievementer.ReportProgress("YourFirstStep");
#endif
                if (StartCount >= 3f)
                {
                    PauseButton.interactable = true;
                    DataContainer.SetNoteCount(Dispensor.VisibleNoteCount);
                    IsStarted = true;
                    BGA.ResumeBGA();
                    BGA.SetStartFrame();
                    StartPanel.SetActive(false);
                }
            }
            if (IsEnded)
            {
                PauseButton.interactable = false;
                EndCount += 1 * Time.deltaTime;
                if (EndCount >= 3 && !EndPanel.activeSelf)
                {
                    EndPanel.SetActive(true);
                }
                if (EndCount >= 6)
                {
                    DataSender.SetGameResult(DataContainer);
                    SceneAnimate.Play("6LineCvFadeOut");
                    Screen.sleepTimeout = SleepTimeout.SystemSetting;
                    if (ScreenAdjusted)
                    {
                        Screen.SetResolution(PreservedWidth, PreservedHeight, Screen.fullScreen);
                    }
                    if (Mode.Equals(GameMode.Theater2P))
                    {
                        if (Application.platform.Equals(RuntimePlatform.Android) || Application.platform.Equals(RuntimePlatform.IPhonePlayer))
                        {
                            Screen.orientation = ScreenOrientation.Landscape;
                            Screen.orientation = ScreenOrientation.AutoRotation;
                        }
                        else if (Application.platform.Equals(RuntimePlatform.WindowsPlayer))
                        {
                            Screen.SetResolution(PreservedWidth, PreservedHeight, Screen.fullScreen);
                        }
                    }
                    changer.ChangeToScene("GameResult", 0.5f);
                }
            }
            if (IsEnded && DataContainer.GetMaxCombo() >= Dispensor.VisibleNoteCount && !FCFlag)
            {
                StartCoroutine(FullComboShow());
                FCFlag = true;
            }
        }
Ejemplo n.º 11
0
 private void Awake()
 {
     _endPanel    = FindObjectOfType <EndPanel>();
     _progressBar = FindObjectOfType <ProgressBar>();
 }
Ejemplo n.º 12
0
 private void EndGameWin()
 {
     EndText.Text = "You Win!!!!";
     EndPanel.BringToFront();
 }
Ejemplo n.º 13
0
 private void EndGameLose()
 {
     EndText.Text = "Out of Tires :(";
     EndPanel.BringToFront();
 }
Ejemplo n.º 14
0
    // Update is called once per frame
    void Update()
    {
        // Sound
        SoundManager.instance.ToggleSoundOnorOff();

        ScoreValue.text = "Score: " + scoreAmount.ToString();
        ROMLAmount.text = (ROMLSlider.value * 5.0f).ToString() + "°";
        ROMRAmount.text = (ROMRSlider.value * 5.0f).ToString() + "°";
        //RepsAmount.text = (int)(RepsSlider.value / 3) + " full reps + " + (RepsSlider.value % 3);
        RepsAmount.text         = (int)(RepsSlider.value / 1) + " puck saves (i.e. reps)";
        SetsAmount.text         = SetsSlider.value.ToString();
        RecoveryTimeAmount.text = RecoveryTimeSlider.value.ToString() + " seconds";
        WeighingAmount.text     = WeighingSlider.value.ToString();


        // Save Slider values
        PlayerPrefs.SetFloat("ROMLSlider", ROMLSlider.value);
        PlayerPrefs.SetFloat("ROMRSlider", ROMRSlider.value);
        PlayerPrefs.SetFloat("RepsSlider", RepsSlider.value);
        PlayerPrefs.SetFloat("SetsSlider", SetsSlider.value);
        PlayerPrefs.SetFloat("RecoveryTimeSlider", RecoveryTimeSlider.value);
        PlayerPrefs.SetFloat("WeighingSlider", WeighingSlider.value);
        PlayerPrefs.SetFloat("MaxTimeToTargetSlider", MaxTimeToTargetSlider.value);

        if (SoundToggle.isOn == true)
        {
            PlayerPrefs.SetInt("SoundToggleValue", 1);
        }
        else
        {
            PlayerPrefs.SetInt("SoundToggleValue", 0);
        }

        if (MapToFullROM.isOn == true)
        {
            PlayerPrefs.SetInt("MapToFullROM", 1);
        }
        else
        {
            PlayerPrefs.SetInt("MapToFullROM", 0);
        }



        if (MaxTimeToTargetSlider.value < 20.0f)
        {
            MaxTimeToTargetAmount.fontSize = 16;
            MaxTimeToTargetAmount.text     = MaxTimeToTargetSlider.value.ToString();
        }
        else
        {
            MaxTimeToTargetAmount.fontSize = 24;
            MaxTimeToTargetAmount.text     = "∞";
        }

        // End panel appears
        if ((scoreAmount) >= RepsSlider.value && setAmount == (SetsSlider.value - 1))
        {
            StopLoggingWorkoutTime();

            SoundManager.instance.PlaySingle(GameControl.instance.buzzerAudio, 0.8f);

            EndPanel.SetActive(true);
            EndPanelText.text = "Congratulations!\nMatch practice ís complete for today!";

            // Update statistics
            totalSaves                 = totalSaves + scoreAmount;
            goalsSavedEndText.text     = totalSaves.ToString();
            shotsOnGoalEndText.text    = shotsOnGoal.ToString();
            savePercentage             = 100.0f * (float)totalSaves / (float)shotsOnGoal;
            savePercentageEndText.text = savePercentage.ToString("F0") + " %";

            Target.SetActive(false);

            if (WeighingSlider.value == 2)
            {
                Target2.SetActive(false);
            }

            /*
             * if (PlayerPrefs.GetInt("2PuckShooter") == 1)
             *  Target2.SetActive(false);
             */

            scoreAmount = 0;
            setAmount   = 0;
        }

        // Break panel appears if reps are max and it wasn't the last set
        if ((scoreAmount) >= RepsSlider.value && setAmount != SetsSlider.value)
        {
            StopLoggingWorkoutTime();
            StartLoggingRestTime();

            SoundManager.instance.PlaySingle(GameControl.instance.buzzerAudio, 0.8f);

            breakTimeAmount = RecoveryTimeSlider.value;
            setAmount++;
            BreakPanel.SetActive(true);

            Target.SetActive(false);
            if (WeighingSlider.value == 2)
            {
                Target2.SetActive(false);
            }

            /*
             * if (PlayerPrefs.GetInt("2PuckShooter") == 1)
             *  Target2.SetActive(false);
             */

            continued = false;
            StartCoroutine(BreakTimer());
            scoreAmount = 0;
        }

        if (WeighingSlider.value == -1)
        {
            WeighingAmount.text = "Left arm ONLY";
        }
        if (WeighingSlider.value == 1)
        {
            WeighingAmount.text = "Right arm ONLY";
        }
        if (WeighingSlider.value == 0)
        {
            WeighingAmount.text = "Both arms (1 arm at a time)";
        }
        if (WeighingSlider.value == 2)
        {
            WeighingAmount.text = "Both arms (at same time)";

            /*
             * ROMRSlider.interactable = false;
             * ROMRAmount.text = "";
             *
             * Color titlecolor = ROMRTitle.color;
             * titlecolor.a = 0.20f;
             * ROMRTitle.color = titlecolor;
             */
        }



        //GameControl.instance.completedRepsLeft = scoreRight;            // Note: Arms are mirrored
        //GameControl.instance.completedRepsRight = scoreLeft;
    }
Ejemplo n.º 15
0
 public void NextButtonClicked()
 {
     EndPanel.SetActive(true);
     gameObject.SetActive(false);
 }
Ejemplo n.º 16
0
    //public bool coroutineEnable = false;

    private void Awake()
    {
        _endPanel  = FindObjectOfType <EndPanel>();
        _healthBar = FindObjectOfType <HealthBar>();
    }