Exemplo n.º 1
0
		protected override void Apply(Transform target, Quaternion value, MoveAlongPath movingObject)
		{
			if (_space == RotationSpace.Path)
			{
				if (_orientation == RotationOrientation.ForwardTangent)
				{
					value = Quaternion.LookRotation(
						path.GetTangent(movingObject.location, Space.Self),
						value * Vector3.up);
				}
				else if (_orientation == RotationOrientation.BackTangent)
				{
					value = Quaternion.LookRotation(
						-path.GetTangent(movingObject.location, Space.Self),
						value * Vector3.up);
				}

				value = path.TransformRotation(value);
			}
			else
			{
				if (_orientation == RotationOrientation.ForwardTangent)
				{
					value = Quaternion.LookRotation(
						path.GetTangent(movingObject.location),
						value * Vector3.up);
				}
				else if (_orientation == RotationOrientation.BackTangent)
				{
					value = Quaternion.LookRotation(
						-path.GetTangent(movingObject.location),
						value * Vector3.up);
				}
			}

			target.rotation = value;
		}
Exemplo n.º 2
0
		protected override void Apply(MoveAlongPathWithSpeed target, float value, MoveAlongPath movingObject)
		{
			target.speed = value;
		}
Exemplo n.º 3
0
			/// <summary>
			/// 更新移动对象, 由 MoveAlongPath 调用
			/// </summary>
			public abstract void UpdateMovingObject(KeyframeListTargetComponentPair pair, MoveAlongPath movingObject);
Exemplo n.º 4
0
		protected override void Apply(Camera target, float value, MoveAlongPath movingObject)
		{
			target.fieldOfView = value;
		}