Esempio n. 1
0
        void ApplyEventModifications()
        {
            // replace old event with new event on all animations containing it
            ConditionalEvent         oldEvent = allEventsSorted[_eventsList.SelectedItem];
            ConditionalEventComparer comparer = new ConditionalEventComparer();

            foreach (CharacterAnimation anim in allEvents[oldEvent])
            {
                for (int i = 0; i < anim.events.Count; ++i)
                {
                    if (comparer.Equals(oldEvent, anim.events[i]))
                    {
                        anim.events[i] = EventEditorPanel.eventToEdit.Clone();
                        break;
                    }
                }
            }
            EventEditorPanel.eventToEdit = null;
            CharacterEditor.Instance.RefreshEvents();
        }
Esempio n. 2
0
        public void OnRemoveButton()
        {
            // Find selected anim
            CharacterAnimation selectedAnim = GetAnimationFromList();
            // Find selected event
            ConditionalEvent selectedEvent = allEventsSorted[_eventsList.SelectedItem];
            // Find the event on the anim and remove it
            ConditionalEventComparer comparer = new ConditionalEventComparer();

            for (int i = 0; i < selectedAnim.events.Count; ++i)
            {
                if (comparer.Equals(selectedEvent, selectedAnim.events[i]))
                {
                    selectedAnim.events.RemoveAt(i);
                    break;
                }
            }

            allEvents[selectedEvent].Remove(selectedAnim);

            // Refresh UI
            RefreshAnimationsList();
            RefreshAnimationsDropdown();
        }