private void OnEnable() { try { Context = serializedObject.context as TinyHookupContext; if (Context == null) { throw new ArgumentException("Can't find context"); } var drawerType = InspectorType == TinyInspectorType.Edge ? Context.EdgeDataDrawer : Context.NodeDataDrawer; if (drawerType != null) { _drawer = (ITinyDataDrawer)Activator.CreateInstance(drawerType); } InternalOnEnable(); } #pragma warning disable 168 catch (ArgumentException e) #pragma warning restore 168 { DestroyImmediate(this); } }
protected virtual void OnDisable() { _drawer = null; Context = null; }