예제 #1
0
    public void OnPointerDown(PointerEventData eventData)
    {
        GlobalMap gm = Camera.main.GetComponent <GlobalMap>();

        if (NameLoc == "C0")
        {
            SceneManager.LoadScene("Town");
        }

        /*
         * else if (GameManager.instance.locations[NameLoc] == 2)
         * {
         *  gm.ShowInfoPanel(NameLoc);
         * }*/
        else
        {
            bool isnearPoint = true;
            for (int i = 0; i < nearPoint.Length; i++)
            {
                if (GameManager.instance.HeroPos == nearPoint[i].name)
                {
                    isnearPoint = true;
                }
            }
            if (isnearPoint)
            {
                gm.ShowInfoPanel(NameLoc);
            }
        }
    }
예제 #2
0
 void SelectPoint(RaycastHit2D hit)
 {
     if (!EventSystem.current.IsPointerOverGameObject())
     {
         if (hit.transform == transform)
         {
             if (NameLoc == "C0")
             {
                 SceneManager.LoadScene("Town");
             }
             else
             {
                 bool isnearPoint = false;
                 for (int i = 0; i < nearPoint.Length; i++)
                 {
                     if (GameManager.instance.HeroPos == nearPoint[i].name)
                     {
                         isnearPoint = true;
                     }
                 }
                 if (isnearPoint)
                 {
                     GlobalMap gm = Camera.main.GetComponent <GlobalMap>();
                     gm.ShowInfoPanel(NameLoc);
                 }
             }
         }
     }
 }