Beispiel #1
0
 public int GetPlayerDatakilledByID(GhostDeserializerState deserializerState)
 {
     return((int)PlayerDatakilledByID);
 }
Beispiel #2
0
 public float3 Get__GHOST_FIELD_NAME__(GhostDeserializerState deserializerState)
 {
     return(Get__GHOST_FIELD_NAME__());
 }
 public quaternion GetRotationValue(GhostDeserializerState deserializerState)
 {
     return(GetRotationValue());
 }
 public bool GetUnitSelectionStateIsSelected(GhostDeserializerState deserializerState)
 {
     return(UnitSelectionStateIsSelected != 0);
 }
        public void Execute(ArchetypeChunk chunk, int chunkIndex, int firstEntityIndex)
        {
            var deserializerState = new GhostDeserializerState
            {
                GhostMap = GhostMap
            };
            var ghostEntityArray       = chunk.GetNativeArray(ghostEntityType);
            var ghostSnapshotDataArray = chunk.GetBufferAccessor(ghostSnapshotDataType);
            var ghostCharacterInterpolatedDataArray            = chunk.GetNativeArray(ghostCharacterInterpolatedDataType);
            var ghostCharacterReplicatedDataArray              = chunk.GetNativeArray(ghostCharacterReplicatedDataType);
            var ghostCharacterControllerGroundSupportDataArray = chunk.GetNativeArray(ghostCharacterControllerGroundSupportDataType);
            var ghostCharacterControllerMoveResultArray        = chunk.GetNativeArray(ghostCharacterControllerMoveResultType);
            var ghostCharacterControllerVelocityArray          = chunk.GetNativeArray(ghostCharacterControllerVelocityType);
            var ghostHealthStateDataArray       = chunk.GetNativeArray(ghostHealthStateDataType);
            var ghostInventoryStateArray        = chunk.GetNativeArray(ghostInventoryStateType);
            var ghostPlayerOwnerPlayerIdArray   = chunk.GetNativeArray(ghostPlayerOwnerPlayerIdType);
            var ghostPlayerControlledStateArray = chunk.GetNativeArray(ghostPlayerControlledStateType);
            var ghostLinkedEntityGroupArray     = chunk.GetBufferAccessor(ghostLinkedEntityGroupType);

#if UNITY_EDITOR || DEVELOPMENT_BUILD
            var minMaxOffset = ThreadIndex * (JobsUtility.CacheLineSize / 4);
#endif
            for (int entityIndex = 0; entityIndex < ghostEntityArray.Length; ++entityIndex)
            {
                var snapshot = ghostSnapshotDataArray[entityIndex];
#if UNITY_EDITOR || DEVELOPMENT_BUILD
                var latestTick = snapshot.GetLatestTick();
                if (latestTick != 0)
                {
                    if (minMaxSnapshotTick[minMaxOffset] == 0 || SequenceHelpers.IsNewer(minMaxSnapshotTick[minMaxOffset], latestTick))
                    {
                        minMaxSnapshotTick[minMaxOffset] = latestTick;
                    }
                    if (minMaxSnapshotTick[minMaxOffset + 1] == 0 || SequenceHelpers.IsNewer(latestTick, minMaxSnapshotTick[minMaxOffset + 1]))
                    {
                        minMaxSnapshotTick[minMaxOffset + 1] = latestTick;
                    }
                }
#endif
                Char_BanditSnapshotData snapshotData;
                snapshot.GetDataAtTick(targetTick, targetTickFraction, out snapshotData);

                var ghostCharacterInterpolatedData            = ghostCharacterInterpolatedDataArray[entityIndex];
                var ghostCharacterReplicatedData              = ghostCharacterReplicatedDataArray[entityIndex];
                var ghostCharacterControllerGroundSupportData = ghostCharacterControllerGroundSupportDataArray[entityIndex];
                var ghostCharacterControllerMoveResult        = ghostCharacterControllerMoveResultArray[entityIndex];
                var ghostCharacterControllerVelocity          = ghostCharacterControllerVelocityArray[entityIndex];
                var ghostHealthStateData                        = ghostHealthStateDataArray[entityIndex];
                var ghostInventoryState                         = ghostInventoryStateArray[entityIndex];
                var ghostPlayerOwnerPlayerId                    = ghostPlayerOwnerPlayerIdArray[entityIndex];
                var ghostPlayerControlledState                  = ghostPlayerControlledStateArray[entityIndex];
                var ghostChild0AbilityAbilityControl            = ghostAbilityAbilityControlFromEntity[ghostLinkedEntityGroupArray[entityIndex][1].Value];
                var ghostChild0AbilityMovementInterpolatedState = ghostAbilityMovementInterpolatedStateFromEntity[ghostLinkedEntityGroupArray[entityIndex][1].Value];
                var ghostChild0AbilityMovementPredictedState    = ghostAbilityMovementPredictedStateFromEntity[ghostLinkedEntityGroupArray[entityIndex][1].Value];
                var ghostChild1AbilityAbilityControl            = ghostAbilityAbilityControlFromEntity[ghostLinkedEntityGroupArray[entityIndex][2].Value];
                var ghostChild2AbilityAbilityControl            = ghostAbilityAbilityControlFromEntity[ghostLinkedEntityGroupArray[entityIndex][3].Value];
                var ghostChild2AbilityDashPredictedState        = ghostAbilityDashPredictedStateFromEntity[ghostLinkedEntityGroupArray[entityIndex][3].Value];
                var ghostChild3AbilityAbilityControl            = ghostAbilityAbilityControlFromEntity[ghostLinkedEntityGroupArray[entityIndex][4].Value];
                var ghostChild3AbilityClimbPredictedState       = ghostAbilityClimbPredictedStateFromEntity[ghostLinkedEntityGroupArray[entityIndex][4].Value];
                ghostCharacterInterpolatedData.Position                   = snapshotData.GetCharacterInterpolatedDataPosition(deserializerState);
                ghostCharacterInterpolatedData.rotation                   = snapshotData.GetCharacterInterpolatedDatarotation(deserializerState);
                ghostCharacterInterpolatedData.aimYaw                     = snapshotData.GetCharacterInterpolatedDataaimYaw(deserializerState);
                ghostCharacterInterpolatedData.aimPitch                   = snapshotData.GetCharacterInterpolatedDataaimPitch(deserializerState);
                ghostCharacterInterpolatedData.moveYaw                    = snapshotData.GetCharacterInterpolatedDatamoveYaw(deserializerState);
                ghostCharacterInterpolatedData.charAction                 = snapshotData.GetCharacterInterpolatedDatacharAction(deserializerState);
                ghostCharacterInterpolatedData.charActionTick             = snapshotData.GetCharacterInterpolatedDatacharActionTick(deserializerState);
                ghostCharacterInterpolatedData.damageTick                 = snapshotData.GetCharacterInterpolatedDatadamageTick(deserializerState);
                ghostCharacterInterpolatedData.damageDirection            = snapshotData.GetCharacterInterpolatedDatadamageDirection(deserializerState);
                ghostCharacterInterpolatedData.sprinting                  = snapshotData.GetCharacterInterpolatedDatasprinting(deserializerState);
                ghostCharacterInterpolatedData.sprintWeight               = snapshotData.GetCharacterInterpolatedDatasprintWeight(deserializerState);
                ghostCharacterInterpolatedData.crouchWeight               = snapshotData.GetCharacterInterpolatedDatacrouchWeight(deserializerState);
                ghostCharacterInterpolatedData.selectorTargetSource       = snapshotData.GetCharacterInterpolatedDataselectorTargetSource(deserializerState);
                ghostCharacterInterpolatedData.moveAngleLocal             = snapshotData.GetCharacterInterpolatedDatamoveAngleLocal(deserializerState);
                ghostCharacterInterpolatedData.shootPoseWeight            = snapshotData.GetCharacterInterpolatedDatashootPoseWeight(deserializerState);
                ghostCharacterInterpolatedData.locomotionVector           = snapshotData.GetCharacterInterpolatedDatalocomotionVector(deserializerState);
                ghostCharacterInterpolatedData.locomotionPhase            = snapshotData.GetCharacterInterpolatedDatalocomotionPhase(deserializerState);
                ghostCharacterInterpolatedData.banking                    = snapshotData.GetCharacterInterpolatedDatabanking(deserializerState);
                ghostCharacterInterpolatedData.landAnticWeight            = snapshotData.GetCharacterInterpolatedDatalandAnticWeight(deserializerState);
                ghostCharacterInterpolatedData.turnStartAngle             = snapshotData.GetCharacterInterpolatedDataturnStartAngle(deserializerState);
                ghostCharacterInterpolatedData.turnDirection              = snapshotData.GetCharacterInterpolatedDataturnDirection(deserializerState);
                ghostCharacterInterpolatedData.squashTime                 = snapshotData.GetCharacterInterpolatedDatasquashTime(deserializerState);
                ghostCharacterInterpolatedData.squashWeight               = snapshotData.GetCharacterInterpolatedDatasquashWeight(deserializerState);
                ghostCharacterInterpolatedData.inAirTime                  = snapshotData.GetCharacterInterpolatedDatainAirTime(deserializerState);
                ghostCharacterInterpolatedData.jumpTime                   = snapshotData.GetCharacterInterpolatedDatajumpTime(deserializerState);
                ghostCharacterInterpolatedData.simpleTime                 = snapshotData.GetCharacterInterpolatedDatasimpleTime(deserializerState);
                ghostCharacterInterpolatedData.footIkOffset               = snapshotData.GetCharacterInterpolatedDatafootIkOffset(deserializerState);
                ghostCharacterInterpolatedData.footIkNormalLeft           = snapshotData.GetCharacterInterpolatedDatafootIkNormalLeft(deserializerState);
                ghostCharacterInterpolatedData.footIkNormalRight          = snapshotData.GetCharacterInterpolatedDatafootIkNormalRight(deserializerState);
                ghostCharacterInterpolatedData.footIkWeight               = snapshotData.GetCharacterInterpolatedDatafootIkWeight(deserializerState);
                ghostCharacterInterpolatedData.blendOutAim                = snapshotData.GetCharacterInterpolatedDatablendOutAim(deserializerState);
                ghostCharacterReplicatedData.heroTypeIndex                = snapshotData.GetCharacterReplicatedDataheroTypeIndex(deserializerState);
                ghostCharacterControllerGroundSupportData.SurfaceNormal   = snapshotData.GetCharacterControllerGroundSupportDataSurfaceNormal(deserializerState);
                ghostCharacterControllerGroundSupportData.SurfaceVelocity = snapshotData.GetCharacterControllerGroundSupportDataSurfaceVelocity(deserializerState);
                ghostCharacterControllerGroundSupportData.SupportedState  = snapshotData.GetCharacterControllerGroundSupportDataSupportedState(deserializerState);
                ghostCharacterControllerMoveResult.MoveResult             = snapshotData.GetCharacterControllerMoveResultMoveResult(deserializerState);
                ghostCharacterControllerVelocity.Velocity                 = snapshotData.GetCharacterControllerVelocityVelocity(deserializerState);
                ghostHealthStateData.health    = snapshotData.GetHealthStateDatahealth(deserializerState);
                ghostInventoryState.activeSlot = snapshotData.GetInventoryStateactiveSlot(deserializerState);
                ghostPlayerOwnerPlayerId.Value = snapshotData.GetPlayerOwnerPlayerIdValue(deserializerState);
                ghostPlayerControlledState.resetCommandTick               = snapshotData.GetPlayerControlledStateresetCommandTick(deserializerState);
                ghostPlayerControlledState.resetCommandLookYaw            = snapshotData.GetPlayerControlledStateresetCommandLookYaw(deserializerState);
                ghostPlayerControlledState.resetCommandLookPitch          = snapshotData.GetPlayerControlledStateresetCommandLookPitch(deserializerState);
                ghostChild0AbilityAbilityControl.behaviorState            = snapshotData.GetChild0AbilityAbilityControlbehaviorState(deserializerState);
                ghostChild0AbilityAbilityControl.requestDeactivate        = snapshotData.GetChild0AbilityAbilityControlrequestDeactivate(deserializerState);
                ghostChild0AbilityMovementInterpolatedState.charLocoState = snapshotData.GetChild0AbilityMovementInterpolatedStatecharLocoState(deserializerState);
                ghostChild0AbilityMovementInterpolatedState.charLocoTick  = snapshotData.GetChild0AbilityMovementInterpolatedStatecharLocoTick(deserializerState);
                ghostChild0AbilityMovementInterpolatedState.crouching     = snapshotData.GetChild0AbilityMovementInterpolatedStatecrouching(deserializerState);
                ghostChild0AbilityMovementPredictedState.locoState        = snapshotData.GetChild0AbilityMovementPredictedStatelocoState(deserializerState);
                ghostChild0AbilityMovementPredictedState.locoStartTick    = snapshotData.GetChild0AbilityMovementPredictedStatelocoStartTick(deserializerState);
                ghostChild0AbilityMovementPredictedState.jumpCount        = snapshotData.GetChild0AbilityMovementPredictedStatejumpCount(deserializerState);
                ghostChild0AbilityMovementPredictedState.crouching        = snapshotData.GetChild0AbilityMovementPredictedStatecrouching(deserializerState);
                ghostChild1AbilityAbilityControl.behaviorState            = snapshotData.GetChild1AbilityAbilityControlbehaviorState(deserializerState);
                ghostChild1AbilityAbilityControl.requestDeactivate        = snapshotData.GetChild1AbilityAbilityControlrequestDeactivate(deserializerState);
                ghostChild2AbilityAbilityControl.behaviorState            = snapshotData.GetChild2AbilityAbilityControlbehaviorState(deserializerState);
                ghostChild2AbilityAbilityControl.requestDeactivate        = snapshotData.GetChild2AbilityAbilityControlrequestDeactivate(deserializerState);
                ghostChild2AbilityDashPredictedState.locoState            = snapshotData.GetChild2AbilityDashPredictedStatelocoState(deserializerState);
                ghostChild2AbilityDashPredictedState.locoStartTick        = snapshotData.GetChild2AbilityDashPredictedStatelocoStartTick(deserializerState);
                ghostChild2AbilityDashPredictedState.startVelocity        = snapshotData.GetChild2AbilityDashPredictedStatestartVelocity(deserializerState);
                ghostChild3AbilityAbilityControl.behaviorState            = snapshotData.GetChild3AbilityAbilityControlbehaviorState(deserializerState);
                ghostChild3AbilityAbilityControl.requestDeactivate        = snapshotData.GetChild3AbilityAbilityControlrequestDeactivate(deserializerState);
                ghostChild3AbilityClimbPredictedState.locoState           = snapshotData.GetChild3AbilityClimbPredictedStatelocoState(deserializerState);
                ghostChild3AbilityClimbPredictedState.SurfaceNormal       = snapshotData.GetChild3AbilityClimbPredictedStateSurfaceNormal(deserializerState);
                ghostChild3AbilityClimbPredictedState.SurfaceVelocity     = snapshotData.GetChild3AbilityClimbPredictedStateSurfaceVelocity(deserializerState);
                ghostChild3AbilityClimbPredictedState.SupportedState      = snapshotData.GetChild3AbilityClimbPredictedStateSupportedState(deserializerState);
                ghostAbilityAbilityControlFromEntity[ghostLinkedEntityGroupArray[entityIndex][1].Value]            = ghostChild0AbilityAbilityControl;
                ghostAbilityMovementInterpolatedStateFromEntity[ghostLinkedEntityGroupArray[entityIndex][1].Value] = ghostChild0AbilityMovementInterpolatedState;
                ghostAbilityMovementPredictedStateFromEntity[ghostLinkedEntityGroupArray[entityIndex][1].Value]    = ghostChild0AbilityMovementPredictedState;
                ghostAbilityAbilityControlFromEntity[ghostLinkedEntityGroupArray[entityIndex][2].Value]            = ghostChild1AbilityAbilityControl;
                ghostAbilityAbilityControlFromEntity[ghostLinkedEntityGroupArray[entityIndex][3].Value]            = ghostChild2AbilityAbilityControl;
                ghostAbilityDashPredictedStateFromEntity[ghostLinkedEntityGroupArray[entityIndex][3].Value]        = ghostChild2AbilityDashPredictedState;
                ghostAbilityAbilityControlFromEntity[ghostLinkedEntityGroupArray[entityIndex][4].Value]            = ghostChild3AbilityAbilityControl;
                ghostAbilityClimbPredictedStateFromEntity[ghostLinkedEntityGroupArray[entityIndex][4].Value]       = ghostChild3AbilityClimbPredictedState;
                ghostCharacterInterpolatedDataArray[entityIndex]            = ghostCharacterInterpolatedData;
                ghostCharacterReplicatedDataArray[entityIndex]              = ghostCharacterReplicatedData;
                ghostCharacterControllerGroundSupportDataArray[entityIndex] = ghostCharacterControllerGroundSupportData;
                ghostCharacterControllerMoveResultArray[entityIndex]        = ghostCharacterControllerMoveResult;
                ghostCharacterControllerVelocityArray[entityIndex]          = ghostCharacterControllerVelocity;
                ghostHealthStateDataArray[entityIndex]       = ghostHealthStateData;
                ghostInventoryStateArray[entityIndex]        = ghostInventoryState;
                ghostPlayerOwnerPlayerIdArray[entityIndex]   = ghostPlayerOwnerPlayerId;
                ghostPlayerControlledStateArray[entityIndex] = ghostPlayerControlledState;
            }
        }
