Here's a simplified example to explain my problem in Javascript:
I have a super-class:
class mySuperClass()
{
static function run()
{
return "mySuperClass";
}
}
And a sub-class which inherits from my super-class:
class mySubClass extends mySuperClass
{
static function run()
{
return "mySubClass";
}
}
And finally, a 3rd class:
class doThings
{
function Start()
{
var aClass = new mySubClass();
}
function Update()
{
Debug.Log(aClass); //This displays the text 'mySubClass'
var myText = aClass.run();
}
}
1) How comes myText equals "mySuperClass"? Surely it should run the mySubClass.run() method instead of the mySuperClass.run() method?
2) Is there any way to make it so that the super-class can never be instantiated (I know interface and abstract isn't supported)?