Converting c# function into a uvs node works automatically... sometimes.

Hi,

I have a script with these 2 functions:
1:

 public static void DeleteFile(string filename)
        {
            string fullpath = Application.persistentDataPath + "/" + filename;
...

2:

public static void SaveFile<T>(string filename, T data) where T : class
        {
            if (IsValidFilename(filename))
            {
                FileStream file = null;
                try
                {...

After adding the scripting in the uvs section in project settings, why can I see the first function and not the second?
(ps: this is just an example, I don’t need to save or load anything, I just to want to understand what are the requirements so uvs recognizes a c# function.)

Thanks
8725866--1180272--upload_2023-1-12_15-4-44.png

8725866--1180272--upload_2023-1-12_15-4-44.png

Second one is generic, UVS does not support generics.

Edit: But you can always wrap a generic method into a regular one for UVS purposes.

1 Like

Thanks

Performance-wise, do you know if a c# function takes longer to execute when called from a UVS script?

I’d say no…

C# executes like it always does with or without UVS. The only overhead is for the initial UVS call so overall performance loss is minimal when calling C# methods.

1 Like