コード例 #1
0
        void DrawEmptyUI()
        {
            string msg  = "Assign a Dialogue Graph.";
            Rect   rect = new Rect(position.width / 2 - 200, position.height / 2 - 100, 400, 40);

            EditorGUI.HelpBox(rect, msg, MessageType.Info);

            rect.y += rect.height + 10;

            rect.height        = 20;
            _originalCandidate = (DialogueGraph)EditorGUI.ObjectField(rect, "Original", _originalCandidate, typeof(DialogueGraph), false);

            rect.y += rect.height + 10;
            if (languageProperty == null)
            {
                GrabLanguageProperty();
            }
            EditorGUI.PropertyField(rect, languageProperty);

            rect.y += rect.height + 10;
            if (GUI.Button(rect, "Setup"))
            {
                if (TryToSetOriginal(_originalCandidate))
                {
                    LoadTextNodesFromOriginal();
                }
            }

            rect.y += rect.height + 10;
            DrawErrorField(rect);
        }
コード例 #2
0
        public override Node Copy(bool copyConnections = false)
        {
            DialogueGraph newNode = (DialogueGraph)base.Copy(copyConnections);

            newNode.translator = translator;
            return(newNode);
        }
コード例 #3
0
 bool TryToSetOriginal(DialogueGraph original)
 {
     if (original == null)
     {
         _errorMsg = "Please select a Dialogue Graph!";
         return(false);
     }
     if (!original.translator.Add(_loadedGraph))
     {
         _errorMsg = "This dialogue graph already have a translation for " + _loadedGraph.Language + " language.";
         return(false);
     }
     _loadedGraph.Original = original;
     return(true);
 }