コード例 #1
0
        public ConversationEditorWindow GetConversationEditor(int conversationIndex, bool createIfNotExists)
        {
            GameRources.GetInstance().selectedConversationIndex = conversationIndex;
            if (conversationIndex < 0 ||
                conversationIndex >= Controller.Instance.ChapterList.getSelectedChapterDataControl()
                .getConversationsList()
                .getConversations().Count)
            {
                return(null);
            }

            var conversation = Controller
                               .Instance.ChapterList.getSelectedChapterDataControl()
                               .getConversationsList()
                               .getConversations()[conversationIndex];

            if (conversationWindows.ContainsKey(conversation) && conversationWindows[conversation] == null)
            {
                conversationWindows.Remove(conversation);
            }

            if (!conversationWindows.ContainsKey(conversation) && createIfNotExists)
            {
                ConversationEditorWindow convEditor = EditorWindow.GetWindow <ConversationEditorWindow>();
                convEditor.Init(conversation);
                conversationWindows.Add(conversation, convEditor);
            }

            return(conversationWindows.ContainsKey(conversation) ? conversationWindows[conversation] : null);
        }
コード例 #2
0
 public void setParent(ConversationEditorWindow parent)
 {
     this.parent = parent;
 }