private void RemoveEndBossMecanimEvents() { this.mecanimEventsGo = Scene.mecanimEvents; if (this.mecanimEventsGo) { MecanimEventSetupHelper component = this.mecanimEventsGo.GetComponent <MecanimEventSetupHelper>(); if (component) { component.dataSources[19] = null; } } }
public override void OnInspectorGUI() { MecanimEventSetupHelper component = (MecanimEventSetupHelper)target; serializedObject.UpdateIfDirtyOrScript(); DrawDefaultInspector(); if (GUILayout.Button("Fill Data Sources")) { component.dataSources = ListUpAllObjectsByType("Assets", "Prefab", ".prefab") .Select(x => x.GetComponent <MecanimEventData> ()) .Where(x => x != null) .ToArray(); EditorUtility.SetDirty(target); AssetDatabase.SaveAssets(); } serializedObject.ApplyModifiedProperties(); }