public static void EnqueueLookMovement(SplineMovement nextLookMovement) { if (CurrentLookMovement == null) { AssignNextLookMovement(nextLookMovement); } else { WaitingLookMovements.Enqueue(nextLookMovement); } }
private static void ConcludeLookMovement(SplineMovement currentLookMovement) { PriorLookPoint = CurrentLookPoint; CurrentLookPoint = currentLookMovement.TargetTransform; if (WaitingLookMovements.Any()) { AssignNextLookMovement(WaitingLookMovements.Dequeue()); } else { CurrentLookMovement = null; } }
private static void AssignNextLookMovement(SplineMovement nextLookMovement) { CurrentLookMovement = nextLookMovement; // if (AwaitingStartLookPosition) // { // PriorLookPoint = CurrentLookMovement.TargetTransform; // CurrentLookPoint = CurrentLookMovement.TargetTransform; // AwaitingStartLookPosition = false; // } NextLookPoint = CurrentLookMovement.TargetTransform; CurrentLookMovement.OnMovementCompleted += HandleLookMovementCompleted; SwitchingLookMovements = true; }
private static void AssignNextMovement(SplineMovement nextMovement) { CurrentMovement = nextMovement; if (AwaitingStartPosition) { PriorPoint = CurrentMovement.TargetTransform; CurrentPoint = CurrentMovement.TargetTransform; AwaitingStartPosition = false; } NextPoint = CurrentMovement.TargetTransform; CurrentMovement.OnMovementCompleted += HandleMovementCompleted; SwitchingMovements = true; }