Esempio n. 1
0
    /// <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);
    }
Esempio n. 2
0
 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));
     }
 }