Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ActionSay : ActionSpeech
- {
- public ActionSay()
- {
- this.isDisplayed = true;
- category = ActionCategory.Custom;
- title = "Say";
- description = "Say by Manifest.CharacterType";
- }
- public Manifest.CharacterType manifestSpeaker;
- List<ActionParameter> theParameters;
- #if UNITY_EDITOR
- public override void ShowGUI(List<ActionParameter> parameters)
- {
- manifestSpeaker = (Manifest.CharacterType)EditorGUILayout.EnumPopup("Speaker:", manifestSpeaker);
- EditorGUILayout.BeginHorizontal();
- EditorGUILayout.LabelField("Line text:", GUILayout.Width(65f));
- EditorStyles.textField.wordWrap = true;
- messageText = EditorGUILayout.TextArea(messageText, GUILayout.MaxWidth(400f));
- EditorGUILayout.EndHorizontal();
- theParameters = parameters;
- AfterRunningOption();
- }
- #endif
- override public float Run()
- {
- speaker = CharactersManager.I.FindCharacterByType(manifestSpeaker); // returns a Char
- Debug.Log(speaker.GetName(0)); // this displays the Char name correctly, so it's found it.
- Debug.Log("MESSAGE TEXT: " + messageText); // this displays the message text correctly
- base.Run();
- return -1f; // if I return 0 here, any 2nd line in messageText is ignored. At -1 the Debug info is displayed 100x
- }
- override public void AssignValues(List<ActionParameter> parameters)
- {
- base.AssignValues(parameters);
- }
- override public void AssignParentList(ActionList actionList)
- {
- base.AssignParentList(actionList);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement