Exemple #1
0
    void OnVuforiaStarted()
    {
        Debug.Log("OnVuforiaStarted() called.");

        m_StateManager = TrackerManager.Instance.GetStateManager();

        // Check trackers to see if started and start if necessary
        m_PositionalDeviceTracker = TrackerManager.Instance.GetTracker <PositionalDeviceTracker>();
        m_SmartTerrain            = TrackerManager.Instance.GetTracker <SmartTerrain>();

        if (m_PositionalDeviceTracker != null && m_SmartTerrain != null)
        {
            if (!m_PositionalDeviceTracker.IsActive)
            {
                m_PositionalDeviceTracker.Start();
            }
            if (m_PositionalDeviceTracker.IsActive && !m_SmartTerrain.IsActive)
            {
                m_SmartTerrain.Start();
            }
        }
        else
        {
            if (m_PositionalDeviceTracker == null)
            {
                Debug.Log("PositionalDeviceTracker returned null. GroundPlane not supported on this device.");
            }
            if (m_SmartTerrain == null)
            {
                Debug.Log("SmartTerrain returned null. GroundPlane not supported on this device.");
            }

            MessageBox.DisplayMessageBox(unsupportedDeviceTitle, unsupportedDeviceBody, false, null);
        }
    }
Exemple #2
0
    // Update is called once per frame
    void Update()
    {
        // Get the Vuforia StateManager
        Vuforia.StateManager sm = Vuforia.TrackerManager.Instance.GetStateManager();

        // Query the StateManager to retrieve the list of
        // currently 'active' trackables
        //(i.e. the ones currently being tracked by Vuforia)
        IEnumerable <Vuforia.TrackableBehaviour> activeTrackables = sm.GetActiveTrackableBehaviours();

        // Iterate through the list of active trackables
        Debug.Log("List of trackables currently active (tracked): ");
        foreach (Vuforia.TrackableBehaviour tb in activeTrackables)
        {
            Debug.Log("Trackable: " + tb.TrackableName);
        }
    }
Exemple #3
0
    public void SaveInEditor(string filename = "aaa.json")
    {
        Vuforia.StateManager stateManager = Vuforia.TrackerManager.Instance.GetStateManager();

        List <SerializedData> list = new List <SerializedData>();

        // 인식된 가구들
        var trackable = stateManager.GetActiveTrackableBehaviours();

        if (trackable == null)
        {
            Debug.Log("Trackable : " + trackable);
        }
        // Warning : 아니 이게 유니티 애디터에서는 아래 포문을 돌지 않는데
        // 안드로이드로 빌드하면 한번을 도는 문제가 있다.
        foreach (var t in ObjectToSaveInEditor)
        {
            Debug.Log("trackables : " + t);
            SerializedObject so = t.GetComponentInChildren <SerializedObject>();
            if (so == null)
            {
                Debug.LogError("Object can't save");
                continue;
            }
            // list에 넣기 전 현상태 불러오기
            GameObject ObjectToSave = t.gameObject.GetComponentInChildren <SerializedObject>().gameObject;
            ObjectToSave.GetComponent <SerializedObject>().SetCurrentState();
            list.Add(ObjectToSave.GetComponent <SerializedObject>().sd);
        }
        // 배열의 내용을 json형식 string으로 저장
        string json = JsonHelper.ToJson <SerializedData>(list.ToArray());

        // 저장 디렉토리 존재여부
        if (!Directory.Exists(Application.dataPath + "/Resources"))
        {
            Directory.CreateDirectory(Application.dataPath + "/Resources");
        }
        string path = Path.Combine(Application.dataPath + "/Resources", filename);

        FileStream   file = new FileStream(path, FileMode.Create, FileAccess.Write);
        StreamWriter sw   = new StreamWriter(file);

        sw.WriteLine(json);
        sw.Close();
        file.Close();
    }
