/// <summary> /// This Command has a unit follow another target Unit. it is an indefinite commandand will never move to the next command unless the command queue is flushed. /// </summary> public static Cmd_Follow New(GameObject prGameObject, GameObject prTargetUnit) { Cmd_Follow newCommand = prGameObject.AddComponent <Cmd_Follow>(); newCommand.followedUnit = prTargetUnit; return(newCommand); }
public override void RightClickOnUnit(GameObject TargetUnit) { if (TargetUnit.GetComponent <Player>().Info.Name == GetComponent <Player>().Info.Name) { commandManager.AddCommand(Cmd_Follow.New(transform.gameObject, TargetUnit)); } else { commandManager.AddCommand(Cmd_Attack.New(transform.gameObject, TargetUnit)); } }