Beispiel #1
0
    private void OnUnitReached(GuardMovementUnit unitReached)
    {
        transform.position = startPosition + unitReached.GetPoint();
        isFirstMove        = true;

        IncrementNextUnit(unitReached);
    }
Beispiel #2
0
    protected override void Move(GuardMovementUnit curUnit)
    {
        // Get the current move point;
        Vector2 curTargetPos = startPosition + curUnit.GetPoint();

        Vector2 curMoveDir = (curTargetPos - (Vector2)transform.position).normalized;

        // Once we reach our destination
        if (!isFirstMove && curMoveDir != lastMoveDir)
        {
            OnUnitReached(curUnit);
            return;
        }

        isFirstMove = false;
        lastMoveDir = curMoveDir;
        FaceDirection(curMoveDir);
        IncrementPosition(curMoveDir);
    }
Beispiel #3
0
 protected override void Move(GuardMovementUnit curUnit)
 {
     FaceDirection(curUnit.GetPoint());
     IncrementNextUnit(curUnit);
 }