Exemplo n.º 1
0
    /// <summary>
    /// this command moves the unit to a building and calls the replace unit function
    /// </summary>

    public static Cmd_humanEquip New(GameObject prGameObject, GameObject prBuildingToEquip)
    {
        Cmd_humanEquip newcommand = prGameObject.AddComponent <Cmd_humanEquip>();

        newcommand.targetBuilding = prBuildingToEquip;

        return(newcommand);
    }
Exemplo n.º 2
0
 public override void RightClickOnStructure(GameObject TargetUnit)
 {
     if (TargetUnit.GetComponent <StockManager>() != null)
     {
         commandManager.AddCommand(Cmd_humanEquip.New(gameObject, TargetUnit));
         return;
     }
     if (TargetUnit.GetComponent <Player>().Info.Name == GetComponent <Player>().Info.Name)
     {
         commandManager.AddCommand(Cmd_Move.New(transform.gameObject, TargetUnit.transform.position));
     }
     else
     {
         commandManager.AddCommand(Cmd_Attack.New(transform.gameObject, TargetUnit));
     }
 }