Christopher
9 years ago
2 changed files with 62 additions and 0 deletions
@ -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); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -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…
Reference in new issue