Search code examples
c#unity-game-engineunityscriptcross-language

Unity Calling C# function from UnityScript file


I'm trying to run a function in C# from UnityScript. My UnityScript file has:

GetComponent("C#File").C#FunctionName();

But in the editor it's telling me that the function isn't a member of UnityEngine.Component.


Solution

  • Try

     GetComponent<"C#File">().C#FunctionName();