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.
80 lines
2.7 KiB
80 lines
2.7 KiB
using AX.InputSystem; |
|
using AX.NetworkSystem; |
|
using System.Collections; |
|
using System.Collections.Generic; |
|
using System.Reflection; |
|
using UnityEngine; |
|
|
|
public class SkillManager : Singleton<SkillManager> |
|
{ |
|
/// <summary> |
|
/// 举臂技能 |
|
/// </summary> |
|
/// <param name="go">施放技能的对象</param> |
|
/// <param name="pos">举臂地点</param> |
|
public void LiftArm(GameObject go, Vector3 pos) |
|
{ |
|
long id = go.GetComponent<BaseGameObjInfo>().GameObjID; |
|
SkillArgs skillArgs = new SkillArgs(); |
|
skillArgs.GameObjectID = id; |
|
skillArgs.Pos = pos; |
|
ArmLiftingCommand.Instance.Execute(skillArgs.GameObjectID, skillArgs); |
|
//同步数据 |
|
SkillSyncData skillData = new SkillSyncData() |
|
{ |
|
GameObjectID = id, |
|
Position = pos, |
|
Cmd = SkillSyncData.CmdType.LiftArm |
|
}; |
|
NetworkManager.Default.SendAsync("CAR_SKILL_SYNC", skillData); |
|
} |
|
/// <summary> |
|
/// 下车技能 |
|
/// </summary> |
|
/// <param name="go">施放技能的对象</param> |
|
public void GetOff(GameObject go) |
|
{ |
|
long id = go.GetComponent<BaseGameObjInfo>().GameObjID; |
|
SkillArgs skillArgs = new SkillArgs(); |
|
skillArgs.GameObjectID = id; |
|
GetOffCommand.Instance.Execute(skillArgs.GameObjectID, skillArgs); |
|
} |
|
/// <summary> |
|
/// 举臂复位技能 |
|
/// </summary> |
|
/// <param name="go">施放技能的对象</param> |
|
public void ArmReset(GameObject go,bool isfixed) |
|
{ |
|
long id = go.GetComponent<BaseGameObjInfo>().GameObjID; |
|
SkillArgs skillArgs = new SkillArgs(); |
|
skillArgs.GameObjectID = id; |
|
ArmResetCommand.Instance.Execute(skillArgs.GameObjectID, skillArgs); |
|
//同步数据 |
|
SkillSyncData skillData = new SkillSyncData() |
|
{ |
|
IsFixedSupport=isfixed, |
|
GameObjectID = id, |
|
Cmd = SkillSyncData.CmdType.ArmReset |
|
}; |
|
NetworkManager.Default.SendAsync("CAR_SKILL_SYNC", skillData); |
|
} |
|
/// <summary> |
|
/// 固定支架技能 |
|
/// </summary> |
|
/// <param name="go">施放技能的对象</param> |
|
public void Fixation(GameObject go,bool isfixed) |
|
{ |
|
long id = go.GetComponent<BaseGameObjInfo>().GameObjID; |
|
SkillArgs skillArgs = new SkillArgs(); |
|
skillArgs.GameObjectID = id; |
|
FixationCommand.Instance.Execute(skillArgs.GameObjectID, skillArgs); |
|
//同步数据 |
|
SkillSyncData skillData = new SkillSyncData() |
|
{ |
|
IsFixedSupport=isfixed, |
|
GameObjectID = id, |
|
Cmd = SkillSyncData.CmdType.Fixation |
|
}; |
|
NetworkManager.Default.SendAsync("CAR_SKILL_SYNC", skillData); |
|
} |
|
}
|
|
|