Subclassing in c# ?

Hi!

I’ve been trying to come up with some nice data structures for inter-object communication based on a pub/sub model.

For a variety of reasons, I wanted a set type, so I cribbed an implementation from A C# sets class - CodeProject .

I changed it to not use namespaces as that didn’t seem to work and to disambiguate System.Object from UnityEngine.Object, and posted my result here:

http://www.unifycommunity.com/wiki/index.php?title=Set

When I try to use the set in Javascript, it says the .Remove() method doesn’t exist (it should be inherited from Hashtable); if I implement it in the C# class it says it needs the override keyword; when I specify the override keyword it gives me a different syntax error.

Is there a way to get things to work?

You have probably checked this, but make sure your C# scripts are in the Standard Assets folder so they get compiled before the JS. Otherwise you can’t use C# code from JS.

-Jeremy

Thanks for the answer! that did the trick.

Np. Here is some more info for you:
http://unity3d.com/Documentation/ScriptReference/index.Script_compilation_28Advanced29.html

-Jeremy