Hello All. I have a MonoBehaviour that requires a Rigidbody and A ConstantForce.
However, What I’d like to do is to hide these 2 components from the editor, as they should never be accessible to the user.
I realize that I have to create a custom editor, but this will only allow me to influence my classes.
Does anyone have any idea on how to get around this?
[RequireComponent (typeof(Rigidbody))]
[RequireComponent (typeof(ConstantForce))]
public abstract class BasicBehaviour : MonoBehaviour
{
void Start()
{
gameObject.rigidbody.freezeRotation = true;
}
void Update()
{
if (Input.GetMouseButtonDown(0))
{
//add force
constantForce.force = (-transform.forward);
}
if (Input.GetMouseButtonUp(0))
{
constantForce.force = Vector3.zero;
}
}
}
So again, what I would like to see in the editor, is just my script with its fields (I have a custom editor) and not the Rigidbody/ConstantForce.