ドキュメント

Unity Engine

Unity Engine

this[]

Access the x or y component using [0] or [1] respectively.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule

this[int]

public float this[int index] { readonly get; set; }

Parameters

index

Returns

Type

Description

float

Examples

using UnityEngine;public class Example : MonoBehaviour{ void Start() { Vector2 p = new Vector2(); p[1] = 5; // the same as p.y = 5 }}