protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
        var topGroup = World.GetExistingSystem <ClientSimulationSystemGroup>();

        RenderInterpolationSystem.parameters.startTime      = topGroup.UpdateTime;
        RenderInterpolationSystem.parameters.fixedDeltaTime = topGroup.UpdateDeltaTime;

        var posJob = new UpdatePos();

        posJob.positionType             = GetArchetypeChunkComponentType <Translation>();
        posJob.curPositionType          = GetArchetypeChunkComponentType <CurrentSimulatedPosition>(true);
        posJob.prevPositionType         = GetArchetypeChunkComponentType <PreviousSimulatedPosition>();
        posJob.simStartComponentVersion = simStartComponentVersion;
        posJob.simEndComponentVersion   = simEndComponentVersion;

        var rotJob = new UpdateRot();

        rotJob.rotationType             = GetArchetypeChunkComponentType <Rotation>();
        rotJob.curRotationType          = GetArchetypeChunkComponentType <CurrentSimulatedRotation>(true);
        rotJob.prevRotationType         = GetArchetypeChunkComponentType <PreviousSimulatedRotation>();
        rotJob.simStartComponentVersion = simStartComponentVersion;
        rotJob.simEndComponentVersion   = simEndComponentVersion;

        var handles = new NativeArray <JobHandle>(2, Allocator.Temp);

        handles[0] = posJob.Schedule(positionInterpolationGroup, inputDeps);
        handles[1] = rotJob.Schedule(rotationInterpolationGroup, inputDeps);

        simStartComponentVersion = GlobalSystemVersion;

        return(JobHandle.CombineDependencies(handles));
    }
        private void DelegateRays(Ray ray)
        {
            UpdatePos?.Invoke(ray);

            if (Input.GetMouseButtonDown(0))
            {
                LClickPos?.Invoke(ray);
            }
        }
Ejemplo n.º 3
0
 void CmdProvidePositionToServer(Vector3 pos)
 {
     syncPos = pos;
     foreach (NetworkConnection nc in ((PlanetsNetworkManager)PlanetsNetworkManager.singleton).getUpdateListeners(updateAll)){
         #if UNITY_5_4_OR_NEWER
         TargetUpdatePos(nc, pos);
         #else
         UpdatePos up = new UpdatePos();
         up.netId = nIdentity.netId;
         up.pos = pos;
         NetworkServer.SendToClient(nc.connectionId, Msgs.updatePos, up);
         #endif
     }
 }
Ejemplo n.º 4
0
 public void TargetUpdatePos(UpdatePos up)
 {
     syncPos = up.pos;
 }