Exemple #1
0
 public void RemoveTarget()
 {
     if (target)
     {
         targetControl.Remove(target);
     }
     UpdateTargets(targetControl.GetNames());
     if (targetControl.Count() >= 1)
     {
         SetTarget(targetControl.GetTarget(0));
     }
 }
    /**
     * Elimina la posición (objeto) seleccionada en la lista de posiciones.
     * @return void
     */
    public void RemoveTarget()
    {
        stateMessageControl.NewBlock();
        if (!target)
        {
            stateMessageControl.WriteMessage("Done. Nothing to delete", true);
            return;
        }

        string name = target.GetComponent <TargetModel>().GetName();

        // Delete target
        targetControl.Remove(target);
        // Update targets
        UpdateTargets(targetControl.GetNames());
        if (targetControl.Count() >= 1)
        {
            SetTarget(targetControl.GetTarget(0));
        }

        stateMessageControl.WriteMessage("Done. Deleted \"" + name + "\"", true);
        stateMessageControl.UpdatePositionLog();
    }