Assets/scripts/Gamemaneger.cs(34,9): error CS0428: Cannot convert method group FindObjectOfType' to non-delegate type
PlatformDeystoyer'. Consider using parentheses to invoke the method
script:
using UnityEngine;
using System.Collections;
using System;
public class Gamemaneger : MonoBehaviour {
public Transform Platformgenerator;
private Vector3 platformStartpoint;
public player thePlayer;
private Vector3 playerStartPoint;
private PlatformDeystoyer[] platformlist;
// Use this for initialization
void Start () {
platformStartpoint = Platformgenerator.position;
playerStartPoint = thePlayer.transform.position;
}
// Update is called once per frame
void Update ()
{ }
public void RestartGame()
{
StartCoroutine(RestartGameCo());
}
public IEnumerator RestartGameCo()
{
thePlayer.gameObject.SetActive(false);
yield return new WaitForSeconds(0.5f);
platformlist = FindObjectOfType<PlatformDeystoyer>; **//here should be the error according to visual studio**
for (int i = 0; i < platformlist.Length; i++)
{
platformlist*.gameObject.SetActive(false);*
-
}*
thePlayer.transform.position = playerStartPoint;
Platformgenerator.position = platformStartpoint;
thePlayer.gameObject.SetActive(true);
}
}