Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [RequireComponent(typeof(Rigidbody2D))]
- public class MyCustomClass : BaseMonoBehaviour
- {
- public bool m_CanMove;
- public override bool OnValidateProperty(string propertyName)
- {
- if (propertyName == "m_CanMove")
- {
- if (!m_CanMove)
- {
- GetComponent<Rigidbody2D>().bodyType = RigidbodyType2D.Static;
- return true;
- }
- }
- return base.OnValidateProperty(propertyName);
- }
- }
Add Comment
Please, Sign In to add comment