I see no reason why that should not work, however considering you get a null reference error it is probably because your GetComponent thingie fail.
Also make sure to include UnityEngine at the top of the SomeClass class. ( I suppose you do though since Locomotion probably wouldn’t be recognized if not, but just thought I’ld say just in case. )
using UnityEngine;
public class MonoClass : MonoBehaviour {
Locomotion loco;
SomeClass someClass;
public void Start(){
loco = GetComponent< Locomotion >();
if( loco != null ){
someClass = new SomeClass();
someClass.DoSomething( loco );
}
else {
Debug.LogError( "No Locomotion component was found!" );
}
}
}
using UnityEngine;
public class SomeClass {
public void DoSomething( Locomotion loco ){
// Do stuff with locomotion
}
}