- Home /
Question by
turacept · Jun 15, 2016 at 06:16 AM ·
c#getcomponentonclick
Unity Get OnClick Components Without Button Variable [C# Please]
I'm trying to make it so whatever button uses the function I can get the component's of that object.
public void GetSpell() {
//sb = EventSystem.current.currentSelectedGameObject.GetComponent<SkillButton>();
sh.spellBook[sb.skillNumber] = sh.spellList[sb.skillNumber];
}
}
Does anyone know how to do that?
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612082907im_/https://answers.unity.com/themes/thub/images/avi.jpg)