본문 바로가기
유니티 공부/Unity

Unity - 2차원 배열을 inspector창에서 입력하는 방법

by 코딩하는 돼징 2023. 11. 10.
반응형

1. 행에 해당하는 배열 만들기

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[System.Serializable]
public class RowArray
{
     public GameObject[] row; //행에 들어갈 배열들
}

 


2. 열에 해당하는 배열 만들기

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Example : Monobehaviour
{
    public RowArray[] columnArray; // 열에 해당하는 배열
}

결과

 

 

반응형

댓글