Unity不会识别长度方法

时间:2017-07-01 19:42:40

标签: c# unity3d

我完全不熟悉Unity和C#,我有以下问题。我只想在Array上使用.Length方法。 MonoDevelop不会识别.Length方法 这可能是一个非常愚蠢的问题,但我真的不知道如何处理这个问题,我对这些东西没有任何经验。

我在Ubuntu上使用Unity 2017.1.0f1。

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

public class GameManager : MonoBehaviour {

public Transform thePlatformGenerator;
private Vector3 theplatformGeneratorStartPoint;

public Transform thePlayer;
private Vector3 thePlayerStartPoint;

private PlatformDestructor[] platformList;


// Use this for initialization
void Start () {
    theplatformGeneratorStartPoint = thePlatformGenerator.position;
    thePlayerStartPoint = thePlayer.position;

}

public void RestartGame(){
    thePlayer.position = thePlayerStartPoint;
    thePlatformGenerator.position = theplatformGeneratorStartPoint;
    platformList = FindObjectsOfType<PlatformDestructor> ();
    for (int x = 0; x < platformList.Length; x++) {
        Destroy(platformList[x]);
    }
}

如果有人能帮助我,我会非常感激。

0 个答案:

没有答案
相关问题