Beispiel #6
0
 public int GetAttackSeed(GhostDeserializerState deserializerState)
 {
     return((int)AttackSeed);
 }
 public float GetHealthValue(GhostDeserializerState deserializerState)
 {
     return(HealthValue * 0.01f);
 }
Beispiel #8
0
 public int GetPlayerDatamaxHealth(GhostDeserializerState deserializerState)
 {
     return((int)PlayerDatamaxHealth);
 }
Beispiel #9
0
 public int GetPlayerDatapower(GhostDeserializerState deserializerState)
 {
     return((int)PlayerDatapower);
 }
Beispiel #10
0
 public int GetDamageDamageType(GhostDeserializerState deserializerState)
 {
     return((int)DamageDamageType);
 }
Beispiel #11
0
 public int GetMovableCharacterComponentPlayerId(GhostDeserializerState deserializerState)
 {
     return((int)MovableCharacterComponentPlayerId);
 }
Beispiel #12
0
 public bool GetAttackNeedApplyDamage(GhostDeserializerState deserializerState)
 {
     return(AttackNeedApplyDamage != 0);
 }
Beispiel #13
0
 public bool GetPlayerDatadeath(GhostDeserializerState deserializerState)
 {
     return(PlayerDatadeath != 0);
 }
Beispiel #14
0
 public int GetPlayerDataplayerId(GhostDeserializerState deserializerState)
 {
     return((int)PlayerDataplayerId);
 }
