对于非常简单的数组,参数超出范围

时间:2018-05-24 03:25:23

标签: c# unity3d

我已经尽可能地简化了我正在处理的代码,并尝试将其打印到第一个单元格中的值。它一直在说:

  

参数超出范围“”mapArray.Star()(at   资产/脚本/ mapArray.cs32)

这是我目前的代码:

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

public class mapArray : MonoBehaviour {

    public class gridCell
    {
        public int theX { get; set; }

        public gridCell(int xAx, int yAx, int TRVpen, int Ele, bool isOccupied)
        {
            this.theX = theX;
        }

    }

    public void Start()
    { 
       List<gridCell> cells = new List<gridCell>();
        for (int i = 0; i < 288; i++)
        {
            int theX = i;
        }
        int theXvalue = cells[0].theX;
        Debug.Log(theXvalue);
    }

    // Update is called once per frame
    public void Update () {

    }

 }

0 个答案:

没有答案
相关问题