Hi I'm following the documentation of Declare a custom event type : https://engine.needle.tools/docs/scripting-examples.html#create-and-invoke-a-unityevent
1 - I have added this C# script to the Needle/Components.codegen file :
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
[System.Serializable]
public class MyCustomUnityEvent : MonoBehaviour
{
}
2- Then I copy-pasted both classes from the documentation
// The next line is not just a comment, it defines
// a specific type for the component generator to use.
//@type MyCustomUnityEvent
@serializable(EventList)
myEvent!: EventList;
// just for testing - could be when a button is clicked, etc.
start() {
this.myEvent.invoke("Hello");
}
}
export class CustomEventReceiver extends Behaviour {
logStringAndObject(str: string) {
console.log("From Event: ", str);
}
}```
3- But when I add both scripts to an GameObject , the field of `myEvent` from `CustomEventCaller ` looks like this and I cannot add the the reference of `CustomEventReceiver ` :
Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development, and can be deployed anywhere. It is flexible, extensible, and collaboration and XR come naturally. Needle Exporter for Unity bridges the Unity Editor and the web runtime. It helps you to export your assets, animations, lightmaps and so on to the web. It is...