Exemple #4
0
    public static int GetNumberOfActiveAnchors()
    {
        int numOfAnchors = 0;

        Vuforia.StateManager stateManager = Vuforia.TrackerManager.Instance.GetStateManager();

        if (stateManager != null)
        {
            foreach (Vuforia.TrackableBehaviour behaviour in stateManager.GetActiveTrackableBehaviours())
            {
                if (behaviour is Vuforia.AnchorBehaviour)
                {
                    numOfAnchors += 1;
                    Debug.Log("Anchor #" + numOfAnchors + ": " + behaviour.TrackableName);
                }
            }
        }
        return(numOfAnchors);
    }
Exemple #5
0
        // Update is called once per frame
        void Update()
        {
            StateManager sm = TrackerManager.Instance.GetStateManager();
            IEnumerable <TrackableBehaviour> tbs = sm.GetActiveTrackableBehaviours();

            foreach (TrackableBehaviour tb in tbs)
            {
                string      name = tb.TrackableName;
                ImageTarget it   = tb.Trackable as ImageTarget;
                Vector2     size = it.GetSize();

                Debug.Log("Active image target:" + name + "  -size: " + size.x + ", " + size.y);

                string NewLine = System.Environment.NewLine;

                //Evertime the target found it will show “name of target” on the TextTargetName. Button, Description and Panel will visible (active)

                TextTargetName.GetComponent <Text>().text = name;
                ButtonAction.gameObject.SetActive(true);
                TextDescription.gameObject.SetActive(true);
                PanelDescription.gameObject.SetActive(true);

                // The Planet

                if (name == "earth")
                {
                    ButtonAction.GetComponent <Button>().onClick.AddListener(delegate { playSound("sounds/earthaudio"); });
                    TextDescription.GetComponent <Text>().text = " 3rd Planet in Solar System" + NewLine + "Distance from Sun : 150 Million KM" + NewLine + "The only Planet that inhabited by living things";
                }


                if (name == "mars")
                {
                    ButtonAction.GetComponent <Button>().onClick.AddListener(delegate { playSound("sounds/marsaudio"); });
                    TextDescription.GetComponent <Text>().text = "4th Planet in Solar System" + NewLine + "Distance from Sun: 241 Million KM" + NewLine + "Also known as the Red Planet";
                }

                if (name == "mercury")
                {
                    ButtonAction.GetComponent <Button>().onClick.AddListener(delegate { playSound("sounds/mercuryaudio"); });
                    TextDescription.GetComponent <Text>().text = "1st Planet in Solar System" + NewLine + "Distance from Sun : 39 million KM" + NewLine + "The Smallest Planet";
                }

                if (name == "venus")
                {
                    ButtonAction.GetComponent <Button>().onClick.AddListener(delegate { playSound("sounds/venusaudio"); });
                    TextDescription.GetComponent <Text>().text = "2nd Planet in Solar System" + NewLine + "Distance from Sun: 108 Million KM" + NewLine + "The Hottest Planet";
                }

                if (name == "jupiter")
                {
                    ButtonAction.GetComponent <Button>().onClick.AddListener(delegate { playSound("sounds/jupiteraudio"); });
                    TextDescription.GetComponent <Text>().text = "5th Planet in Solar System" + NewLine + "Distance from Sun : 486 million KM" + NewLine + "The largest Planet";
                }

                if (name == "saturn")
                {
                    ButtonAction.GetComponent <Button>().onClick.AddListener(delegate { playSound("sounds/saturnaudio"); });
                    TextDescription.GetComponent <Text>().text = "6th Planet in Solar System" + NewLine + "Distance from Sun : 932 million KM" + NewLine + "Very popular with its ring";
                }

                if (name == "uranus")
                {
                    ButtonAction.GetComponent <Button>().onClick.AddListener(delegate { playSound("sounds/uranusaudio"); });
                    TextDescription.GetComponent <Text>().text = "7th Planet in Solar System" + NewLine + "Distance from Sun : 1779 million KM" + NewLine + "Contains Methane which makes it blue";
                }


                if (name == "neptune")
                {
                    ButtonAction.GetComponent <Button>().onClick.AddListener(delegate { playSound("sounds/neptuneaudio"); });
                    TextDescription.GetComponent <Text>().text = "8th Planet in Solar System" + NewLine + "Distance from Sun: 2782 million KM" + NewLine + " It takes 165 earth year to orbit the sun";
                }



                if (name == "moon")
                {
                    ButtonAction.GetComponent <Button>().onClick.AddListener(delegate { playSound("sounds/moonaudio"); });
                    TextDescription.GetComponent <Text>().text = "This is the Earth's moon" + "Distance from Earth: 348 400 KM";
                }
            }
        }
