Quaternion.this[int]

Unity · Версия 2020.3 LTS · Scripting · Quaternion

Quaternion.this[int]

public float this[int];

Описание

Для доступа к компонентам x, y, z, w используйте [0], [1], [2], [3] соответственно.

using UnityEngine;

public class Example : MonoBehaviour
{
    void Start()
    {
        Quaternion p = new Quaternion();
        p[3] = 0.5f; // the same as p.w = 0.5
    }
}

Обновлено 17 ноября 2026 г.