示例#1
0
    private void Story_OnOutput(StoryOutput obj)
    {
        string tType = obj.GetType().ToString();

        if (tType == "Cradle.StoryText" || tType == "Cradle.StoryLink" || tType == "Cradle.LineBreak")
        {
            if (tType == "Cradle.LineBreak")
            {
                currStoryText += "\n";
            }
            else
            {
                currStoryText += obj.Text;
            }
        }
        //switch (tType)
        //{
        //    case "Cradle.StoryText":
        //        currStoryText += obj.Text;
        //        break;
        //    case "Cradle.StoryLink":
        //        currStoryLink.Add(obj.Text);
        //        break;
        //}

        ScreenText.SetText(currStoryText);
    }
示例#2
0
        public override void OnInspectorGUI()
        {
            StoryOutput output = ((TwineTextElement)target).SourceOutput;

            bool unused;

            EditorGUILayout.LabelField("Type", output.GetType().Name);
            EditorGUILayout.LabelField("Id", idGenerator.GetId(output, out unused).ToString());
            EditorGUILayout.LabelField("Name", output.Name);
            EditorGUILayout.LabelField("Text", output.Text);

            EditorGUILayout.LabelField("Style");
            EditorGUI.indentLevel++;
            Style style = output.GetAppliedStyle();

            foreach (var pair in style)
            {
                EditorGUILayout.LabelField(pair.Key, pair.Value != null ? pair.Value.ToString() : null);
            }
            EditorGUI.indentLevel--;
        }