Пример #1
0
 public Command(Command old)
 {
     commandType = old.commandType;
     target      = old.target;
     destination = old.destination;
     targetType  = old.targetType;
 }
Пример #2
0
    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();
        }
    }