You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.3 KiB
50 lines
1.3 KiB
8 years ago
|
/**
|
||
|
* This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus).
|
||
|
* It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE)
|
||
|
*/
|
||
|
|
||
|
using UnityEngine;
|
||
|
using UnityEngine.Serialization;
|
||
|
using System.Collections;
|
||
|
|
||
|
namespace Fungus
|
||
|
{
|
||
|
[CommandInfo("Narrative",
|
||
|
"Conversation",
|
||
|
"Do multiple say and portrait commands in a single block of text. Format is: [character] [portrait] [stage position] [: Story text]")]
|
||
|
[AddComponentMenu("")]
|
||
|
[ExecuteInEditMode]
|
||
|
public class Conversation : Command
|
||
|
{
|
||
|
public StringDataMulti conversationText;
|
||
|
|
||
|
public ConversationManager conversationManager = new ConversationManager();
|
||
|
|
||
|
protected virtual void Start()
|
||
|
{
|
||
|
conversationManager.PopulateCharacterCache();
|
||
|
}
|
||
|
|
||
|
public override void OnEnter()
|
||
|
{
|
||
|
StartCoroutine(DoConversation());
|
||
|
}
|
||
|
|
||
|
protected virtual IEnumerator DoConversation()
|
||
|
{
|
||
|
yield return StartCoroutine(conversationManager.DoConversation(conversationText.Value));
|
||
|
|
||
|
Continue();
|
||
|
}
|
||
|
|
||
|
public override string GetSummary()
|
||
|
{
|
||
|
return conversationText.Value;
|
||
|
}
|
||
|
|
||
|
public override Color GetButtonColor()
|
||
|
{
|
||
|
return new Color32(184, 210, 235, 255);
|
||
|
}
|
||
|
}
|
||
|
}
|