Help!! I keep getting an error that says " Error CS0524: Interfaces cannot declare classes, structs, interfaces, delegates, or enumerations (CS0524) (Assembly-CSharp)". What’s wrong with my code??
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public interface IRecycle{
void Restart();
void Shutdown();
public class RecycleGameObject : MonoBehaviour {
private List<IRecycle> recycleComponents;
void Awake (){
var components = GetComponents<MonoBehaviour> ();
recycleComponents = new List<IRecycle> ();
foreach (var component in components){
if (component is IRecycle){
recycleComponents.Add (component as IRecycle);
}
}
Debug.Log (name + " Found " + recycleComponents.Count + " Components");
}
public void Restart (){
gameObject.SetActive (true);
foreach (var component in recycleComponents) {
component.Restart ();
}
}
public void Shutdown (){
gameObject.SetActive (false);
foreach (var component in recycleComponents) {
component.Shutdown ();
}
}
}
Also I keep getting an “unexpected end of file” message at the end