示例#1
0
 public void useNav()
 {
     GameData.Instance().navOn = true;
     WorldMapManager.Instance().ChooseStar.SetActive(true);
     WorldMapManager.Instance().Touch.SetActive(true);
     WorldMapManager.Instance().UseNav_ui.SetActive(false);
 }
示例#2
0
 public void OnBeginDrag(PointerEventData eventData)
 {
     if (WorldMapManager.Instance().dragState == false)
     {
         WorldMapManager.Instance().dragState = true;
     }
     oldPos = new Vector2(eventData.position.x, eventData.position.y);
     //Debug.Log("OnBeginDrag");
 }
示例#3
0
    public void OnDrag(PointerEventData eventData)
    {
        if (WorldMapManager.Instance().dragState == false)
        {
            WorldMapManager.Instance().dragState = true;
        }
        if (Input.touchCount == 1)  //Build Mode
        {
            //Debug.Log("OnDrag");
            newPos = new Vector2(eventData.position.x, eventData.position.y);
            //Debug.Log(eventData.delta);

            GameObject obj = GameObject.Find("DragCamera");
            obj.transform.Rotate(new Vector3(eventData.delta.y / dragRate, -eventData.delta.x / dragRate, 0));
            //obj.transform.localRotation =
        }//Build Mode
    }
示例#4
0
 // 월드맵
 public void ReChoose()
 {
     WorldMapManager.Instance().ChooseStar.SetActive(true);
     WorldMapManager.Instance().Touch.SetActive(true);
     WorldMapManager.Instance().Destination_ui.SetActive(false);
 }
示例#5
0
    void Update()
    {
        if (WorldMapManager.Instance().dragState == false)
        {
            //if (Input.GetButtonUp("Fire1"))                                     // Debug Mode
            //{
            //    Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);    // Debug Mode
            //    RaycastHit hit;                                                 // Debug Mode

            foreach (Touch touch in Input.touches)                             // Build Mode
            {
                Ray        ray = Camera.main.ScreenPointToRay(touch.position); // Build Mode
                RaycastHit hit;                                                // Build Mode

                if (Physics.Raycast(ray, out hit))
                {
                    if (WorldMapManager.Instance().dragState == false)
                    {
                        if (hit.transform.tag.Equals("Stars"))
                        {
                            SoundManager.Instance().PlaySfx(SoundManager.Instance().getFood);
                            SelectDB.Instance().column = "locationX,locationY,locationZ,name,zodiac";
                            SelectDB.Instance().table  = "zodiacTable";
                            SelectDB.Instance().where = "WHERE zID= " + "'" + hit.transform.name + "'";
                            SelectDB.Instance().Select(1);
                            GameData.Instance().starPosition = SelectDB.Instance().starPosition;

                            WorldMapManager.Instance().ChooseStar.SetActive(false);
                            WorldMapManager.Instance().Touch.SetActive(false);
                            WorldMapManager.Instance().Destination_ui.SetActive(true);

                            if (SelectDB.Instance().zodiacName == "Aquarius")
                            {
                                zodiac = "물병자리";
                            }
                            else if (SelectDB.Instance().zodiacName == "Pisces")
                            {
                                zodiac = "물고기자리";
                            }
                            else if (SelectDB.Instance().zodiacName == "Aries")
                            {
                                zodiac = "양자리";
                            }
                            else if (SelectDB.Instance().zodiacName == "Taurus")
                            {
                                zodiac = "황소자리";
                            }
                            else if (SelectDB.Instance().zodiacName == "Gemini")
                            {
                                zodiac = "쌍둥이자리";
                            }
                            else if (SelectDB.Instance().zodiacName == "Cancer")
                            {
                                zodiac = "게자리";
                            }
                            else if (SelectDB.Instance().zodiacName == "Leo")
                            {
                                zodiac = "사자자리";
                            }
                            else if (SelectDB.Instance().zodiacName == "Virgo")
                            {
                                zodiac = "처녀자리";
                            }
                            else if (SelectDB.Instance().zodiacName == "Libra")
                            {
                                zodiac = "천칭자리";
                            }
                            else if (SelectDB.Instance().zodiacName == "Scorpius")
                            {
                                zodiac = "전갈자리";
                            }
                            else if (SelectDB.Instance().zodiacName == "Sagittarius")
                            {
                                zodiac = "궁수자리";
                            }
                            else if (SelectDB.Instance().zodiacName == "Capricornus")
                            {
                                zodiac = "염소자리";
                            }

                            WorldMapManager.Instance().Destination_ui.GetComponentInChildren <Text>().text = zodiac + " " + SelectDB.Instance().starName;
                        }
                        //else
                        //{
                        //    WorldMapManager.Instance().Touch.SetActive(false);
                        //    WorldMapManager.Instance().Destination_ui.SetActive(true);
                        //    WorldMapManager.Instance().Destination_ui.GetComponentInChildren<Text>().text = hit.transform.name;
                        //}
                    }
                }
            }                                                                 // Build Mode
            //}                                                                   // Debug Mode
        }
        WorldMapManager.Instance().dragState = false;
    }
