Exemplo n.º 1
0
        void PickFromRay(Ray ray, Action <List <ISpatialObject> > callback, string[] flagsExcluded)
        {
            var pickingLogic = new PickFromRay(ray);
            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);
            });
        }
Exemplo n.º 2
0
        void PickFromRay(Ray ray, List <ISpatialObject> results, string[] flagsExcluded)
        {
            results.Clear();
            var pickingLogic = new PickFromRay(ray);
            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);
        }