Unity 6.3
0 онлайн 1 гость 3 в системе
Вход

Vector4.Vector3

Описание

Преобразует Vector4 в Vector3.

Неявное преобразование Vector4 в Vector3. Компонент Vector4.w отбрасывается.

using UnityEngine;

public class Example : MonoBehaviour { void Start() { // Create and display a Vector4. Vector4 vector4;

vector4 = new Vector4(1.0f, 2.0f, 3.0f, 4.0f); Debug.Log("Vector4: " + vector4);

// Convert the Vector4 into a Vector3. Vector3 vector3; vector3 = vector4;

// The 4.0f is not copied into the Vector3. // Show (1.0f, 2.0f, 3.0f). Debug.Log("Vector3: " + vector3); } }