Exemple #6
0
        // Update is called once per frame
        void Update()
        {
            StateManager sm = TrackerManager.Instance.GetStateManager();
            IEnumerable <TrackableBehaviour> tbs = sm.GetActiveTrackableBehaviours();

            foreach (TrackableBehaviour tb in tbs)
            {
                string      name = tb.TrackableName;
                ImageTarget it   = tb.Trackable as ImageTarget;
                Vector2     size = it.GetSize();
                Debug.Log("Active image target:" + name + " -size: " + size.x + ", "
                          + size.y);
                //Evertime the target found it will show “name of target” on the
                //TextTargetName. Button, Description and Panel will visible (active)
                TextTargetName.GetComponent <Text>().text = name;
                TextDescription.gameObject.SetActive(true);
                PanelDescription.gameObject.SetActive(true);
                //If the target name was “zombie” then add listener to ButtonAction
                //with location of the zombie sound (locate in Resources/sounds folder)
                //and set text on TextDescription a description of the zombie
                if (name == "Napa")
                {
                    TextDescription.GetComponent <Text>().text = "What Napa® is and what it is used for?\n\n" +
                                                                 "Napa® (Paracetamol) is a fast acting and safe analgesic with marked antipyretic property." +
                                                                 "\n\nIt is recommended for the treatment of most painful and febrile conditions, such as headache, toothache, " +
                                                                 "backache, rheumatic and muscle pains, dysmenorrhoea, sore throat, and for relieving the fever, aches and pains" +
                                                                 " of colds and flu.\n\nHow to take Napa®\n\nTablet:\nAdults: 1-2 tablets 3-4 times daily\n\nSyrup/Suspension:\n" +
                                                                 "Adults: 4-8 Measuring spoonful 3-4 times daily;\nChildren: 6-12 years: 2- 4 measuring spoonful 3-4 times daily," +
                                                                 " 1-5 years: 1-2 Measuring spoonful 3-4 times daily, Up to 1 year: 1/2 -1 Measuring spoonful 3-4 times daily\n\n" +
                                                                 " How to store Napa®\nStore in a cool and dry place, away from light. Keep out of the reach and sight of children.";
                }
                else if (name == "HPRds")
                {
                    TextDescription.GetComponent <Text>().text = "What is Hpr-Ds?\n" +
                                                                 "Hpr-Ds Tablet is used for Pain during periods, Heavy bleeding during periods, Fever, " +
                                                                 "Migraine headache, Analgesic, Inflammation and other conditions.\n" +
                                                                 "Precautions & How to Use\n\n" +
                                                                 "Before using Hpr-Ds Tablet, inform your doctor about your current list of medications," +
                                                                 " over the counter products (e.g. vitamins, herbal supplements, etc.), allergies, pre-existing diseases," +
                                                                 " and current health conditions (e.g. pregnancy, upcoming surgery, etc.). Some health conditions may make you " +
                                                                 "more susceptible to the side-effects of the drug. Take as directed by your doctor or follow the direction printed" +
                                                                 " on the product insert. Dosage is based on your condition. Tell your doctor if your condition persists or worsens. " +
                                                                 "Important counseling points are listed below.\nHave renal and hepatic impairment\nTaking prescription or " +
                                                                 "nonprescription medicines";
                }
                else if (name == "NapaExtend")
                {
                    TextDescription.GetComponent <Text>().text = " What Napa Extend  is and what it is used for?\n\n" +
                                                                 "Paracetamol 665 mg Extended Release tablet is effective for the relief of persistent pain associated " +
                                                                 "with osteoarthritis and muscle aches and pains such as backache. Paracetamol 665 mg Extended Release tablet " +
                                                                 "also provides effective, temporary relief of pain and discomfort associated with headache," +
                                                                 " tension headache, period pain, toothache and pain after dental procedures, and cold & flu. Reduces fever." +
                                                                 " \n\n How to take Napa Extend\n\nParacetamol 665 mg Extended Release tablet are to be administered " +
                                                                 "orally, with or without food. Adults and children over 12 years. Two tablets, swallowed whole, every 6 to 8 hours" +
                                                                 " (maximum of 6 tablets in any 24 hours). " + "The tablets must not be crushed.";
                }
                else if (name == "Entacyd_Plus")
                {
                    TextDescription.GetComponent <Text>().text = " What is Entacyd Plus?\n\n" +
                                                                 "Entacyd Plus Suspension is used for Painful pressure, Acid indigestion, Stomach upset, Heartburn, Stomach acid," +
                                                                 " Increases water in the intestines and other conditions. Entacyd Plus Suspension may also be used for purposes not " +
                                                                 "listed in this medication guide.";
                }
            }
        }
