예제 #1
0
 /// <summary>
 ///     Method to create an EntityQuery command request payload.
 /// </summary>
 /// <param name="entityQuery">The EntityQuery object defining the constraints and query type.</param>
 /// <param name="timeoutMillis">
 ///     (Optional) The command timeout in milliseconds. If not specified, will default to 5 seconds.
 /// </param>
 /// <param name="context">
 ///    (Optional) A context object that will be returned with the command response.
 /// </param>
 /// <returns></returns>
 public Request(Improbable.Worker.CInterop.Query.EntityQuery entityQuery,
                uint?timeoutMillis = null, object context = null)
 {
     EntityQuery   = entityQuery;
     TimeoutMillis = timeoutMillis;
     Context       = context;
 }
        //InterestTemplate template;

        void Initialize()
        {
            Vector3?pos    = Vector3.zero;
            double  radius = 300;

            var list = new IConstraint[]
            {
                new ComponentConstraint(WorldTimer.ComponentId),
                new SphereConstraint(pos.Value.x, pos.Value.y, pos.Value.z, radius),
            };

            timerQuery = new EntityQuery()
            {
                Constraint = new AndConstraint(list),
                ResultType = new SnapshotResultType()
            };
        }