Esempio n. 1
0
        public override void SaveSelectedChange()
        {
            bool shouldSaveToFile = PuppeteerEditorHelper.AddOrUpdateInList <GoalListItem, GoalDescription>(m_SerialisedGoals, m_SelectedListItem);

            bool successful = !shouldSaveToFile || PuppeteerManager.Instance.SaveGoals();

            if (successful)
            {
                m_SelectedListItem.MarkUnsavedChanges(false);
                TryClearUnsavedMarker();
            }
        }
Esempio n. 2
0
        public override void SaveAllChanges()
        {
            bool shouldSaveToFile = PuppeteerEditorHelper.RemoveDeletedItems <GoalListItem, GoalDescription>(m_SerialisedGoals, m_ListItems) > 0;

            for (int i = 0; i < m_ListItems.Count; ++i)
            {
                shouldSaveToFile |= PuppeteerEditorHelper.AddOrUpdateInList <GoalListItem, GoalDescription>(m_SerialisedGoals, m_ListItems[i]);
            }

            bool successful = !shouldSaveToFile || PuppeteerManager.Instance.SaveGoals();

            if (successful)
            {
                for (int i = 0; i < m_ListItems.Count; ++i)
                {
                    m_ListItems[i].MarkUnsavedChanges(false);
                    TryClearUnsavedMarker();
                }
            }
        }