How can I extend a component?

Is it possible to extend a component in order to be attachable to GameObjects? Something the following does not work since Unity don't know about the derivation:

class mycomponent:LineRenderer { ... }

... ...

GameObject p;

p.AddComponent ("mycomponent");

...

The scripts all extend MonoBehaviour. You could achieve something like what you're doing by extending MonoBehaviour, and then at runtime adding the component you want (similar to what you have, e.g. AddComponent("LineRenderer")), and then manipulate the parameters of the LineRenderer in your script.

e.g.

LineRenderer lineRenderer = null;

void Start()
{
  lineRenderer = GetComponent(typeof(LineRenderer)) as LineRenderer;
  if( lineRenderer == null )
  {
    lineRenderer = AddComponent(typeof(LineRenderer)) as LineRenderer;
  }

  // do stuff with lineRenderer or in Update() or whatever
}

I hope that helps.