Unity中C#腳本的程式碼
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Array : MonoBehaviour { // Start is called before the first frame update void Start() { int[] arr = new int[8]; arr[0] = 0; arr[1] = 1; arr[2] = 2; arr[3] = 3; arr[4] = 4; arr[5] = 5; arr[6] = 6; arr[7] = 7; for(int i = 0; i < 8; i++) { Debug.Log(arr[i]); } } }
使用工具版本(Version)
Unity: 2022.3.9f1
Visual Studio 2022 Community
參考來源:Unity 遊戲設計育成攻略