Beispiel #15
0
 public uint GetPrefabCreatorSkinId(GhostDeserializerState deserializerState)
 {
     return((uint)PrefabCreatorSkinId);
 }
Beispiel #16
0
 public int GetPlayerDatamagic(GhostDeserializerState deserializerState)
 {
     return((int)PlayerDatamagic);
 }
Beispiel #17
0
 public NativeString64 GetPrefabCreatorSkinSetting(GhostDeserializerState deserializerState)
 {
     return(PrefabCreatorSkinSetting);
 }
Beispiel #18
0
 public int GetPlayerDatadamageRadius(GhostDeserializerState deserializerState)
 {
     return((int)PlayerDatadamageRadius);
 }
Beispiel #19
0
 public float2 GetAttackAttackDirection(GhostDeserializerState deserializerState)
 {
     return(GetAttackAttackDirection());
 }
Beispiel #20
0
 public uint GetPlayerDatainventory(GhostDeserializerState deserializerState)
 {
     return((uint)PlayerDatainventory);
 }
 public int GetPlayerUnitUnitId(GhostDeserializerState deserializerState)
 {
     return((int)PlayerUnitUnitId);
 }
Beispiel #22
0
 public int GetPlayerDatautilsSkillId(GhostDeserializerState deserializerState)
 {
     return((int)PlayerDatautilsSkillId);
 }
        public void Execute(ArchetypeChunk chunk, int chunkIndex, int firstEntityIndex)
        {
            var deserializerState = new GhostDeserializerState
            {
                GhostMap = GhostMap
            };
            var ghostEntityArray                  = chunk.GetNativeArray(ghostEntityType);
            var ghostSnapshotDataArray            = chunk.GetBufferAccessor(ghostSnapshotDataType);
            var predictedGhostComponentArray      = chunk.GetNativeArray(predictedGhostComponentType);
            var ghostCharacterPredictedDataArray  = chunk.GetNativeArray(ghostCharacterPredictedDataType);
            var ghostCharacterReplicatedDataArray = chunk.GetNativeArray(ghostCharacterReplicatedDataType);
            var ghostCharacterControllerGroundSupportDataArray = chunk.GetNativeArray(ghostCharacterControllerGroundSupportDataType);
            var ghostCharacterControllerMoveResultArray        = chunk.GetNativeArray(ghostCharacterControllerMoveResultType);
            var ghostCharacterControllerVelocityArray          = chunk.GetNativeArray(ghostCharacterControllerVelocityType);
            var ghostHealthStateDataArray       = chunk.GetNativeArray(ghostHealthStateDataType);
            var ghostInventoryStateArray        = chunk.GetNativeArray(ghostInventoryStateType);
            var ghostPlayerOwnerPlayerIdArray   = chunk.GetNativeArray(ghostPlayerOwnerPlayerIdType);
            var ghostPlayerControlledStateArray = chunk.GetNativeArray(ghostPlayerControlledStateType);
            var ghostLinkedEntityGroupArray     = chunk.GetBufferAccessor(ghostLinkedEntityGroupType);

#if UNITY_EDITOR || DEVELOPMENT_BUILD
            var minMaxOffset = ThreadIndex * (JobsUtility.CacheLineSize / 4);
#endif
            for (int entityIndex = 0; entityIndex < ghostEntityArray.Length; ++entityIndex)
            {
                var snapshot = ghostSnapshotDataArray[entityIndex];
#if UNITY_EDITOR || DEVELOPMENT_BUILD
                var latestTick = snapshot.GetLatestTick();
                if (latestTick != 0)
                {
                    if (minMaxSnapshotTick[minMaxOffset] == 0 || SequenceHelpers.IsNewer(minMaxSnapshotTick[minMaxOffset], latestTick))
                    {
                        minMaxSnapshotTick[minMaxOffset] = latestTick;
                    }
                    if (minMaxSnapshotTick[minMaxOffset + 1] == 0 || SequenceHelpers.IsNewer(latestTick, minMaxSnapshotTick[minMaxOffset + 1]))
                    {
                        minMaxSnapshotTick[minMaxOffset + 1] = latestTick;
                    }
                }
#endif
                Char_BanditSnapshotData snapshotData;
                snapshot.GetDataAtTick(targetTick, out snapshotData);

                var predictedData         = predictedGhostComponentArray[entityIndex];
                var lastPredictedTickInst = lastPredictedTick;
                if (lastPredictedTickInst == 0 || predictedData.AppliedTick != snapshotData.Tick)
                {
                    lastPredictedTickInst = snapshotData.Tick;
                }
                else if (!SequenceHelpers.IsNewer(lastPredictedTickInst, snapshotData.Tick))
                {
                    lastPredictedTickInst = snapshotData.Tick;
                }
                if (minPredictedTick[ThreadIndex] == 0 || SequenceHelpers.IsNewer(minPredictedTick[ThreadIndex], lastPredictedTickInst))
                {
                    minPredictedTick[ThreadIndex] = lastPredictedTickInst;
                }
                predictedGhostComponentArray[entityIndex] = new PredictedGhostComponent {
                    AppliedTick = snapshotData.Tick, PredictionStartTick = lastPredictedTickInst
                };
                if (lastPredictedTickInst != snapshotData.Tick)
                {
                    continue;
                }

                var ghostCharacterPredictedData  = ghostCharacterPredictedDataArray[entityIndex];
                var ghostCharacterReplicatedData = ghostCharacterReplicatedDataArray[entityIndex];
                var ghostCharacterControllerGroundSupportData = ghostCharacterControllerGroundSupportDataArray[entityIndex];
                var ghostCharacterControllerMoveResult        = ghostCharacterControllerMoveResultArray[entityIndex];
                var ghostCharacterControllerVelocity          = ghostCharacterControllerVelocityArray[entityIndex];
                var ghostHealthStateData                        = ghostHealthStateDataArray[entityIndex];
                var ghostInventoryState                         = ghostInventoryStateArray[entityIndex];
                var ghostPlayerOwnerPlayerId                    = ghostPlayerOwnerPlayerIdArray[entityIndex];
                var ghostPlayerControlledState                  = ghostPlayerControlledStateArray[entityIndex];
                var ghostChild0AbilityAbilityControl            = ghostAbilityAbilityControlFromEntity[ghostLinkedEntityGroupArray[entityIndex][1].Value];
                var ghostChild0AbilityMovementInterpolatedState = ghostAbilityMovementInterpolatedStateFromEntity[ghostLinkedEntityGroupArray[entityIndex][1].Value];
                var ghostChild0AbilityMovementPredictedState    = ghostAbilityMovementPredictedStateFromEntity[ghostLinkedEntityGroupArray[entityIndex][1].Value];
                var ghostChild1AbilityAbilityControl            = ghostAbilityAbilityControlFromEntity[ghostLinkedEntityGroupArray[entityIndex][2].Value];
                var ghostChild2AbilityAbilityControl            = ghostAbilityAbilityControlFromEntity[ghostLinkedEntityGroupArray[entityIndex][3].Value];
                var ghostChild2AbilityDashPredictedState        = ghostAbilityDashPredictedStateFromEntity[ghostLinkedEntityGroupArray[entityIndex][3].Value];
                var ghostChild3AbilityAbilityControl            = ghostAbilityAbilityControlFromEntity[ghostLinkedEntityGroupArray[entityIndex][4].Value];
                var ghostChild3AbilityClimbPredictedState       = ghostAbilityClimbPredictedStateFromEntity[ghostLinkedEntityGroupArray[entityIndex][4].Value];
                ghostCharacterPredictedData.tick                          = snapshotData.GetCharacterPredictedDatatick(deserializerState);
                ghostCharacterPredictedData.position                      = snapshotData.GetCharacterPredictedDataposition(deserializerState);
                ghostCharacterPredictedData.velocity                      = snapshotData.GetCharacterPredictedDatavelocity(deserializerState);
                ghostCharacterPredictedData.sprinting                     = snapshotData.GetCharacterPredictedDatasprinting(deserializerState);
                ghostCharacterPredictedData.cameraProfile                 = snapshotData.GetCharacterPredictedDatacameraProfile(deserializerState);
                ghostCharacterPredictedData.damageTick                    = snapshotData.GetCharacterPredictedDatadamageTick(deserializerState);
                ghostCharacterPredictedData.damageDirection               = snapshotData.GetCharacterPredictedDatadamageDirection(deserializerState);
                ghostCharacterReplicatedData.heroTypeIndex                = snapshotData.GetCharacterReplicatedDataheroTypeIndex(deserializerState);
                ghostCharacterControllerGroundSupportData.SurfaceNormal   = snapshotData.GetCharacterControllerGroundSupportDataSurfaceNormal(deserializerState);
                ghostCharacterControllerGroundSupportData.SurfaceVelocity = snapshotData.GetCharacterControllerGroundSupportDataSurfaceVelocity(deserializerState);
                ghostCharacterControllerGroundSupportData.SupportedState  = snapshotData.GetCharacterControllerGroundSupportDataSupportedState(deserializerState);
                ghostCharacterControllerMoveResult.MoveResult             = snapshotData.GetCharacterControllerMoveResultMoveResult(deserializerState);
                ghostCharacterControllerVelocity.Velocity                 = snapshotData.GetCharacterControllerVelocityVelocity(deserializerState);
                ghostHealthStateData.health    = snapshotData.GetHealthStateDatahealth(deserializerState);
                ghostInventoryState.activeSlot = snapshotData.GetInventoryStateactiveSlot(deserializerState);
                ghostPlayerOwnerPlayerId.Value = snapshotData.GetPlayerOwnerPlayerIdValue(deserializerState);
                ghostPlayerControlledState.resetCommandTick               = snapshotData.GetPlayerControlledStateresetCommandTick(deserializerState);
                ghostPlayerControlledState.resetCommandLookYaw            = snapshotData.GetPlayerControlledStateresetCommandLookYaw(deserializerState);
                ghostPlayerControlledState.resetCommandLookPitch          = snapshotData.GetPlayerControlledStateresetCommandLookPitch(deserializerState);
                ghostChild0AbilityAbilityControl.behaviorState            = snapshotData.GetChild0AbilityAbilityControlbehaviorState(deserializerState);
                ghostChild0AbilityAbilityControl.requestDeactivate        = snapshotData.GetChild0AbilityAbilityControlrequestDeactivate(deserializerState);
                ghostChild0AbilityMovementInterpolatedState.charLocoState = snapshotData.GetChild0AbilityMovementInterpolatedStatecharLocoState(deserializerState);
                ghostChild0AbilityMovementInterpolatedState.charLocoTick  = snapshotData.GetChild0AbilityMovementInterpolatedStatecharLocoTick(deserializerState);
                ghostChild0AbilityMovementInterpolatedState.crouching     = snapshotData.GetChild0AbilityMovementInterpolatedStatecrouching(deserializerState);
                ghostChild0AbilityMovementPredictedState.locoState        = snapshotData.GetChild0AbilityMovementPredictedStatelocoState(deserializerState);
                ghostChild0AbilityMovementPredictedState.locoStartTick    = snapshotData.GetChild0AbilityMovementPredictedStatelocoStartTick(deserializerState);
                ghostChild0AbilityMovementPredictedState.jumpCount        = snapshotData.GetChild0AbilityMovementPredictedStatejumpCount(deserializerState);
                ghostChild0AbilityMovementPredictedState.crouching        = snapshotData.GetChild0AbilityMovementPredictedStatecrouching(deserializerState);
                ghostChild1AbilityAbilityControl.behaviorState            = snapshotData.GetChild1AbilityAbilityControlbehaviorState(deserializerState);
                ghostChild1AbilityAbilityControl.requestDeactivate        = snapshotData.GetChild1AbilityAbilityControlrequestDeactivate(deserializerState);
                ghostChild2AbilityAbilityControl.behaviorState            = snapshotData.GetChild2AbilityAbilityControlbehaviorState(deserializerState);
                ghostChild2AbilityAbilityControl.requestDeactivate        = snapshotData.GetChild2AbilityAbilityControlrequestDeactivate(deserializerState);
                ghostChild2AbilityDashPredictedState.locoState            = snapshotData.GetChild2AbilityDashPredictedStatelocoState(deserializerState);
                ghostChild2AbilityDashPredictedState.locoStartTick        = snapshotData.GetChild2AbilityDashPredictedStatelocoStartTick(deserializerState);
                ghostChild2AbilityDashPredictedState.startVelocity        = snapshotData.GetChild2AbilityDashPredictedStatestartVelocity(deserializerState);
                ghostChild3AbilityAbilityControl.behaviorState            = snapshotData.GetChild3AbilityAbilityControlbehaviorState(deserializerState);
                ghostChild3AbilityAbilityControl.requestDeactivate        = snapshotData.GetChild3AbilityAbilityControlrequestDeactivate(deserializerState);
                ghostChild3AbilityClimbPredictedState.locoState           = snapshotData.GetChild3AbilityClimbPredictedStatelocoState(deserializerState);
                ghostChild3AbilityClimbPredictedState.SurfaceNormal       = snapshotData.GetChild3AbilityClimbPredictedStateSurfaceNormal(deserializerState);
                ghostChild3AbilityClimbPredictedState.SurfaceVelocity     = snapshotData.GetChild3AbilityClimbPredictedStateSurfaceVelocity(deserializerState);
                ghostChild3AbilityClimbPredictedState.SupportedState      = snapshotData.GetChild3AbilityClimbPredictedStateSupportedState(deserializerState);
                ghostAbilityAbilityControlFromEntity[ghostLinkedEntityGroupArray[entityIndex][1].Value]            = ghostChild0AbilityAbilityControl;
                ghostAbilityMovementInterpolatedStateFromEntity[ghostLinkedEntityGroupArray[entityIndex][1].Value] = ghostChild0AbilityMovementInterpolatedState;
                ghostAbilityMovementPredictedStateFromEntity[ghostLinkedEntityGroupArray[entityIndex][1].Value]    = ghostChild0AbilityMovementPredictedState;
                ghostAbilityAbilityControlFromEntity[ghostLinkedEntityGroupArray[entityIndex][2].Value]            = ghostChild1AbilityAbilityControl;
                ghostAbilityAbilityControlFromEntity[ghostLinkedEntityGroupArray[entityIndex][3].Value]            = ghostChild2AbilityAbilityControl;
                ghostAbilityDashPredictedStateFromEntity[ghostLinkedEntityGroupArray[entityIndex][3].Value]        = ghostChild2AbilityDashPredictedState;
                ghostAbilityAbilityControlFromEntity[ghostLinkedEntityGroupArray[entityIndex][4].Value]            = ghostChild3AbilityAbilityControl;
                ghostAbilityClimbPredictedStateFromEntity[ghostLinkedEntityGroupArray[entityIndex][4].Value]       = ghostChild3AbilityClimbPredictedState;
                ghostCharacterPredictedDataArray[entityIndex]  = ghostCharacterPredictedData;
                ghostCharacterReplicatedDataArray[entityIndex] = ghostCharacterReplicatedData;
                ghostCharacterControllerGroundSupportDataArray[entityIndex] = ghostCharacterControllerGroundSupportData;
                ghostCharacterControllerMoveResultArray[entityIndex]        = ghostCharacterControllerMoveResult;
                ghostCharacterControllerVelocityArray[entityIndex]          = ghostCharacterControllerVelocity;
                ghostHealthStateDataArray[entityIndex]       = ghostHealthStateData;
                ghostInventoryStateArray[entityIndex]        = ghostInventoryState;
                ghostPlayerOwnerPlayerIdArray[entityIndex]   = ghostPlayerOwnerPlayerId;
                ghostPlayerControlledStateArray[entityIndex] = ghostPlayerControlledState;
            }
        }
