using UnityEngine;
using System.Collections;
using System;
namespace AX.InputSystem
{
///
/// 抽象出的命令基类
///
public class Command : ICommand
{
///
/// 命令执行方法
///
///
///
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;
}
}
}