Пример #1
0
    void OnEnable()
    {
        if (estimoteUnity == null)
        {
            estimoteUnity = FindObjectOfType <EstimoteUnity>();
        }

        estimoteUnity.OnDidRangeBeacons += OnDidRangeBeacons;
    }
Пример #2
0
        public void Setup(EstimoteUnityBeacon eb, EstimoteUnity estimoteUnity)
        {
            mEstimoteUnityBeacon = eb;
            mEstimoteUnity       = estimoteUnity;

            _UUIDText.text       = "UUID: " + mEstimoteUnityBeacon.UUID;
            _MajorMinorText.text = "Major / Minor: " + mEstimoteUnityBeacon.Major + ":" + mEstimoteUnityBeacon.Minor;
            _DistanceText.text   = "Distance: " + mEstimoteUnityBeacon.Accuracy;

            GetComponent <Button> ().onClick.AddListener(delegate() {
                mEstimoteUnity.GetBeaconCloudDetails(mEstimoteUnityBeacon);
            });
        }
Пример #3
0
 // Use this for initialization
 void Start()
 {
     estimoteBeaconData = new List <BeaconData>();
     estimoteUnity      = FindObjectOfType <EstimoteUnity>();
     if (estimoteUnity == null)
     {
         GameObject go = Instantiate(Resources.Load("EstimoteUnity") as GameObject);
         estimoteUnity = go.GetComponent <EstimoteUnity>();
     }
     nullBeaconData = new BeaconData(-1, -1, null);
     estimoteUnity.OnDidRangeBeacons += RecordBeaconData;
     //start scanning after a second
     Invoke("StartScanning", 1);
 }