void OnEnable() { if (estimoteUnity == null) { estimoteUnity = FindObjectOfType <EstimoteUnity>(); } estimoteUnity.OnDidRangeBeacons += OnDidRangeBeacons; }
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); }); }
// 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); }