void PickFromSamplePoints(Vector3[] samplePoints, int count, Action <List <ISpatialObject> > callback, string[] flagsExcluded = null) { var pickingLogic = new PickFromSamplePoints(samplePoints, count); var rpc = m_SpatialPickingOutput.Call((object)null, (object)null, (object)null, new SpatialPickingArguments(pickingLogic, flagsExcluded)); rpc.Success <List <ISpatialObject> >((self, ctx, userCtx, result) => { callback(result); }); rpc.Failure((self, ctx, userCtx, ex) => { Debug.LogException(ex); }); }
void PickFromSamplePoints(Vector3[] samplePoints, int count, List <ISpatialObject> results, string[] flagsExcluded) { results.Clear(); var pickingLogic = new PickFromSamplePoints(samplePoints, count); var cc = new ConditionCapture <bool>(false); var rpc = m_SpatialPickingOutput.Call((object)null, (object)null, cc, new SpatialPickingArguments(pickingLogic, flagsExcluded)); rpc.Success <List <ISpatialObject> >((self, ctx, cc, result) => { results.AddRange(result); cc.Data = true; }); rpc.Failure((self, ctx, cc, ex) => { Debug.LogException(ex); cc.Data = true; }); m_Runner.ProcessUntil(cc, c => c.Data); }