Require script

Can the “@script RequireComponent” directive be used to require a user made script? If so I can’t seem to figure out how. I have tried defining a class which extends monobehavior, as well as trying to require the script by name. Neither is working out for me. Put simply, I want to require Script B when Script A is attached to a game object.

The first lines of the javascript I would like to require are (the filename matches the class name just to be sure):

class LockOnControl extends MonoBehaviour
{
   var dontLock : boolean = false;
   ...
}

The first line of the javascript requiring the above script is:

@script RequireComponent(LockOnControl);

The error I am getting:

Unknown identifier: 'LockOnControl'

Note that it only works at the time you actually add the script.

Also, scripts in the Plugins or Standard Assets directories can only depend on scripts in the same directory (so in your case it would be OK if the required script was, but not if the requiring script was).