Without defining a constructor in the derived class, the default is a parameterless constructor. Which the base class doesn't have, so the derived class has no way of instantiating its base class (and, thus, itself).
Define a constructor in the derived class which uses the base class' constructor:
public Derived(string foo, float bar, float foobar) : base(foo, bar, foobar) { }
This is just a pass-through constructor. You could also use a parameterless one if you want, but you'd still need to use the base class' constructor with some values. For example:
public Derived() : base("foo", 1.0, 2.0) { }
It's a normal constructor like any other, and can contain any logic you like, but it needs to invoke the base class' only constructor with some values.
Note: This means you probably don't need this at all:
public Base derived = new Derived ("Foo", 0f, 0f);
It looks like you're trying to create an instance of Base
as a member of Derived
. But Derived
is an instance of Base
. If you want to use Base
as an instance like that then you wouldn't want to use inheritance:
public class Derived { // not inheriting from Base
public Base base = new Base ("Foo", 0f, 0f);
}
Of course, at that point "base" and "derived" would be misleading names, since these classes wouldn't actually be in an inheritance structure.