using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class killcounter : MonoBehaviour.
{
public TextMeshProUGUI countertext;
int kills;
public int hedefolum;
// Start is called before the first frame update.
void Start()
{
}
// Update is called once per frame.
void Update()
{
showkills();
}
private void showkills()
{
countertext.text = kills.ToString();
}
public void addkiller()
{
kills++;
if(kills == hedefolum )
{
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
SceneManager.LoadScene("LEVEL1COMPLETE");
}
else if (kills == hedefolum)
{
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
SceneManager.LoadScene("LEVEL2COMPLETE");
}
else if (kills == hedefolum)
{
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
SceneManager.LoadScene("FINISHSCENE");
}
}
}