Beispiel #1
0
    public void EnterResolveMode()
    {
        inResolveMode = true;
        //helpSwipe.SetActive(false);
        gameObject.GetComponent <UnityEngine.PostProcessing.PostProcessingBehaviour>().enabled = true;

        if (refinePanel != null)
        {
            string txt        = refinePanel.GetComponent <UnityEngine.UI.Text>().text;
            int    percentIdx = txt.IndexOf('%');
            string subTxt     = txt.Substring(percentIdx - 5, 5);
            string accuracy   = "00.00";
            string newTxt     = txt.Replace(subTxt, accuracy);
            refinePanel.GetComponent <UnityEngine.UI.Text>().text = newTxt;
            refinePanel.SetActive(true);
        }

        currentEvents.scaleArray(0.149815f);
    }
    public void StopGame()
    {
        isGame = false;
        isSoft = false;

        swipedTop   = false;
        swipedFront = false;
        swipedSide  = false;

        /*if(startButton != null)
         * {
         *  startButton.SetActive(true);
         * }*/

        if (highScorePanel != null)
        {
            if (swipeRecognizer.GetComponent <SwipeRecognizer>().neutrinoScore > highScore)
            {
                string scoreTxt = "High Score: " + swipeRecognizer.GetComponent <SwipeRecognizer>().neutrinoScore.ToString() + " Points";
                highScorePanel.GetComponent <UnityEngine.UI.Text>().text = scoreTxt;
                Debug.Log("new high score");
            }
            else
            {
                highScorePanel.GetComponent <UnityEngine.UI.Text>().text = "High Score: " + highScore + " Points";
            }
        }

        if (eventPlayer != null)
        {
            //eventPlayer.GetComponent<EventPlayer>().PlayTutorialEvent();
            eventPlayer.GetComponent <EventPlayer>().StopCurrentEvent();
            eventPlayer.ResumePlaying();
            eventPlayer.scaleArray(3f);
        }

        if (mainCamera != null)
        {
            mainCamera.GetComponent <CameraRotate>().spin = false;
        }

        /*if (tutorial != null)
         * {
         *  tutorial.GetComponent<Tutorial>().playTutorial = true;
         * }*/

        if (swipeRecognizer != null)
        {
            swipeRecognizer.ExitResolveMode(false);
        }

        softTutorialText.GetComponent <UnityEngine.UI.Text>().text = "Let's do one for practice.";

        AudioSource[] aSources = GameObject.Find("Sound Effects").GetComponents <AudioSource>();
        if (aSources != null)
        {
            AudioSource background = aSources[4];
            if (background != null)
            {
                background.Stop();
            }
        }

        if (refinePanel != null)
        {
            refinePanel.SetActive(false);
        }

        if (congratsPanel != null)
        {
            congratsPanel.SetActive(false);
        }

        if (liveHelp != null)
        {
            liveHelp.SetActive(false);
        }

        if (eventPanel != null)
        {
            foreach (Transform child in eventPanel.transform)
            {
                if (child.gameObject.name.StartsWith("Event:"))
                {
                    Destroy(child.gameObject);
                }
            }
        }

        if (coneParent != null)
        {
            //coneParent.GetComponent<EarthView>().ClearCones();

            foreach (Transform child in coneParent.transform)
            {
                Destroy(child.gameObject);
            }
        }

        if (sphereMap != null)
        {
            sphereMap.GetComponent <PlotSphereMap>().ClearPoints();
        }

        //because these can be on during tutorial
        if (panelParent != null)
        {
            panelParent.SetActive(false);
        }

        //position top, front, side cameras for tutorial...
        EnableCameras(true, false);

        if (frontPanel != null)
        {
            frontPanel.GetComponent <UnityEngine.UI.Image>().color = UnityEngine.Color.cyan;
            frontPanel.transform.GetChild(0).gameObject.SetActive(false);
        }

        if (sidePanel != null)
        {
            sidePanel.GetComponent <UnityEngine.UI.Image>().color = UnityEngine.Color.cyan;
            sidePanel.transform.GetChild(0).gameObject.SetActive(false);
        }

        if (topPanel != null)
        {
            topPanel.GetComponent <UnityEngine.UI.Image>().color = UnityEngine.Color.cyan;
            topPanel.transform.GetChild(0).gameObject.SetActive(false);
        }
    }