Hello every body I made this script for a game manager of a shooter game and I have a lot of errors when I compile it. Could anyone help me?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameManager : MonoBehaviour
{
public static Instance {get; private set;}
public int gunAmmo = 10;
private void Awake()
{
Instance = this;
}
}
The errors are:
-
Assets\Scripts\Diferent\Game Manager.cs(7,28): error CS1519: Invalid token ‘{’ in class, record, struct, or interface member declaration
-
Assets\Scripts\Diferent\Game Manager.cs(7,32): error CS1519: Invalid token ‘;’ in class, record, struct, or interface member declaration
-
Assets\Scripts\Diferent\Game Manager.cs(7,45): error CS1519: Invalid token ‘;’ in class, record, struct, or interface member declaration
-
Assets\Scripts\Diferent\Game Manager.cs(11,5): error CS8803: Top-level statements must precede namespace and type declarations
-
Assets\Scripts\Diferent\Game Manager.cs(11,5): error CS0106: The modifier ‘private’ is not valid for this item
-
Assets\Scripts\Diferent\Game Manager.cs(15,1): error CS1022: Type or namespace definition, or end-of-file expected