BaseTool
BaseTool copied to clipboard
Add AutoField<T> to retrieve components automatically
Create class that retrieves by GetComponent
the field it is looking for when code needs to access it.
public class MyComponent : MonoBehaviour
{
public AutoField<Rigidbody> Rigidbody;
public void Start()
{
// will retrieve rigidbody automatically if not found
Rigidbody.velocity = transform.forward;
}
}