void OnEnable() { //changed = false; orig = (AssetBundleRule)target; currentSetting = orig.settings; Undo.RecordObject(target, "assetbundleruleundo"); }
void OnDisable() { if (changed) { string dir = Path.GetDirectoryName(AssetDatabase.GetAssetPath(orig)); if (AssetBundleRuleConfig.Instance.CanApply(dir) && EditorUtility.DisplayDialog("Unsaved Settings", "Unsaved AssetBundleRule Changes", "Apply", "Revert")) { Apply((AssetBundleRule)target); } else { Undo.PerformUndo(); currentSetting = orig.settings; //SerializedObject so = new SerializedObject(target); //so.SetIsDifferentCacheDirty(); //so.Update(); } } //changed = false; }