コード例 #1
0
    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));
    }
コード例 #2
0
        private void DelegateRays(Ray ray)
        {
            UpdatePos?.Invoke(ray);

            if (Input.GetMouseButtonDown(0))
            {
                LClickPos?.Invoke(ray);
            }
        }
コード例 #3
0
ファイル: PlayerSyncPosition.cs プロジェクト: Geor23/Planets
 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
     }
 }
コード例 #4
0
ファイル: PlayerSyncPosition.cs プロジェクト: Geor23/Planets
 public void TargetUpdatePos(UpdatePos up)
 {
     syncPos = up.pos;
 }