The requirement for the project is to create a tool with which I can define simple onClick, onTrigger or onCollision actions on the gameobjects directly through editor scripting.
Unity already provides something on a button for onClick, in which I can select the gameobject, that gives me access to all the scripts and its function on that gameobject and then I simply select a function that gets executed on runtime.
What I need -
OnCollisionTrigger -> It shows in editor two fields
1. Gameobject field - Where I can simply drag any scene gameobject
2. Function list like Toggle Active, Destroy and so on
I have looked at many videos available for editor scripting but none could explain these topics.
I know we have handles in Unity Editor that is really handy for doing quite a lot of stuff. But I am really clueless about how I can implement something like this on editor.
I am not sure if this problem can be done in multiple ways. But I am not getting the starting point where I need to start researching on. Unity Editor scripts are really less documented in videos or in docs. Any help to direct me in the right direction will really help me.
Thanks a lot in advance :)
OnClick
is a UnityEvent type object. You can just use that and do the invokation wherever you want it to fire (on collision? then call it inOnCollission
). – Draco18s no longer trusts SE