i have a error:
Assets\EndTrigger.cs(9,9): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement
i wanted
to log level won when you tuch the cube
with the player
the code (EndTrigger.cs):
using UnityEngine;
public class EndTrigger : MonoBehaviour {
public GameManager gameManager;
void OnTriggerEnter ()
{
gameManager.CompleteLevel;
}
}
the refrence(GameManager.cs, frome line 10 to line 13):
using UnityEngine;
using UnityEngine.SceneManagement;
public class GameManager : MonoBehaviour {
bool gameHasEnded = false;
public float restartDelay = 1f;
public void CompleteLevel ()
{
Debug.Log("Level Won!");
}
public void EndGame ()
{
if (gameHasEnded == false)
{
gameHasEnded = true;
Debug.Log("GAME OVER");
Invoke("Restart", restartDelay);
}
}
void Restart ()
{
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
}
}
i will glad for help!