Question by
AlexWeiss · Jun 01, 2017 at 04:07 PM ·
c#scripting problemuigameobjects
Deleting random objects in started project
I need to destroy objects from my UI buttons, the rison i ask that i don`t know how to get a random object to destroy it. Also i have script that destroy objects on their collison but it doesn`t work for my buttons here it is
GameManager.cs
..................................................
public List<unitScript> units;
void Awake()
{ ..............................
units = new List<unitScript>();
..............................
}
public void DeleteUnitFromList(unitScript script)
{
unitAmnt--;
units.Remove(script);
}
unitScript.cs
..............................................
else if (other.tag == "hunter")
UI_script.cs
.................
public void OnClickDeleteUnit()
{
}
...................
What I should do?
Comment
Your answer
Follow this Question
Related Questions
Il will start a script while i press a Button 1 Answer
How to send event to my canvas via script 0 Answers
Always pickup closest item? 0 Answers
I get a "NullReferenceException" when trying to change the text of a UI text box. 1 Answer
Certain scripts that are attached does not work after build, scene change and closing unity 0 Answers