void Animations() { GUILayout.BeginVertical("box", GUILayout.Width(200)); showAnimations = GUILayout.Toggle(showAnimations, "Animations", "boxhead"); int animIndex = ed.tile.GetAnimationIndex(); if (showAnimations) { GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button("+", GUILayout.Width(20))) { actQueue.Enqueue(new AddAnimationAct("Animation " + ed.tile.GetAnimationCount())); } GUILayout.EndHorizontal(); for (int i = ed.tile.GetAnimationCount() - 1; i >= 0; i--) { VAnimation anim = ed.tile.GetAnimation(i); GUILayout.BeginHorizontal(); animIndex = GUILayout.Toggle(animIndex == i, animIndex == i ? "" : "", "button", GUILayout.Width(20)) ? i : animIndex; string name = GUILayout.TextField(anim.GetName()); if (ed.tile.GetAnimationCount() > 1) { if (GUILayout.Button("-", GUILayout.Width(20))) { actQueue.Enqueue(new RemoveAnimationAct(i)); } } else { GUILayout.Space(30f); } GUILayout.EndHorizontal(); if (name != anim.GetName()) { actQueue.Enqueue(new ChangeAnimationInfoAct(i, name)); } } } GUILayout.EndVertical(); if (repaint) { boxRects.Add(GUILayoutUtility.GetLastRect()); } if (animIndex != ed.tile.GetAnimationIndex()) { actQueue.Enqueue(new ChangeAnimationIndexAct(animIndex)); } }
public override bool IsNoOp() { VAnimation anim = Edit.use.tile.GetAnimation(animationIndex); return(name == anim.GetName()); }