• Hi Guest!

    We are extremely excited to announce the release of our first Beta1.1 and the first release of our Public AddonKit!
    To participate in the Beta, a subscription to the Entertainer or Creator Tier is required. For access to the Public AddonKit you must be a Creator tier member. Once subscribed, download instructions can be found here.

    Click here for information and guides regarding the VaM2 beta. Join our Discord server for more announcements and community discussion about VaM2.
  • Hi Guest!

    VaM2 Resource Categories have now been added to the Hub! For information on posting VaM2 resources and details about VaM2 related changes to our Community Forums, please see our official announcement here.

Adding the "Actions on trigger" menu in plugin GUI

mrmr32

Well-known member
Joined
Sep 4, 2022
Messages
124
Reactions
335
I want to add actions when a internal script event happens, and I thought using the already existing VAM trigger GUI will be the easiest way to do it.
In particular I need this part of the CollisionTrigger/LookAtTrigger (add actions & edit them):
img.jpg


I've been searching for almost a week now, and still nothing. I think that what I need is to save a Trigger variable inside the script, but in order to call InitTriggerUI()* the UITransform needs a TriggerUI (and with GameObject#AddComponent<TriggerUI>() it stills shows as null).

* In LookAtTrigger, inside InitUI, it performs this initialization:
C#:
LookAtTriggerUI componentInChildren = this.UITransform.GetComponentInChildren<LookAtTriggerUI>();
...
this.trigger.triggerActionsParent = componentInChildren.transform;
this.trigger.triggerPanel = componentInChildren.transform;
this.trigger.triggerActionsPanel = componentInChildren.transform;
this.trigger.InitTriggerUI();
this.trigger.InitTriggerActionsUI();
 
I decided to use Macgruber_Utils.cs. Easier to use, cleaner GUI, and you can see how it is used in the plugin itself.
Thanks for all, you saved me!
 
Back
Top Bottom