I have several buttons that the user is meant to click on them and it would run a function: SetMultiples() and update some game statistics. However, it seems that rather than executing the function immediately, there is a consider delay of 4-5 seconds before the function is called.
I have tried to call the SetMultiples() to respond to a certain keyboard and it seem to run the function immediately.
using System.Collections;
using UnityEngine.UI;
using System.Collections.Generic;
using UnityEngine;
public class MultiplesButtonClick : MonoBehaviour {
public PlayerSelection playerSelection; //enum player selection variable
public Button assignedButton; //button assigned to this script
public GameObject planetManager; //reference to planet manager
public Color selectedColor;
public Color originalColor;
// Use this for initialization
void Start () {
planetManager = GameObject.FindGameObjectWithTag("PlanetManager");
assignedButton = GetComponent
↧