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.
42 lines
1.2 KiB
42 lines
1.2 KiB
4 years ago
|
using UnityEngine;
|
||
|
using System.Collections;
|
||
|
using System;
|
||
|
|
||
|
namespace AX.InputSystem
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// 抽象出的命令基类
|
||
|
/// </summary>
|
||
|
public class Command : ICommand
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// 命令执行方法
|
||
|
/// </summary>
|
||
|
/// <param name="gameObjID"></param>
|
||
|
/// <param name="arg"></param>
|
||
|
public virtual void Execute(long gameObjID, CmdArgs arg)
|
||
|
{
|
||
|
if (!GameSettings.othersSettings.isReplayMode)
|
||
|
{
|
||
|
CmdInfo cmdInfo = GetCmdInfo(gameObjID, arg);
|
||
|
|
||
|
InputHistory.Instance.RegisterInputHistory(cmdInfo);
|
||
|
}
|
||
|
}
|
||
|
private CmdInfo GetCmdInfo(long gameObjID, CmdArgs arg)
|
||
|
{
|
||
|
CmdInfo cmdInfo = new CmdInfo();
|
||
|
cmdInfo.sceneType = InputManager.sceneType;//给场景类型赋值,战斗回放时才知道加载哪个场景(查看战斗回放不在主场景里)
|
||
|
cmdInfo.frameNumber = InputManager.frameCount;
|
||
|
cmdInfo.command = this;
|
||
|
//cmdInfo.gameObj = operatedObj;
|
||
|
|
||
|
cmdInfo.gameObjID = gameObjID;
|
||
|
|
||
|
cmdInfo.arg = arg;
|
||
|
return cmdInfo;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|