Browse Source

Added Set Language command

master
chrisgregan 10 years ago
parent
commit
cb7e25b728
  1. 35
      Assets/Fungus/Narrative/Scripts/Commands/SetLanguage.cs
  2. 12
      Assets/Fungus/Narrative/Scripts/Commands/SetLanguage.cs.meta

35
Assets/Fungus/Narrative/Scripts/Commands/SetLanguage.cs

@ -0,0 +1,35 @@
using UnityEngine;
using System.Collections;
namespace Fungus
{
[CommandInfo("Narrative",
"Set Language",
"Set the active language for the scene. A Localization object with a localization file must be present in the scene.")]
[AddComponentMenu("")]
public class SetLanguage : Command
{
public string languageCode;
public override void OnEnter()
{
Localization localization = GameObject.FindObjectOfType<Localization>();
if (localization != null)
{
localization.SetActiveLanguage(languageCode);
}
Continue();
}
public override string GetSummary()
{
return languageCode;
}
public override Color GetButtonColor()
{
return new Color32(184, 210, 235, 255);
}
}
}

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

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