Version: 2017.3

Plane.SetNormalAndPosition

매뉴얼로 전환
public void SetNormalAndPosition (Vector3 inNormal, Vector3 inPoint);

파라미터

inNormal The plane's normal vector.
inPoint A point that lies on the plane.

설명

Sets a plane using a point that lies within it along with a normal to orient it.

Note that the normal must be a normalised vector.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { public float fieldLength; public float fieldWidth; public Plane goalLine1; public Plane goalLine2; public Plane leftSideLine; public Plane rightSideLine; void Start() { goalLine1.SetNormalAndPosition(Vector3.forward, Vector3.forward * fieldLength / 2); goalLine1.SetNormalAndPosition(-Vector3.forward, -Vector3.forward * fieldLength / 2); leftSideLine.SetNormalAndPosition(-Vector3.right, -Vector3.right * fieldWidth / 2); leftSideLine.SetNormalAndPosition(Vector3.right, Vector3.right * fieldWidth / 2); } }

See Also: Set3Points.