public void SubscribeTrackedCloudContainer() { var tracked = new [] { new SlamTrackedObject(0, Vector3.back, Quaternion.identity), new SlamTrackedObject(1, Vector3.down, Quaternion.identity), }; var container = new TrackedObjectsContainer(); var mockedRecorder = new Mock <IDataRecorderPlugin>(); mockedRecorder.Object.SubscribeOn(container, ""); container.AddRange(tracked); container.Update(tracked); container.Remove(tracked); mockedRecorder.Verify(r => r.OnAdded(It.IsAny <string>(), tracked), Times.Once()); mockedRecorder.Verify(r => r.OnUpdated(It.IsAny <string>(), tracked), Times.Once()); mockedRecorder.Verify(r => r.OnRemoved <SlamTrackedObject>(It.IsAny <string>(), It.IsAny <List <int> >()), Times.Once()); mockedRecorder.Object.UnsubscribeFromEverything(); container.AddRange(tracked); container.Update(tracked); container.Remove(tracked); mockedRecorder.Verify(r => r.OnAdded(It.IsAny <string>(), tracked), Times.Once()); mockedRecorder.Verify(r => r.OnUpdated(It.IsAny <string>(), tracked), Times.Once()); mockedRecorder.Verify(r => r.OnRemoved <SlamTrackedObject>(It.IsAny <string>(), It.IsAny <List <int> >()), Times.Once()); }
void Awake() { Instance = this; foreach (Transform trackedObject in transform) { trackedObjects.Add(trackedObject.name, trackedObject.gameObject); } }