public Command(Command old) { commandType = old.commandType; target = old.target; destination = old.destination; targetType = old.targetType; }
public Command(Command.commandTypes t, Vehicle target = null, Vector3 destination = default(Vector3)) { commandType = t; this.target = target; this.destination = destination; if (target == null && destination != default(Vector3)) { targetType = targetTypes.Point; } else if (target != null) { targetType = targetTypes.Unit; this.destination = target.vehicleObject.transform.position; } else { Debug.LogError("Command created with invalid parameters"); throw new UnityException(); } }