private void VoiceRotateResponse(object sender, OnRotateEventArgs eventArgs) { EntityQuery removeNotRotQuery = GetEntityQuery(removeMovementNotRotQueryDesc); // query the entities if (removeNotRotQuery.CalculateEntityCount() > 0) //check if there are any entities that match the query { removeNotRot = true; this.Enabled = true; // do the removal } }
private void VoiceRotateResponse(object sender, OnRotateEventArgs eventArgs) { if (onRotateLeftPhase && eventArgs.RotateLeft && !onParaTightCordonPhase) { rotatedLeft = true; } else if (onRotateRightPhase && !eventArgs.RotateLeft && !onRotateLeftPhase) { rotatedRight = true; } }
private void VoiceRotateResponse(object sender, OnRotateEventArgs eventArgs) { EntityCommandBuffer.ParallelWriter commandBuffer = commandBufferSystem.CreateCommandBuffer().AsParallelWriter(); // create a command buffer EntityQuery addRotateTagQuery = GetEntityQuery(addContMovementQueryDesc); // query the entities NativeArray <bool> rotateLeft = new NativeArray <bool>(1, Allocator.TempJob); rotateLeft[0] = eventArgs.RotateLeft; Debug.Log("Left: " + rotateLeft[0]); //Add label job AddRotateTagJob addRotateTagJob = new AddRotateTagJob { commandBuffer = commandBuffer, entityType = GetEntityTypeHandle(), leftTurn = rotateLeft }; JobHandle rotateTagJobHandle = addRotateTagJob.Schedule(addRotateTagQuery, this.Dependency); //schedule the job commandBufferSystem.AddJobHandleForProducer(rotateTagJobHandle); // make sure the components get added/removed for the job this.Dependency = rotateTagJobHandle; }