예제 #1
0
        public bool InitFromDataCache(GM.DataCache.ConditionGuide guide)
        {
            if (guide == null)
            {
                EB.Debug.LogError("InitFromDataCache: guide is null");
                return(false);
            }

            var conditionSet = guide;

            if (!InitChapterStory(conditionSet))
            {
                EB.Debug.LogError("InitFromDataCache: init chapterStory failed");
                return(false);
            }

            return(true);
        }
예제 #2
0
        private bool InitChapterStory(GM.DataCache.ConditionGuide story)
        {
            if (story == null)
            {
                EB.Debug.LogError("InitChapterStory: story is null");
                return(false);
            }

            mChapterStory = new Dictionary <string, ChapterStory>();
            for (int i = 0; i < story.ChapterStoryLength; ++i)
            {
                var item = ParseChapterStory(story.GetChapterStory(i));
                if (mChapterStory.ContainsKey(item.chapterId))
                {
                    EB.Debug.LogError("InitChapterStory: {0} exists", item.chapterId);
                    mChapterStory.Remove(item.chapterId);
                }
                mChapterStory.Add(item.chapterId, item);
            }
            return(true);
        }