You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a script derives from another MonoBehaviour script, all non-private members and methods (public or protected with SerializeFieldAttribute) create extra fields or buttons.
Example
Create the following scripts in your project and add them to a GameObject:
// file: A.cspublicclassA:MonoBehaviour{publicintaPublic;[SerializeField]protectedintaProtected;[SerializeField]privateintaPrivate;[Button]publicvoidTestA()=>Debug.Log($"Test from {nameof(A)}");}// file: B.cspublicclassB:A{publicstringbPublic;[SerializeField]protectedstringbProtected;[SerializeField]privatestringbPrivate;[Button]publicvoidTestB()=>Debug.Log($"Test from {nameof(B)}");}// file: C.cspublicclassC:B{publicintcPublic;[SerializeField]protectedintcProtected;[SerializeField]privateintcPrivate;[Button]publicvoidTestC()=>Debug.Log($"Test from {nameof(C)}");}
The inspector will look like this:
Related issues
The seems related to #12, though it covers an issue happening with private members too.
The text was updated successfully, but these errors were encountered:
When a script derives from another MonoBehaviour script, all non-private members and methods (
public
orprotected
withSerializeFieldAttribute
) create extra fields or buttons.Example
Create the following scripts in your project and add them to a GameObject:
The inspector will look like this:
Related issues
The seems related to #12, though it covers an issue happening with
private
members too.The text was updated successfully, but these errors were encountered: