Browse Source

Added Conversation command

master
Christopher 9 years ago
parent
commit
f79c04f8e0
  1. 50
      Assets/Fungus/Narrative/Scripts/Commands/Conversation.cs
  2. 12
      Assets/Fungus/Narrative/Scripts/Commands/Conversation.cs.meta

50
Assets/Fungus/Narrative/Scripts/Commands/Conversation.cs

@ -0,0 +1,50 @@
/**
* 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);
}
}
}

12
Assets/Fungus/Narrative/Scripts/Commands/Conversation.cs.meta

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: f608b8c9fb3044200aac956492d8d586
timeCreated: 1469542178
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Loading…
Cancel
Save