Exemple #7
0
        // Update is called once per frame
        void Update()
        {
            StateManager sm = TrackerManager.Instance.GetStateManager();
            IEnumerable <TrackableBehaviour> tbs = sm.GetActiveTrackableBehaviours();

            foreach (TrackableBehaviour tb in tbs)
            {
                string      name = tb.TrackableName;
                ImageTarget it   = tb.Trackable as ImageTarget;
                Vector2     size = it.GetSize();

                Debug.Log("Active image target:" + name + "  -size: " + size.x + ", " + size.y);

//Evertime the target found it will show “name of target” on the TextTargetName. Button, Description and Panel will visible (active)

                TextTargetName.GetComponent <Text>().text = name;
                ButtonAction.gameObject.SetActive(true);
                TextDescription.gameObject.SetActive(true);
                PanelDescription.gameObject.SetActive(true);


//If the target name was “zombie” then add listener to ButtonAction with location of the zombie sound (locate in Resources/sounds folder) and set text on TextDescription a description of the zombie

                if (name == "bumi")
                {
                    ButtonAction.GetComponent <Button>().onClick.AddListener(delegate { playSound("sounds/bumi"); });
                    TextDescription.GetComponent <Text>().text = "Planet ketiga adalah Bumi yang sering disebut sebagai Planet Biru, bumi merupakan planet dimana kita tinggal. Sebagian besar Bumi ditutupi oleh lautan, sehingga nampak biru. Bumi diselimuti oleh udara tebal yang disebut atmosfer. Fungsi dari atmosfer untuk menyaring panas dari Matahari sehingga tidak terbakar.";
                }



//If the target name was “unitychan” then add listener to ButtonAction with location of the unitychan sound (locate in Resources/sounds folder) and set text on TextDescription a description of the unitychan / robot

                if (name == "venus")
                {
                    ButtonAction.GetComponent <Button>().onClick.AddListener(delegate { playSound("sounds/venus"); });
                    TextDescription.GetComponent <Text>().text = "Planet kedua yaitu venus, Venus merupakan planet terdekat dari Bumi. Venus lebih panas dibanding Merkurius yang lebih dekat dengan Matahari. Hal ini terjadi karena Planet Venus memiliki lapisan atmosfer tebal yang dilapisi awan. Venus melakukan rotasi dengan arah yang berlawanan dengan rotasi planet-planet lainnya. Venus berotasi searah dengan jarum jam. Satu hari di Venus sama dengan 243 hari di Bumi.";
                }

                if (name == "merkurius")
                {
                    ButtonAction.GetComponent <Button>().onClick.AddListener(delegate { playSound("sounds/merkurius"); });
                    TextDescription.GetComponent <Text>().text = "Planet pertama adalah Merkurius, merkurius merupakan planet terdekat dari matahari yang  berjarak 58jt km, Merkurius sulit terlihat di langit pada malam hari jika dilihat dari Bumi. Markurius baru terlihat setelah Matahari terbenam, atau sebelum Matahari terbit. Keunikan dari Merkurius adalah melesat cepat mengelilingi Matahari, tetapi berotasi sangat lambat. Satu hari di Merkurius sama dengan 30 hari di Bumi.";
                }

                if (name == "mars")
                {
                    ButtonAction.GetComponent <Button>().onClick.AddListener(delegate { playSound("sounds/mars"); });
                    TextDescription.GetComponent <Text>().text = "Planet ke empat  adalah Mars. Mars dijuluki sebagai Planet Merah.  Planet ini disebut paling menyerupai Bumi. Satu hari di Mars sama dengan 24,6 jam di Bumi.  Ia juga memiliki kutub yang diselimuti es.  Suhu udara di Mars lebih dingin daripada suhu di Bumi, yaitu sekitar   - 63 derajat Celsius,  karena letak Mars yang lebih jauh dari Matahari dibanding Bumi.  Mars juga memiliki lapisan atmosfer, namun lebih tipis dibanding Bumi.";
                }

                if (name == "jupiter")
                {
                    ButtonAction.GetComponent <Button>().onClick.AddListener(delegate { playSound("sounds/jupiter"); });
                    TextDescription.GetComponent <Text>().text = "Planet kelima adalah planet Jupiter. Jupiter adalah planet terbesar di dalam tata surya. Suhu di planet ini pun sangat rendah, mencapai kurang lebih - 100 derajat Celsius. Planet Jupiter merupakan planet yang sebagian besar terdiri atas gas. Letak inti planetnya pun jauh di tengah. Planet ini memiliki bintik merah yang ternyata merupakan badai raksasa.";
                }

                if (name == "saturnus")
                {
                    ButtonAction.GetComponent <Button>().onClick.AddListener(delegate { playSound("sounds/saturnus"); });
                    TextDescription.GetComponent <Text>().text = "Planet keenam dalam sistem tata surya adalah planet Saturnus. Saturnus terlihat memiliki cincin yang melingkari tubuhnya. Cincin tersebut terdiri atas lingkaran bebatuan, debu, dan es yang terperangkap dalam orbit mengelilingi planet tersebut.";
                }

                if (name == "uranus")
                {
                    ButtonAction.GetComponent <Button>().onClick.AddListener(delegate { playSound("sounds/uranus"); });
                    TextDescription.GetComponent <Text>().text = "Planet Uranus merupakan planet ketujuh dalam sistem tata surya. Planet Uranus berputar miring karena porosnya yang hampir sejajar dengan orbitnya.  Suhu planet ini sangat dingin, yaitu sekitar minus 212 derajat Celsius.";
                }

                if (name == "neptunus")
                {
                    ButtonAction.GetComponent <Button>().onClick.AddListener(delegate { playSound("sounds/neptunus"); });
                    TextDescription.GetComponent <Text>().text = "Planet yang berada di urutan paling jauh dari Matahari adalah planet Neptunus. Planet ini tampak berwarna biru gelap dari kejauhan dan tidak memiliki permukaan yang nyata. Sama halnya dengan Jupiter, Saturnus, dan Uranus, planet ini juga terdiri atas gumpalan gas.";
                }

                if (name == "matahari")
                {
                    ButtonAction.GetComponent <Button>().onClick.AddListener(delegate { playSound("sounds/matahari"); });
                    TextDescription.GetComponent <Text>().text = "Matahari adalah sebuah bintang raksasa yang sangat panas seperti bola pijar. Matahari merupakan pusat tata surya  yang dikelilingi benda langit lainnya. Suhu di permukaannya hampir 6000 derajat Celsius. Suhu inti Matahari mencapai 15.000.000 derajat Celsius. Percikan panasnya dapat membakar segala sesuatu hingga 97 kilometer.  Namun, Matahari hanya tergolong bintang sedang. Masih banyak bintang besar yang jauh lebih besar dan lebih panas dari matahari.";
                }
            }
        }
        // Update is called once per frame
        void Update()
        {
            StateManager sm = TrackerManager.Instance.GetStateManager();
            IEnumerable <TrackableBehaviour> tbs = sm.GetActiveTrackableBehaviours();

            Found.GetComponent <Button> ().onClick.AddListener(delegate {
                if (click)
                {
                    Question.gameObject.SetActive(true);
                    Found.gameObject.SetActive(false);
                    Q1.gameObject.SetActive(true);
                    Q2.gameObject.SetActive(true);
                    Q3.gameObject.SetActive(true);
                    Q4.gameObject.SetActive(true);
                }
            });

            Q1.GetComponent <Button> ().onClick.AddListener(delegate {
                if (click)
                {
                    BlackFade.gameObject.SetActive(true);
                    Wrong.gameObject.SetActive(true);
                }
            });

            Q2.GetComponent <Button> ().onClick.AddListener(delegate {
                if (click)
                {
                    BlackFade.gameObject.SetActive(true);
                    Wrong.gameObject.SetActive(true);
                }
            });

            Q3.GetComponent <Button> ().onClick.AddListener(delegate {
                if (click)
                {
                    BlackFade.gameObject.SetActive(true);
                    Wrong.gameObject.SetActive(true);
                }
            });

            Q4.GetComponent <Button> ().onClick.AddListener(delegate {
                if (click)
                {
                    Correct.gameObject.SetActive(true);
                    BlackFade.gameObject.SetActive(true);
                }
            });

            Wrong.GetComponent <Button> ().onClick.AddListener(delegate {
                if (click)
                {
                    Wrong.gameObject.SetActive(false);
                    BlackFade.gameObject.SetActive(false);
                }
            });

            Correct.GetComponent <Button> ().onClick.AddListener(delegate {
                if (click)
                {
                    Correct.gameObject.SetActive(false);
                    Question.gameObject.SetActive(false);
                    Q1.gameObject.SetActive(false);
                    Q2.gameObject.SetActive(false);
                    Q3.gameObject.SetActive(false);
                    Q4.gameObject.SetActive(false);
                    Congratulations.gameObject.SetActive(true);
                    BlackFade.gameObject.SetActive(false);
                    Cam.gameObject.SetActive(true);
                    Done.gameObject.SetActive(true);
                }
            });

            Done.GetComponent <Button> ().onClick.AddListener(delegate {
                if (click)
                {
                    Done.gameObject.SetActive(false);
                    Congratulations.gameObject.SetActive(false);
                    Cam.gameObject.SetActive(false);
                    KeepSearching.gameObject.SetActive(true);
                    BlackFade.gameObject.SetActive(true);
                }
            });

            KeepSearching.GetComponent <Button> ().onClick.AddListener(delegate {
                if (click)
                {
                    KeepSearching.gameObject.SetActive(false);
                    BlackFade.gameObject.SetActive(false);
                    Badge.gameObject.SetActive(true);
                }
            });



            foreach (TrackableBehaviour tb in tbs)
            {
                string      name = tb.TrackableName;
                ImageTarget it   = tb.Trackable as ImageTarget;
                Vector2     size = it.GetSize();

                Debug.Log("Active image target:" + name + "  -size: " + size.x + ", " + size.y);
            }
        }
