Missing function in button on click
I played game when Missed function in button on click this my code
using UnityEngine;
using System.Collections;
public class golcizgisi : MonoBehaviour {
public Transform player1Spawner;
public Transform player2Spawner;
public Transform topSpawner;
public GameObject player1pr;
public GameObject player2pr;
public GameObject toppr;
// Use this for initialization
void OnTriggerEnter2D (Collider2D top)
{
if (top.tag == "top") {
Destroy (GameObject.FindGameObjectWithTag ("Player"));
Destroy (GameObject.FindGameObjectWithTag ("Player2"));
Destroy (GameObject.FindGameObjectWithTag ("top"));
Spawner ();
}
}
// Update is called once per frame
void Spawner () {
Instantiate (player1pr, player1Spawner.position, player1Spawner.rotation);
Instantiate (player2pr, player2Spawner.position, player2Spawner.rotation);
Instantiate (toppr, topSpawner.position, topSpawner.rotation);
}
}
What the heck is your question ? This post makes no sense, there is no function in that script that could be called via a Button's onClick, because only public method can be chosen in onClick's dropdown menu.
You really need to be more specific and actually explain what your problem is (you can even post screenshots), otherwise no one will be able to help you.
The only thing I can think of is : you used to have a function call in your button's onClick, but you changed that function's name or made it private, and the reference to that function in onClick is lost.
Your answer
Follow this Question
Related Questions
Remove button OnMouseOver highlighting 0 Answers
Change Function On Button Press? 0 Answers
UI buttons won't recognize script 0 Answers
Button Displacement 0 Answers