Hi Folks
Sorry to post a probably simply question, but I am getting the following compile error for my code, when I add a Class2 that inherits from Class1:
"BCE0024: The type ‘Class1’ does not have a visible constructor that matches the argument list ‘()’. "
I am presuming that the compiler checks that if an instance is created of Class2 which is called say Class2(9), that it will want to know that the parent class can also be instantiated with the same arguments. But I have two constructors with exactly the same argument list so what gives?
Cheers for help
Edit: OK, so overloading with a second constructor with no arguments does the trick. Is there some lesson I can take away from this? Why does the compiler think that constructor needs to be able to accept no arguments?
function Class1 ()
{
}
class Class1 extends MonoBehaviour
{
function Class1( id : int )
{
}
}
class Class2 extends Class1
{
function Class2( id : int )
{
}
}