示例#6
0
    void loadStar()
    {
        SelectDB.Instance().table  = "zodiacTable";
        SelectDB.Instance().column = "Count(*)";
        SelectDB.Instance().Select(0);
        for (int i = 1; i <= SelectDB.Instance().starCount; i++)
        {
            SelectDB.Instance().table  = "zodiacTable";
            SelectDB.Instance().column = "rowid, open, find, active, zID, zodiac";
            SelectDB.Instance().where = "WHERE \"rowid\" =" + i;
            SelectDB.Instance().Select(4);

            if (SelectDB.Instance().starActive == 0)
            {
                GameObject.Find(SelectDB.Instance().zodiacID).gameObject.GetComponent <SphereCollider>().enabled   = true;
                GameObject.Find(SelectDB.Instance().zodiacID).gameObject.GetComponent <SphereCollider>().isTrigger = true;
            }
            else if (SelectDB.Instance().starActive == 1)
            {
                Debug.Log(SelectDB.Instance().zodiacName);
                if (SelectDB.Instance().zodiacName == "Aquarius")
                {
                    WorldMapManager.Instance().zodiacCnt1 += 1;
                }
                else if (SelectDB.Instance().zodiacName == "Pisces")
                {
                    WorldMapManager.Instance().zodiacCnt2++;
                }
                else if (SelectDB.Instance().zodiacName == "Aries")
                {
                    WorldMapManager.Instance().zodiacCnt3++;
                }
                else if (SelectDB.Instance().zodiacName == "Taurus")
                {
                    WorldMapManager.Instance().zodiacCnt4++;
                }
                else if (SelectDB.Instance().zodiacName == "Gemini")
                {
                    WorldMapManager.Instance().zodiacCnt5++;
                }
                else if (SelectDB.Instance().zodiacName == "Cancer")
                {
                    WorldMapManager.Instance().zodiacCnt6++;
                }
                else if (SelectDB.Instance().zodiacName == "Leo")
                {
                    WorldMapManager.Instance().zodiacCnt7++;
                }
                else if (SelectDB.Instance().zodiacName == "Virgo")
                {
                    WorldMapManager.Instance().zodiacCnt8++;
                }
                else if (SelectDB.Instance().zodiacName == "Libra")
                {
                    WorldMapManager.Instance().zodiacCnt9++;
                }
                else if (SelectDB.Instance().zodiacName == "Scorpius")
                {
                    WorldMapManager.Instance().zodiacCnt10++;
                }
                else if (SelectDB.Instance().zodiacName == "Sagittarius")
                {
                    WorldMapManager.Instance().zodiacCnt11++;
                }
                else if (SelectDB.Instance().zodiacName == "Capricornus")
                {
                    WorldMapManager.Instance().zodiacCnt12++;
                }
                GameObject.Find(SelectDB.Instance().zodiacID).gameObject.GetComponent <SphereCollider>().enabled = false;
                GameObject.Find(SelectDB.Instance().zodiacID).gameObject.GetComponent <MeshRenderer>().enabled   = false;
            }
            if (zodiacCnt1 == 6 && cnt1 == false)
            {
                for (int cnt = 7; cnt < 17; cnt++)
                {
                    Debug.Log(GameObject.Find("Aquarius").transform.FindChild("aqua_" + cnt).name);
                    GameObject.Find("Aquarius").transform.FindChild("aqua_" + cnt).gameObject.GetComponent <SphereCollider>().enabled = false;
                    GameObject.Find("Aquarius").transform.FindChild("aqua_" + cnt).gameObject.GetComponent <MeshRenderer>().enabled   = false;
                }
                cnt1 = true;
            }
            if (zodiacCnt2 == 5 && cnt2 == false)
            {
                for (int cnt = 6; cnt < 22; cnt++)
                {
                    GameObject.Find("Pisces").transform.FindChild("pis_" + cnt).gameObject.GetComponent <SphereCollider>().enabled = false;
                    GameObject.Find("Pisces").transform.FindChild("pis_" + cnt).gameObject.GetComponent <MeshRenderer>().enabled   = false;
                }
                cnt2 = true;
            }
            //if (zodiacCnt3 == 4 && cnt3 == false)
            //{
            //    //작은별없음 Aries
            //  cnt3 == true;
            //}
            if (zodiacCnt4 == 6 && cnt4 == false)
            {
                for (int cnt = 7; cnt < 20; cnt++)
                {
                    GameObject.Find("Taurus").transform.FindChild("tau_" + cnt).gameObject.GetComponent <SphereCollider>().enabled = false;
                    GameObject.Find("Taurus").transform.FindChild("tau_" + cnt).gameObject.GetComponent <MeshRenderer>().enabled   = false;
                }
                cnt4 = true;
            }
            if (zodiacCnt5 == 5 && cnt5 == false)
            {
                for (int cnt = 6; cnt < 18; cnt++)
                {
                    GameObject.Find("Gemini").transform.FindChild("gem_" + cnt).gameObject.GetComponent <SphereCollider>().enabled = false;
                    GameObject.Find("Gemini").transform.FindChild("gem_" + cnt).gameObject.GetComponent <MeshRenderer>().enabled   = false;
                }
                cnt5 = true;
            }
            if (zodiacCnt6 == 5 && cnt6 == false)
            {
                for (int cnt = 6; cnt < 8; cnt++)
                {
                    GameObject.Find("Cancer").transform.FindChild("can_" + cnt).gameObject.GetComponent <SphereCollider>().enabled = false;
                    GameObject.Find("Cancer").transform.FindChild("can_" + cnt).gameObject.GetComponent <MeshRenderer>().enabled   = false;
                }
                cnt6 = true;
            }
            if (zodiacCnt7 == 4 && cnt7 == false)
            {
                for (int cnt = 5; cnt < 17; cnt++)
                {
                    GameObject.Find("Leo").transform.FindChild("leo_" + cnt).gameObject.GetComponent <SphereCollider>().enabled = false;
                    GameObject.Find("Leo").transform.FindChild("leo_" + cnt).gameObject.GetComponent <MeshRenderer>().enabled   = false;
                }
                cnt7 = true;
            }
            if (zodiacCnt8 == 5 && cnt8 == false)
            {
                for (int cnt = 6; cnt < 16; cnt++)
                {
                    GameObject.Find("Virgo").transform.FindChild("vir_" + cnt).gameObject.GetComponent <SphereCollider>().enabled = false;
                    GameObject.Find("Virgo").transform.FindChild("vir_" + cnt).gameObject.GetComponent <MeshRenderer>().enabled   = false;
                }
                cnt8 = true;
            }
            if (zodiacCnt9 == 5 && cnt9 == false)
            {
                for (int cnt = 6; cnt < 7; cnt++)
                {
                    GameObject.Find("Libra").transform.FindChild("lib_" + cnt).gameObject.GetComponent <SphereCollider>().enabled = false;
                    GameObject.Find("Libra").transform.FindChild("lib_" + cnt).gameObject.GetComponent <MeshRenderer>().enabled   = false;
                }
                cnt9 = true;
            }
            if (zodiacCnt10 == 6 && cnt10 == false)
            {
                for (int cnt = 7; cnt < 13; cnt++)
                {
                    GameObject.Find("Scorpius").transform.FindChild("sco_" + cnt).gameObject.GetComponent <SphereCollider>().enabled = false;
                    GameObject.Find("Scorpius").transform.FindChild("sco_" + cnt).gameObject.GetComponent <MeshRenderer>().enabled   = false;
                }
                cnt10 = true;
            }
            if (zodiacCnt11 == 6 && cnt11 == false)
            {
                for (int cnt = 7; cnt < 22; cnt++)
                {
                    GameObject.Find("Sagittarius").transform.FindChild("sag_" + cnt).gameObject.GetComponent <SphereCollider>().enabled = false;
                    GameObject.Find("Sagittarius").transform.FindChild("sag_" + cnt).gameObject.GetComponent <MeshRenderer>().enabled   = false;
                }
                cnt11 = true;
            }
            if (zodiacCnt12 == 6 && cnt12 == false)
            {
                for (int cnt = 7; cnt < 13; cnt++)
                {
                    GameObject.Find("Capricornus").transform.FindChild("cap_" + cnt).gameObject.GetComponent <SphereCollider>().enabled = false;
                    GameObject.Find("Capricornus").transform.FindChild("cap_" + cnt).gameObject.GetComponent <MeshRenderer>().enabled   = false;
                }
                cnt12 = true;
            }
        }
    }
示例#7
0
    public void OnEndDrag(PointerEventData eventData)
    {
        WorldMapManager.Instance().dragState = true;

        //Debug.Log("OnDragEnd");
    }