Exemple #9
0
        // Update is called once per frame
        void Update()
        {
            StateManager sm = TrackerManager.Instance.GetStateManager();
            IEnumerable <TrackableBehaviour> tbs = sm.GetActiveTrackableBehaviours();

            foreach (TrackableBehaviour tb in tbs)
            {
                string      name = tb.TrackableName;
                ImageTarget it   = tb.Trackable as ImageTarget;
                Vector2     size = it.GetSize();

                Debug.Log("Active image target:" + name + "  -size: " + size.x + ", " + size.y);

                TextTargetName.GetComponent <Text>().text   = name;
                Panel_Text.GetComponent <Text>().text       = name;
                TextTargetNameUI.GetComponent <Text>().text = name;
                ButtonAction.gameObject.SetActive(true);
                TextDescription.gameObject.SetActive(true);

                PanelDescription.gameObject.SetActive(true);
                PanelDescriptionInside.gameObject.SetActive(true);
                ButtonActionShow.gameObject.SetActive(true);


                if (name == "Mercury")
                {
                    ButtonAction.GetComponent <Button>().onClick.AddListener(delegate { playSound("sounds/Mercury_final"); });
                    TextDescription.GetComponent <Text>().text = "   The smallest planet in our solar system and the nearest to the Sun. " +
                                                                 "Mercury is only slightly larger than the Earth's moon. From the surface of Mercury, the Sun would appear more than three " +
                                                                 "times as large as it does when viewed from Earth and the sunlight would be as much as 11 times brighter." +
                                                                 "\nAge: 4.503 billion years" +
                                                                 "\nRadius(Size): 2,440 km" +
                                                                 "\nDistance from Sun: 57.91 million km" +
                                                                 "\nNumber of moon/s: no moon";
                }
                if (name == "Venus")
                {
                    ButtonAction.GetComponent <Button>().onClick.AddListener(delegate { playSound("sounds/Venus_final"); });
                    TextDescription.GetComponent <Text>().text = "   The second planet from the Sun and our closest planetary neighbor. Venus " +
                                                                 "is similar in structure and size to Earth. Venus spins slowly in the opposite direction most planets do. Its thick atmosphere " +
                                                                 "traps heat with greenhouse effect, making it the hottest planet in our solar system." +
                                                                 "\nAge: 4.503 billion years" +
                                                                 "\nRadius(Size): 6,052 km " +
                                                                 "\nDistance from Sun: 108.2 million km" +
                                                                 "\nNumber of moon/s: no moon";
                }
                if (name == "Earth")
                {
                    ButtonAction.GetComponent <Button>().onClick.AddListener(delegate { playSound("sounds/Earth_final"); });
                    TextDescription.GetComponent <Text>().text = "   Our home planet is the third planet from the Sun and the only planet we know " +
                                                                 "so far that is inhabited by living things. It is the only world in our solar system with liquid water on the surface. It is just " +
                                                                 "slightly larger than nearby Venus. " +
                                                                 "\nAge: 4.543 billion years" +
                                                                 "\nRadius(Size): 6,371 km " +
                                                                 "\nDistance from Sun: 149.6 million km" +
                                                                 "\nNumber of moon/s: 1 moon";
                }
                if (name == "Mars")
                {
                    ButtonAction.GetComponent <Button>().onClick.AddListener(delegate { playSound("sounds/Mars_final"); });
                    TextDescription.GetComponent <Text>().text = "   The fourth planet, and it is a dusty,cold, dessert world with a very thin atmosphere. " +
                                                                 "This dynamic planet has seasons, polar ice caps, extinct volcanoes, canyons and weather. Mars is one of the most explored bodies in our " +
                                                                 "solar system and it is the only planet where we've sent rovers to roam the alien landscape. " +
                                                                 "\nAge: 4.603 billion years" +
                                                                 "\nRadius(Size): 3,390 km" +
                                                                 "\nDistance from Sun: 227.9 million km" +
                                                                 "\nNumber of moon/s: 2 moons (Phobos and Deimos)";
                }
                if (name == "Jupiter")
                {
                    ButtonAction.GetComponent <Button>().onClick.AddListener(delegate { playSound("sounds/Jupiter_final"); });
                    TextDescription.GetComponent <Text>().text = "   The fifth planet from the Sun and is, by far, the largest planet in the solar system. " +
                                                                 "It is more than twice as massive as all the other planets combined. Jupiter's stripes and swirls are actually cold. windy clouds of ammonia " +
                                                                 "and water, floating in an atmosphere of hydrogen and helium. Jupiter's iconic Great Red Spot is a giant " +
                                                                 "storm bigger than Earth that has raged for hundreds of years." +
                                                                 "\nAge: 4.503 billion years" +
                                                                 "\nRadius(Size): 69,911 km" +
                                                                 "\nDistance from Sun: 778.5 million km" +
                                                                 "\nNumber of moon/s: 79 moons";
                }
                if (name == "Saturn")
                {
                    ButtonAction.GetComponent <Button>().onClick.AddListener(delegate { playSound("sounds/Saturn_final"); });
                    TextDescription.GetComponent <Text>().text = "   The sixth planet from the Sun and the second largest planet in our solar system. Adorned with " +
                                                                 "a dazzling system of icy rings, Saturn is unique among the planets. It is not the only planet to have rings but none are as spectacular or as " +
                                                                 "complex as Saturn. Saturn is home to some of the most fascinating landscapes in our solar system." +
                                                                 "\nAge: 4.503 billion years" +
                                                                 "\nRadius(Size): 58,232 km" +
                                                                 "\nDistance from Sun: 1.443 billion km" +
                                                                 "\nNumber of moon/s: 62 moons";
                }
                if (name == "Uranus")
                {
                    ButtonAction.GetComponent <Button>().onClick.AddListener(delegate { playSound("sounds/Uranus_final"); });
                    TextDescription.GetComponent <Text>().text = "   The seventh planet from the Sun and the third largest planet in our solar system. Uranus is " +
                                                                 "very cold and windy. The ice giant is surrounded by 13 faint rings and 27 small moons as it rotates at a nearby 90 degree angle from the plane of " +
                                                                 "its orbit. This unique tilt make Uranus appear to spin on its side, orbiting the Sun like a rolling ball." +
                                                                 "\nAge: 4.503 billion years" +
                                                                 "\nRadius(Size): 25,362 km" +
                                                                 "\nDistance from Sun: 2.871 billion km" +
                                                                 "\nNumber of moon/s: 27 moons";
                }
                if (name == "Neptune")
                {
                    ButtonAction.GetComponent <Button>().onClick.AddListener(delegate { playSound("sounds/Neptune_final"); });
                    TextDescription.GetComponent <Text>().text = "   Dark, cold and whipped by supersonic winds, ice giant Neptune is the eighth and the most " +
                                                                 "distant planet in our solar system. More than 30 times as far from the Sun as Earth. Neptune is the only planet in our solar system that is not visible " +
                                                                 "to the naked eye. Neptune is so far from the Sun that high noon on the big blue planet would seem like dim twilight to us." +
                                                                 "\nAge: 4.503 billion years" +
                                                                 "\nRadius(Size): 24,622 km" +
                                                                 "\nDistance from the Sun: 4.492 billion km" +
                                                                 "\nNumber of moon/s: 14 moons";
                }
                if (name == "Sun")
                {
                    ButtonAction.GetComponent <Button>().onClick.AddListener(delegate { playSound("sounds/Sun_final"); });
                    TextDescription.GetComponent <Text>().text = "   The Sun is the star at the center of the Solar System. It is a nearly perfect sphere of hot plasma, with " +
                                                                 "internal convective motion that generates a magnetic field via a dynamo process. " +
                                                                 "\nAge: 4.5 billion years" +
                                                                 "\nRadius(Size): 695,508 km";
                }
            }
        }