protected override void SnapPathMover(PathMover pathMover, float progress, bool force) { if (null == path) { return; } var position = path.PositionAt(progress); MovePathMoverToLocalPosition(pathMover, position, force); }
protected virtual void MovePathMoverToLocalPosition(PathMover pathMover, Vector3 localPosition, bool force) { if (force) { pathMover.gameObject.transform.localPosition = localPosition; return; } var node = pathMover.gameObject.GetComponent <SomeNode>(); if (null != node) { var worldPosition = transform.TransformPoint(localPosition); node.MoveToPosition(worldPosition, force); } }
protected override void SnapPathMover(PathMover pathMover, float progress, bool force) { Vector3 position = start + (end - start) * progress; MovePathMoverToLocalPosition(pathMover, position, force); }
/// <summary> /// Update the path mover over time /// </summary> protected virtual void UpdatePathMover(PathMover pathMover, TimeSlice time) { }
/// <summary> /// Move the object that owns this path mover to its position on the path /// </summary> protected abstract void SnapPathMover(PathMover pathMover, float progress, bool force);