I’m trying to get SpriteUI to work for me, so I can dump OnGUI and GUI.x.
http://forum.unity3d.com/viewtopic.php?p=146112
I need to keep my project in Unity.js, as it’s too late to retool and I’m in the final optimizing phases. This means, as SpriteUI is in C#, I’ll have to deal with mixed languages.
SpriteUI is ultimately controlled by a script (MyUIManager) that inherits from both Monobehaviour and an internal interface, “UIManager”.
I need to create a class that extends both Monobehaviour and extends/implements UIManager in Unity.js.
In C#, this is what it reads:
//public class MyUIManager : MonoBehaviour, UIManager {
I’ve tried a number of choices in Unity.js, none of which work:
//class MyUIManager extends UIManager {
//class MyUIManager implements UIManager{
//class MyUIManager extends MonoBehaviour implements UIManager{
//class MyUIManager extends MonoBehaviour, UIManager {
Does anyone have any brilliant suggestions?
–
Why this is relevant is to make the buttons in SpriteUI useful, the script MyUIManager needs to call functions in other scripts. Normally I cache a variable using some form of:
private var someScript : SomeScript;
function Start(){
someScript = FindObjectOfType(SomeScript);
if (!someScript)
Debug.Log("MyUIManager.Start(): No link to someScript");
and I couldn’t get the C# version of MyUIManager to find my usual Unity.js scripts as I’m compiling the C# material first in the Plugins folder.
So - my next thought was to make MyUIMangaer .js rather than .cs, but I can’t get it to inherit correctly…