Beispiel #1
0
    MovementOrderTuple MovementOrderToTuple(AbstractMovementOrder order)
    {
        WaypointUI         ui = SimplePool.Spawn(waypointUI).GetComponent <WaypointUI>();
        MovementOrderTuple result;

        if (order is MoveFaceOrder)
        {
            FacingUI facing = SimplePool.Spawn(facingUI).GetComponent <FacingUI>();
            result           = new MoveFaceOrderTuple(order, ui, facing);
            facing.Position  = order.Position;
            facing.Direction = (order as MoveFaceOrder).FacingDirection;
        }
        else
        {
            result = new MovementOrderTuple(order, ui);
        }

        ui.Start = movementOrders.Count != 0 ? ui.Start = movementOrders.Last <MovementOrderTuple>().order.Position : (Vector2)(this.transform.position);
        ui.End   = order.Position;
        return(result);
    }
Beispiel #2
0
 public MoveFaceOrderTuple(AbstractMovementOrder order, WaypointUI ui, FacingUI facingUI)
     : base(order, ui)
 {
     this.facingUI = facingUI;
 }