So I am using this code to make a game like cookie clickers:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class GoVar : MonoBehaviour
{
int clicks = 0;
bool clicktest = true;
public Text m_MyText;
void Start () {
m_MyText.text = "$0";
}
void Update () {
m_MyText.text = "$" + clicks.ToString();
Clicky();
}
void Clicky()
{
if (Input.GetMouseButtonDown(0) && clicktest == true)
{
clicks = clicks + 1;
clicktest = false;
}
if (clicktest == false && Input.GetMouseButtonUp(0))
{
clicktest = true;
}
}
}
And it does nothing. It should be working but it just ignores when I click. Can someone please explain this?