I am trying to transfer objects from the array to instantiate, everything seems to be written correctly, there are no launch errors, but also tell me the expected result, why?
using UnityEngine; using System.Collections; public class mapGenirator : MonoBehaviour { public enum ListBlock { Mpole1, Mpole2 } public Transform SB_Mpole1; public Transform SB_Mpole2; public Transform ground; Transform ReturnList (ListBlock RL) { switch (RL) { case ListBlock.Mpole1: return SB_Mpole1; case ListBlock.Mpole2: return SB_Mpole2; default: return SB_Mpole1; } } ListBlock [,] ArrayListBlock; void createlevel() { for (int i = 0; i < 10; ++i) { for (int j = 0; j < 10; ++j) { float PositionBlock_x = transform.position.x + SB_Mpole1.localScale.x; float PositionBlock_z = transform.position.z + SB_Mpole1.localScale.z; float PositionBlock_y = transform.position.y + 10f; Transform AddArrey = ReturnList( ArrayListBlock[i, j]); Transform createBlock = (Transform)Instantiate(SB_Mpole1, new Vector3(PositionBlock_x, PositionBlock_y, PositionBlock_z), Quaternion.identity); } } } void fullArrey () { for (int i = 0; i < 10; ++i) { for (int j = 0; j < 10; ++j) { ArrayListBlock[i,j] = ListBlock.Mpole1; } } } void Sharing() { fullArrey(); createlevel(); } void start () { createlevel(); ArrayListBlock = new ListBlock[10,10]; } }