/// <summary>
        /// 创建对话文本生成器
        /// </summary>
        /// <param name="type">生成器类型</param>
        /// <returns></returns>
        public static DialogueTextGenerator Create(DialogueTextGeneratorType type)
        {
            switch (type)
            {
            case DialogueTextGeneratorType.Simple:
                return(new SimpleDialogueTextGenerator());

            default:
                return(new EmptyDialogueTextGenerator());
            }
        }
Exemplo n.º 2
0
        public override void OnInspectorGUI()
        {
            var generator = (DialogueTextGeneratorType)EditorGUILayout.EnumPopup("Text Generator", _generatorType);

            if (generator != _generatorType)
            {
                _target.ResetGenerator(generator);
                _generatorType = generator;
            }
            EditorGUILayout.PropertyField(_timeSpan);
            serializedObject.ApplyModifiedProperties();
        }
Exemplo n.º 3
0
 public void ResetGenerator(DialogueTextGeneratorType type)
 {
     textGenerator = type;
     _generator    = DialogueTextGenerator.Create(textGenerator);
 }
Exemplo n.º 4
0
 private void OnEnable()
 {
     _timeSpan      = serializedObject.FindProperty("timeSpan");
     _target        = (DialogueContentRenderer)target;
     _generatorType = _target.textGenerator;
 }