You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1.1 KiB
32 lines
1.1 KiB
using AX.InputSystem; |
|
using AX.Network.Protocols; |
|
using AX.Serialization; |
|
using UnityEngine; |
|
|
|
public class CAR_SKILL_SYNC : NetworkMessageBehaviour |
|
{ |
|
protected override void Execute(BinaryMessage message) |
|
{ |
|
//添加回放记录 |
|
InputHistory.Instance.RegisterInputHistory(message); |
|
SkillSyncData skillData = message.Body.Deserialize<SkillSyncData>(); |
|
GameObject go = EntitiesManager.Instance.GetEntityByID(skillData.GameObjectID); |
|
CarSkill skill = go.GetComponent<CarSkill>(); |
|
switch (skillData.Cmd) |
|
{ |
|
case SkillSyncData.CmdType.LiftArm: |
|
skill.ArmLifting(skillData.Position); |
|
break; |
|
case SkillSyncData.CmdType.ArmReset: |
|
skill.ArmReset(); |
|
go.GetComponent<TruckMessage>().IsFixedSupport = skillData.IsFixedSupport; |
|
break; |
|
case SkillSyncData.CmdType.Fixation: |
|
skill.Fixation(); |
|
go.GetComponent<TruckMessage>().IsFixedSupport = skillData.IsFixedSupport; |
|
break; |
|
case SkillSyncData.CmdType.GetOff: |
|
break; |
|
} |
|
} |
|
} |