Beispiel #24
0
 public float GetPlayerDataspeedMod(GhostDeserializerState deserializerState)
 {
     return(PlayerDataspeedMod);
 }
 public __GHOST_FIELD_TYPE_NAME__ Get__GHOST_FIELD_NAME__(GhostDeserializerState deserializerState)
 {
     return((__GHOST_FIELD_TYPE_NAME__)__GHOST_FIELD_NAME__);
 }
Beispiel #26
0
 public bool GetPlayerDatastun(GhostDeserializerState deserializerState)
 {
     return(PlayerDatastun != 0);
 }
        public void Execute(ArchetypeChunk chunk, int chunkIndex, int firstEntityIndex)
        {
            var deserializerState = new GhostDeserializerState
            {
                GhostMap = GhostMap
            };
            var ghostEntityArray             = chunk.GetNativeArray(ghostEntityType);
            var ghostSnapshotDataArray       = chunk.GetBufferAccessor(ghostSnapshotDataType);
            var predictedGhostComponentArray = chunk.GetNativeArray(predictedGhostComponentType);
            var ghostRotationArray           = chunk.GetNativeArray(ghostRotationType);
            var ghostTranslationArray        = chunk.GetNativeArray(ghostTranslationType);

#if UNITY_EDITOR || DEVELOPMENT_BUILD
            var minMaxOffset = ThreadIndex * (JobsUtility.CacheLineSize / 4);
#endif
            for (int entityIndex = 0; entityIndex < ghostEntityArray.Length; ++entityIndex)
            {
                var snapshot = ghostSnapshotDataArray[entityIndex];
#if UNITY_EDITOR || DEVELOPMENT_BUILD
                var latestTick = snapshot.GetLatestTick();
                if (latestTick != 0)
                {
                    if (minMaxSnapshotTick[minMaxOffset] == 0 || SequenceHelpers.IsNewer(minMaxSnapshotTick[minMaxOffset], latestTick))
                    {
                        minMaxSnapshotTick[minMaxOffset] = latestTick;
                    }
                    if (minMaxSnapshotTick[minMaxOffset + 1] == 0 || SequenceHelpers.IsNewer(latestTick, minMaxSnapshotTick[minMaxOffset + 1]))
                    {
                        minMaxSnapshotTick[minMaxOffset + 1] = latestTick;
                    }
                }
#endif
                CubeSnapshotData snapshotData;
                snapshot.GetDataAtTick(targetTick, out snapshotData);

                var predictedData         = predictedGhostComponentArray[entityIndex];
                var lastPredictedTickInst = lastPredictedTick;
                if (lastPredictedTickInst == 0 || predictedData.AppliedTick != snapshotData.Tick)
                {
                    lastPredictedTickInst = snapshotData.Tick;
                }
                else if (!SequenceHelpers.IsNewer(lastPredictedTickInst, snapshotData.Tick))
                {
                    lastPredictedTickInst = snapshotData.Tick;
                }
                if (minPredictedTick[ThreadIndex] == 0 || SequenceHelpers.IsNewer(minPredictedTick[ThreadIndex], lastPredictedTickInst))
                {
                    minPredictedTick[ThreadIndex] = lastPredictedTickInst;
                }
                predictedGhostComponentArray[entityIndex] = new PredictedGhostComponent {
                    AppliedTick = snapshotData.Tick, PredictionStartTick = lastPredictedTickInst
                };
                if (lastPredictedTickInst != snapshotData.Tick)
                {
                    continue;
                }

                var ghostRotation    = ghostRotationArray[entityIndex];
                var ghostTranslation = ghostTranslationArray[entityIndex];
                ghostRotation.Value                = snapshotData.GetRotationValue(deserializerState);
                ghostTranslation.Value             = snapshotData.GetTranslationValue(deserializerState);
                ghostRotationArray[entityIndex]    = ghostRotation;
                ghostTranslationArray[entityIndex] = ghostTranslation;
            }
        }
Beispiel #28
0
 public int GetAttackAttackType(GhostDeserializerState deserializerState)
 {
     return((int)AttackAttackType);
 }
 public float3 GetTranslationValue(GhostDeserializerState deserializerState)
 {
     return(GetTranslationValue());
 }
Beispiel #30
0
 public float3 GetPlayerDatadest2(GhostDeserializerState deserializerState)
 {
     return(GetPlayerDatadest2());
 }