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