Beispiel #1
0
        public BasicConfig()
        {
            m_ipList[0] = "192.168.125.79";
            m_ipList[1] = "192.168.125.254";
            m_IpSelect = IpSelect.IP_192_168_125_254;

            m_zoneList[0] = 30;
            m_zoneList[1] = 31;
            m_zoneSelect = ZoneSelect.Zone_30;
        }
Beispiel #2
0
        public BasicConfig()
        {
            m_ipList[0] = "192.168.125.79";
            m_ipList[1] = "192.168.125.254";
            m_IpSelect  = IpSelect.IP_192_168_125_254;

            m_zoneList[0] = 30;
            m_zoneList[1] = 31;
            m_zoneSelect  = ZoneSelect.Zone_30;
        }
 public void hideAllSelections()
 {
     for (int x = 0; x < numInRow; x++)
     {
         for (int y = 0; y < numInRow; y++)
         {
             ZoneSelect zoneSelect = zones[x, y].GetComponent <ZoneSelect>();
             zoneSelect.HideHighlight();
         }
     }
 }
 public void EnableZoneSelects()
 {
     for (int x = 0; x < numInRow; x++)
     {
         for (int y = 0; y < numInRow; y++)
         {
             ZoneSelect zone = zones[x, y].GetComponent <ZoneSelect>();
             zone.enabled = true;
             zones[x, y].GetComponent <Collider2D>().enabled = true;
         }
     }
 }
Beispiel #5
0
        public void SetModelObject(GameObject zoneObj)
        {
            if (modelObject != null)
            {
                Object.Destroy(modelObject);
            }
            modelObject = zoneObj;
            zoneObj.transform.localPosition = new Vector3(position.x, position.y, 0);
            ZoneSelect selectScript = zoneObj.GetComponent <ZoneSelect>();

            selectScript.zoneName = name;
            if (modelObject.activeSelf)
            {
                modelObject.SetActive(false);
                modelObject.SetActive(true);
            }
        }
Beispiel #6
0
        private void ChangeSelectedZone()
        {
            ZoneSelect.Clear();
            if (_selectedZone == null)
            {
                return;
            }
            ZoneSelect.Add(_selectedZone);
            if (_selectedZone.MovedLocations == null || _selectedZone.MovedLocations.Count < 0)
            {
                return;
            }
            var centerLocation = _selectedZone.MovedLocations.GetCenter();

            if (centerLocation.Latitude != 0 && centerLocation.Longitude != 0)
            {
                MapCenterUser = centerLocation;
            }
        }
    public void showAvailableTowerSpots()
    {
        Debug.Log("showAvailableTowerSpots");
        bool offsetThisRow = false;

        for (int y = 0; y < numInRow; y++)
        {
            offsetThisRow = !offsetThisRow;
            for (int x = 0; x < numInRow; x++)
            {
                Zone       zone       = zones[x, y].GetComponent <Zone>();
                ZoneSelect zoneSelect = zones[x, y].GetComponent <ZoneSelect>();
                // Debug.Log(zone.zoneType);
                if (zone.zoneType == "RadioTower")
                {
                    Debug.Log("tower!");
                    int leftx  = x - 1;
                    int rightx = x + 1;
                    if (leftx > 0 && leftx < numInRow)
                    {
                        zones[leftx, y].GetComponent <ZoneSelect>().ShowHighlight();
                    }
                    if (rightx > 0 && rightx < numInRow)
                    {
                        zones[rightx, y].GetComponent <ZoneSelect>().ShowHighlight();
                    }
                    int upy   = y + 1;
                    int downy = y - 1;
                    if (upy > 0 && upy < numInRow)
                    {
                        zones[x, upy].GetComponent <ZoneSelect>().ShowHighlight();
                        if (offsetThisRow)
                        {
                            if (rightx > 0 && rightx < numInRow)
                            {
                                zones[rightx, upy].GetComponent <ZoneSelect>().ShowHighlight();
                            }
                        }
                        else
                        {
                            if (leftx > 0 && leftx < numInRow)
                            {
                                zones[leftx, upy].GetComponent <ZoneSelect>().ShowHighlight();
                            }
                        }
                    }
                    if (downy > 0 && downy < numInRow)
                    {
                        zones[x, downy].GetComponent <ZoneSelect>().ShowHighlight();
                        if (offsetThisRow)
                        {
                            if (rightx > 0 && rightx < numInRow)
                            {
                                zones[rightx, downy].GetComponent <ZoneSelect>().ShowHighlight();
                            }
                        }
                        else
                        {
                            if (leftx > 0 && leftx < numInRow)
                            {
                                zones[leftx, downy].GetComponent <ZoneSelect>().ShowHighlight();
                            }
                        }
                    }
                }
            }
        }
    }