編輯

共用方式為


MathUtilities.TransformDirectionFromTo(Transform, Transform, Vector3) Method

Definition

Takes a direction in the coordinate space specified by the "from" transform and transforms it to be the correct direction in the coordinate space specified by the "to" transform applies rotation only, no translation or scale

public:
 static UnityEngine::Vector3 TransformDirectionFromTo(UnityEngine::Transform ^ from, UnityEngine::Transform ^ to, UnityEngine::Vector3 fromDirection);
public static UnityEngine.Vector3 TransformDirectionFromTo (UnityEngine.Transform from, UnityEngine.Transform to, UnityEngine.Vector3 fromDirection);
static member TransformDirectionFromTo : UnityEngine.Transform * UnityEngine.Transform * UnityEngine.Vector3 -> UnityEngine.Vector3
Public Shared Function TransformDirectionFromTo (from As Transform, to As Transform, fromDirection As Vector3) As Vector3

Parameters

from
UnityEngine.Transform
to
UnityEngine.Transform
fromDirection
UnityEngine.Vector3

Returns

UnityEngine.Vector3

Direction to.

Applies to