public void AddCameraLinkedObject(ICameraLinked toAdd) { if (!_objectsOnCamera.Contains(toAdd)) { _objectsOnCamera.Add(toAdd); } if (toAdd is ICameraRelativeWithOffCameraDispose) { _objectsToDisposeOfOnceOffCamera.Add((ICameraRelativeWithOffCameraDispose)toAdd); } }
public void RemoveCameraLinkedObject(ICameraLinked toRemove) { if (_objectsOnCamera.Contains(toRemove)) { _objectsOnCamera.Remove(toRemove); } ICameraRelativeWithOffCameraDispose disposable = toRemove as ICameraRelativeWithOffCameraDispose; if ((disposable != null) && (_objectsToDisposeOfOnceOffCamera.Contains(disposable))) { _objectsToDisposeOfOnceOffCamera.Remove(disposable); } }