/* Draws the header for each foldout for each AnimObject */ void DrawFoldoutHeader(AnimObject ao, AnimObjectHolder aoh) { EditorGUILayout.BeginHorizontal(); ao.foldout = EditorGUILayout.Foldout(ao.foldout, ao.ToString()); if (GUILayout.Button("UP", GUILayout.Width(50f))) { aoh.MoveAnimObjectUp(ao); } if (GUILayout.Button("DOWN", GUILayout.Width(50f))) { aoh.MoveAnimObjectDown(ao); } GUILayout.Space(10f); if (GUILayout.Button("X", GUILayout.Width(25f))) { aoh.RemoveAnimObject(ao); } GUILayout.Space(60f); EditorGUILayout.EndHorizontal(); }
public static void DeleteAsset(AnimObject ao) { string path = "Assets/Resources/AnimObject Assets" + "/New " + ao.ToString() + ao.GetInstanceID() + ".asset"; #if UNITY_EDITOR AssetDatabase.DeleteAsset(path); #endif }
/* We can't use dynamic dispatch because these classes should * not directly access EditorGUILayout or GUILayout */ public static void DrawAnimObject(AnimObject ao) { if (ao is ATween) { DrawATween((ATween)ao); } else if (ao is AParticleSystem) { DrawAParticleSystem((AParticleSystem)ao); } else if (ao is ASpriteAnimation) { DrawASpriteAnimation((ASpriteAnimation)ao); } /* When adding more AnimObjects, make sure to keep * this else case. Just add more else ifs */ else { throw new System.NotImplementedException("Cannot Draw Inspector info for AnimObject " + ao.ToString() + ": Not implemented"); } }