Browse Source

Refactored localisation system to use ILocalizable interface

You can now add custom commands that work with the localisation system
by implementing the ILocalizable interface.
master
chrisgregan 10 years ago
parent
commit
d6f057c98c
  1. 22
      Assets/Fungus/Flowchart/Scripts/Command.cs
  2. 27
      Assets/Fungus/Narrative/Scripts/Character.cs
  3. 27
      Assets/Fungus/Narrative/Scripts/Commands/Menu.cs
  4. 33
      Assets/Fungus/Narrative/Scripts/Commands/Say.cs
  5. 358
      Assets/Fungus/Narrative/Scripts/Localization.cs
  6. 27
      Assets/Fungus/UI/Scripts/Commands/SetText.cs
  7. 27
      Assets/Fungus/UI/Scripts/Commands/Write.cs
  8. 4
      Assets/Tests/Localisation/CSV/localization_Commands.csv
  9. 4
      Assets/Tests/Localisation/CSV/localization_Narrative.csv
  10. 8
      Assets/Tests/Localisation/CSV/localization_Narrative.csv.meta
  11. 484
      Assets/Tests/Localisation/LocalisationTests.unity

22
Assets/Fungus/Flowchart/Scripts/Command.cs

@ -184,6 +184,28 @@ namespace Fungus
{ {
return false; return false;
} }
/**
* Returns the localization id for the Flowchart that contains this command.
*/
public virtual string GetFlowchartLocalizationId()
{
// If no localization id has been set then use the Flowchart name
Flowchart flowchart = GetFlowchart();
if (flowchart == null)
{
return "";
}
string localizationId = GetFlowchart().localizationId;
if (localizationId.Length == 0)
{
localizationId = flowchart.name;
}
return localizationId;
}
} }
} }

27
Assets/Fungus/Narrative/Scripts/Character.cs

@ -8,7 +8,7 @@ namespace Fungus
{ {
[ExecuteInEditMode] [ExecuteInEditMode]
public class Character : MonoBehaviour public class Character : MonoBehaviour, ILocalizable
{ {
public string nameText; // We need a separate name as the object name is used for character variations (e.g. "Smurf Happy", "Smurf Sad") public string nameText; // We need a separate name as the object name is used for character variations (e.g. "Smurf Happy", "Smurf Sad")
public Color nameColor = Color.white; public Color nameColor = Color.white;
@ -36,6 +36,31 @@ namespace Fungus
{ {
activeCharacters.Remove(this); activeCharacters.Remove(this);
} }
//
// ILocalizable implementation
//
public virtual string GetStandardText()
{
return nameText;
}
public virtual void SetStandardText(string standardText)
{
nameText = standardText;
}
public virtual string GetDescription()
{
return description;
}
public virtual string GetStringId()
{
// String id for character names is CHARACTER.<Character Name>
return "CHARACTER." + nameText;
}
} }
} }

27
Assets/Fungus/Narrative/Scripts/Commands/Menu.cs

@ -11,7 +11,7 @@ namespace Fungus
"Menu", "Menu",
"Displays a button in a multiple choice menu")] "Displays a button in a multiple choice menu")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class Menu : Command public class Menu : Command, ILocalizable
{ {
[Tooltip("Text to display on the menu button")] [Tooltip("Text to display on the menu button")]
public string text = "Option Text"; public string text = "Option Text";
@ -118,6 +118,31 @@ namespace Fungus
{ {
return new Color32(184, 210, 235, 255); return new Color32(184, 210, 235, 255);
} }
//
// ILocalizable implementation
//
public virtual string GetStandardText()
{
return text;
}
public virtual void SetStandardText(string standardText)
{
text = standardText;
}
public virtual string GetDescription()
{
return description;
}
public virtual string GetStringId()
{
// String id for Menu commands is MENU.<Localization Id>.<Command id>
return "MENU." + GetFlowchartLocalizationId() + "." + itemId;
}
} }
} }

33
Assets/Fungus/Narrative/Scripts/Commands/Say.cs

@ -9,7 +9,7 @@ namespace Fungus
"Say", "Say",
"Writes text in a dialog box.")] "Writes text in a dialog box.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class Say : Command public class Say : Command, ILocalizable
{ {
// Removed this tooltip as users's reported it obscures the text box // Removed this tooltip as users's reported it obscures the text box
[TextArea(5,10)] [TextArea(5,10)]
@ -160,6 +160,37 @@ namespace Fungus
{ {
executionCount = 0; executionCount = 0;
} }
//
// ILocalizable implementation
//
public virtual string GetStandardText()
{
return storyText;
}
public virtual void SetStandardText(string standardText)
{
storyText = standardText;
}
public virtual string GetDescription()
{
return description;
}
public virtual string GetStringId()
{
// String id for Say commands is SAY.<Localization Id>.<Command id>.[Character Name]
string stringId = "SAY." + GetFlowchartLocalizationId() + "." + itemId + ".";
if (character != null)
{
stringId += character.nameText;
}
return stringId;
}
} }
} }

358
Assets/Fungus/Narrative/Scripts/Localization.cs

@ -11,6 +11,14 @@ using Ideafixxxer.CsvParser;
namespace Fungus namespace Fungus
{ {
public interface ILocalizable
{
string GetStandardText();
void SetStandardText(string standardText);
string GetDescription();
string GetStringId();
}
/** /**
* Multi-language localization support. * Multi-language localization support.
*/ */
@ -24,6 +32,8 @@ namespace Fungus
protected static Dictionary<string, string> localizedStrings = new Dictionary<string, string>(); protected static Dictionary<string, string> localizedStrings = new Dictionary<string, string>();
protected Dictionary<string, ILocalizable> localizeableObjects = new Dictionary<string, ILocalizable>();
/** /**
* Temp storage for a single item of standard text and its localizations * Temp storage for a single item of standard text and its localizations
*/ */
@ -48,6 +58,17 @@ namespace Fungus
public virtual void Start() public virtual void Start()
{ {
// Build cache of localizeable objects in the scene
Component[] components = GameObject.FindObjectsOfType<Component>();
foreach (Component component in components)
{
ILocalizable localizable = component as ILocalizable;
if (localizable != null)
{
localizeableObjects[localizable.GetStringId()] = localizable;
}
}
if (localizationFile != null && if (localizationFile != null &&
localizationFile.text.Length > 0) localizationFile.text.Length > 0)
{ {
@ -144,95 +165,46 @@ namespace Fungus
{ {
Dictionary<string, TextItem> textItems = new Dictionary<string, TextItem>(); Dictionary<string, TextItem> textItems = new Dictionary<string, TextItem>();
// Export all character names // Add localizable commands in same order as command list to make it
foreach (Character character in GameObject.FindObjectsOfType<Character>()) // easier to localise / edit standard text.
{
// String id for character names is CHARACTER.<Character Name>
TextItem textItem = new TextItem();
textItem.standardText = character.nameText;
textItem.description = character.description;
string stringId = "CHARACTER." + character.nameText;
textItems[stringId] = textItem;
}
// Export all Say and Menu commands in the scene
// To make it easier to localize, we preserve the command order in each exported block.
Flowchart[] flowcharts = GameObject.FindObjectsOfType<Flowchart>(); Flowchart[] flowcharts = GameObject.FindObjectsOfType<Flowchart>();
foreach (Flowchart flowchart in flowcharts) foreach (Flowchart flowchart in flowcharts)
{ {
// If no localization id has been set then use the Flowchart name
string localizationId = flowchart.localizationId;
if (localizationId.Length == 0)
{
localizationId = flowchart.name;
}
Block[] blocks = flowchart.GetComponentsInChildren<Block>(); Block[] blocks = flowchart.GetComponentsInChildren<Block>();
foreach (Block block in blocks) foreach (Block block in blocks)
{ {
foreach (Command command in block.commandList) foreach (Command command in block.commandList)
{ {
string stringId = ""; ILocalizable localizable = command as ILocalizable;
string standardText = ""; if (localizable != null)
string description = "";
System.Type type = command.GetType();
if (type == typeof(Say))
{
// String id for Say commands is SAY.<Localization Id>.<Command id>.<Character Name>
Say sayCommand = command as Say;
standardText = sayCommand.storyText;
description = sayCommand.description;
stringId = "SAY." + localizationId + "." + sayCommand.itemId + ".";
if (sayCommand.character != null)
{
stringId += sayCommand.character.nameText;
}
}
else if (type == typeof(Menu))
{
// String id for Menu commands is MENU.<Localization Id>.<Command id>
Menu menuCommand = command as Menu;
standardText = menuCommand.text;
description = menuCommand.description;
stringId = "MENU." + localizationId + "." + menuCommand.itemId;
}
else if (type == typeof(Write))
{
// String id for Write commands is WRITE.<Localization Id>.<Command id>
Write writeCommand = command as Write;
standardText = writeCommand.text;
description = writeCommand.description;
stringId = "WRITE." + localizationId + "." + writeCommand.itemId;
}
else if (type == typeof(SetText))
{ {
// String id for Set Text commands is SETTEXT.<Localization Id>.<Command id> TextItem textItem = new TextItem();
SetText setTextCommand = command as SetText; textItem.standardText = localizable.GetStandardText();
standardText = setTextCommand.text; textItem.description = localizable.GetDescription();
description = setTextCommand.description; textItems[localizable.GetStringId()] = textItem;
stringId = "SETTEXT." + localizationId + "." + setTextCommand.itemId;
}
else
{
continue;
}
TextItem textItem = null;
if (textItems.ContainsKey(stringId))
{
textItem = textItems[stringId];
}
else
{
textItem = new TextItem();
textItems[stringId] = textItem;
} }
}
}
}
// Update basic properties,leaving localised strings intact // Add everything else that's localizable
textItem.standardText = standardText; Component[] components = GameObject.FindObjectsOfType<Component>();
textItem.description = description; foreach (Component component in components)
{
ILocalizable localizable = component as ILocalizable;
if (localizable != null)
{
string stringId = localizable.GetStringId();
if (textItems.ContainsKey(stringId))
{
// Already added
continue;
} }
TextItem textItem = new TextItem();
textItem.standardText = localizable.GetStandardText();
textItem.description = localizable.GetDescription();
textItems[stringId] = textItem;
} }
} }
@ -271,7 +243,9 @@ namespace Fungus
{ {
if (stringId.StartsWith("CHARACTER.") || if (stringId.StartsWith("CHARACTER.") ||
stringId.StartsWith("SAY.") || stringId.StartsWith("SAY.") ||
stringId.StartsWith("MENU.")) stringId.StartsWith("MENU.") ||
stringId.StartsWith("WRITE.") ||
stringId.StartsWith("SETTEXT."))
{ {
// If it's a 'built-in' type this probably means that item has been deleted from its flowchart, // If it's a 'built-in' type this probably means that item has been deleted from its flowchart,
// so there's no need to add a text item for it. // so there's no need to add a text item for it.
@ -380,28 +354,6 @@ namespace Fungus
// Using a localized language text column // Using a localized language text column
// 1. Add all localized text to the localized strings dict // 1. Add all localized text to the localized strings dict
// 2. Update all scene text properties with localized versions // 2. Update all scene text properties with localized versions
// Cache a lookup table of characters in the scene
Dictionary<string, Character> characterDict = new Dictionary<string, Character>();
foreach (Character character in GameObject.FindObjectsOfType<Character>())
{
characterDict[character.nameText] = character;
}
// Cache a lookup table of flowcharts in the scene
Dictionary<string, Flowchart> flowchartDict = new Dictionary<string, Flowchart>();
foreach (Flowchart flowchart in GameObject.FindObjectsOfType<Flowchart>())
{
// If no localization id has been set then use the Flowchart name
string localizationId = flowchart.localizationId;
if (localizationId.Length == 0)
{
localizationId = flowchart.name;
}
flowchartDict[localizationId] = flowchart;
}
for (int i = 1; i < csvTable.Length; ++i) for (int i = 1; i < csvTable.Length; ++i)
{ {
string[] fields = csvTable[i]; string[] fields = csvTable[i];
@ -417,7 +369,7 @@ namespace Fungus
if (languageEntry.Length > 0) if (languageEntry.Length > 0)
{ {
localizedStrings[stringId] = languageEntry; localizedStrings[stringId] = languageEntry;
PopulateTextProperty(stringId, languageEntry, flowchartDict, characterDict); PopulateTextProperty(stringId, languageEntry);
} }
} }
} }
@ -425,181 +377,21 @@ namespace Fungus
/** /**
* Populates the text property of a single scene object with a new text value. * Populates the text property of a single scene object with a new text value.
*/ */
public virtual bool PopulateTextProperty(string stringId, public virtual bool PopulateTextProperty(string stringId, string newText)
string newText,
Dictionary<string, Flowchart> flowchartDict,
Dictionary<string, Character> characterDict)
{ {
string[] idParts = stringId.Split('.'); ILocalizable localizable = null;
if (idParts.Length == 0) localizeableObjects.TryGetValue(stringId, out localizable);
{ if (localizable != null)
return false;
}
string stringType = idParts[0];
if (stringType == "SAY")
{
if (idParts.Length != 4)
{
return false;
}
string flowchartId = idParts[1];
if (!flowchartDict.ContainsKey(flowchartId))
{
return false;
}
Flowchart flowchart = flowchartDict[flowchartId];
int itemId = int.Parse(idParts[2]);
if (flowchart != null)
{
foreach (Say say in flowchart.GetComponentsInChildren<Say>())
{
if (say.itemId == itemId &&
say.storyText != newText)
{
#if UNITY_EDITOR
Undo.RecordObject(say, "Set Text");
#endif
say.storyText = newText;
return true;
}
}
}
}
else if (stringType == "MENU")
{
if (idParts.Length != 3)
{
return false;
}
string flowchartId = idParts[1];
if (!flowchartDict.ContainsKey(flowchartId))
{
return false;
}
Flowchart flowchart = flowchartDict[flowchartId];
int itemId = int.Parse(idParts[2]);
if (flowchart != null)
{
foreach (Menu menu in flowchart.GetComponentsInChildren<Menu>())
{
if (menu.itemId == itemId &&
menu.text != newText)
{
#if UNITY_EDITOR
Undo.RecordObject(menu, "Set Text");
#endif
menu.text = newText;
return true;
}
}
}
}
else if (stringType == "CHARACTER")
{
if (idParts.Length != 2)
{
return false;
}
string characterName = idParts[1];
if (!characterDict.ContainsKey(characterName))
{
return false;
}
Character character = characterDict[characterName];
if (character != null &&
character.nameText != newText)
{
#if UNITY_EDITOR
Undo.RecordObject(character, "Set Text");
#endif
character.nameText = newText;
return true;
}
}
else if (stringType == "WRITE")
{
if (idParts.Length != 3)
{
return false;
}
string flowchartId = idParts[1];
if (!flowchartDict.ContainsKey(flowchartId))
{
return false;
}
Flowchart flowchart = flowchartDict[flowchartId];
int itemId = int.Parse(idParts[2]);
if (flowchart != null)
{
foreach (Write write in flowchart.GetComponentsInChildren<Write>())
{
if (write.itemId == itemId &&
write.text != newText)
{
#if UNITY_EDITOR
Undo.RecordObject(write, "Write");
#endif
write.text.Value = newText;
return true;
}
}
}
}
else if (stringType == "SETTEXT")
{ {
if (idParts.Length != 3) localizable.SetStandardText(newText);
{ return true;
return false;
}
string flowchartId = idParts[1];
if (!flowchartDict.ContainsKey(flowchartId))
{
return false;
}
Flowchart flowchart = flowchartDict[flowchartId];
int itemId = int.Parse(idParts[2]);
if (flowchart != null)
{
foreach (SetText setText in flowchart.GetComponentsInChildren<SetText>())
{
if (setText.itemId == itemId &&
setText.text != newText)
{
#if UNITY_EDITOR
Undo.RecordObject(setText, "Set Text");
#endif
setText.text.Value = newText;
return true;
}
}
}
} }
return false; return false;
} }
/** /**
* Returns all standard text for SAY & MENU commands in the scene using an * Returns all standard text for localizeable text in the scene using an
* easy to edit custom text format. * easy to edit custom text format.
*/ */
public virtual string GetStandardText() public virtual string GetStandardText()
@ -611,11 +403,6 @@ namespace Fungus
int rowCount = 0; int rowCount = 0;
foreach (string stringId in textItems.Keys) foreach (string stringId in textItems.Keys)
{ {
if (!stringId.StartsWith("SAY.") && !(stringId.StartsWith("MENU.")))
{
continue;
}
TextItem languageItem = textItems[stringId]; TextItem languageItem = textItems[stringId];
textData += "#" + stringId + "\n"; textData += "#" + stringId + "\n";
@ -633,27 +420,6 @@ namespace Fungus
*/ */
public virtual void SetStandardText(string textData) public virtual void SetStandardText(string textData)
{ {
// Cache a lookup table of characters in the scene
Dictionary<string, Character> characterDict = new Dictionary<string, Character>();
foreach (Character character in GameObject.FindObjectsOfType<Character>())
{
characterDict[character.nameText] = character;
}
// Cache a lookup table of flowcharts in the scene
Dictionary<string, Flowchart> flowchartDict = new Dictionary<string, Flowchart>();
foreach (Flowchart flowchart in GameObject.FindObjectsOfType<Flowchart>())
{
// If no localization id has been set then use the Flowchart name
string localizationId = flowchart.localizationId;
if (localizationId.Length == 0)
{
localizationId = flowchart.name;
}
flowchartDict[localizationId] = flowchart;
}
string[] lines = textData.Split('\n'); string[] lines = textData.Split('\n');
int updatedCount = 0; int updatedCount = 0;
@ -668,7 +434,7 @@ namespace Fungus
if (stringId.Length > 0) if (stringId.Length > 0)
{ {
// Write buffered text to the appropriate text property // Write buffered text to the appropriate text property
if (PopulateTextProperty(stringId, buffer.Trim(), flowchartDict, characterDict)) if (PopulateTextProperty(stringId, buffer.Trim()))
{ {
updatedCount++; updatedCount++;
} }
@ -687,7 +453,7 @@ namespace Fungus
// Handle last buffered entry // Handle last buffered entry
if (stringId.Length > 0) if (stringId.Length > 0)
{ {
if (PopulateTextProperty(stringId, buffer.Trim(), flowchartDict, characterDict)) if (PopulateTextProperty(stringId, buffer.Trim()))
{ {
updatedCount++; updatedCount++;
} }

27
Assets/Fungus/UI/Scripts/Commands/SetText.cs

@ -11,7 +11,7 @@ namespace Fungus
"Sets the text property on a UI Text object and/or an Input Field object.")] "Sets the text property on a UI Text object and/or an Input Field object.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class SetText : Command public class SetText : Command, ILocalizable
{ {
[Tooltip("Text object to set text on. Can be a UI Text, Text Field or Text Mesh object.")] [Tooltip("Text object to set text on. Can be a UI Text, Text Field or Text Mesh object.")]
public GameObject targetTextObject; public GameObject targetTextObject;
@ -86,6 +86,31 @@ namespace Fungus
targetTextObject = _textObjectObsolete.gameObject; targetTextObject = _textObjectObsolete.gameObject;
} }
} }
//
// ILocalizable implementation
//
public virtual string GetStandardText()
{
return text;
}
public virtual void SetStandardText(string standardText)
{
text.Value = standardText;
}
public virtual string GetDescription()
{
return description;
}
public virtual string GetStringId()
{
// String id for Set Text commands is SETTEXT.<Localization Id>.<Command id>
return "SETTEXT." + GetFlowchartLocalizationId() + "." + itemId;
}
} }
} }

27
Assets/Fungus/UI/Scripts/Commands/Write.cs

@ -11,7 +11,7 @@ namespace Fungus
"Writes content to a UI Text or Text Mesh object.")] "Writes content to a UI Text or Text Mesh object.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class Write : Command public class Write : Command, ILocalizable
{ {
[Tooltip("Text object to set text on. Text, Input Field and Text Mesh objects are supported.")] [Tooltip("Text object to set text on. Text, Input Field and Text Mesh objects are supported.")]
public GameObject textObject; public GameObject textObject;
@ -107,6 +107,31 @@ namespace Fungus
return writer; return writer;
} }
//
// ILocalizable implementation
//
public virtual string GetStandardText()
{
return text;
}
public virtual void SetStandardText(string standardText)
{
text.Value = standardText;
}
public virtual string GetDescription()
{
return description;
}
public virtual string GetStringId()
{
// String id for Write commands is WRITE.<Localization Id>.<Command id>
return "WRITE." + GetFlowchartLocalizationId() + "." + itemId;
}
} }
} }

4
Assets/Tests/Localisation/CSV/localization_Commands.csv

@ -1,5 +1,5 @@
Key,Description,Standard,FR Key,Description,Standard,FR
WRITE.Flowchart.1,,English text,texte français SETTEXT.Flowchart.6,,English text,texte français
SETTEXT.Flowchart.5,,English text,texte français SETTEXT.Flowchart.5,,English text,texte français
WRITE.Flowchart.3,,English text,texte français WRITE.Flowchart.3,,English text,texte français
SETTEXT.Flowchart.6,,English text,texte français WRITE.Flowchart.1,,English text,texte français

1 Key Description Standard FR
2 WRITE.Flowchart.1 SETTEXT.Flowchart.6 English text texte français
3 SETTEXT.Flowchart.5 English text texte français
4 WRITE.Flowchart.3 English text texte français
5 SETTEXT.Flowchart.6 WRITE.Flowchart.1 English text texte français

4
Assets/Tests/Localisation/CSV/localization_Narrative.csv

@ -0,0 +1,4 @@
Key,Description,Standard,FR
SAY.Flowchart.1.Character Name,,Say text,Dites texte
MENU.Flowchart.2,,Option text,Texte Option
CHARACTER.Character Name,,Character Name,Le nom du personnage
1 Key Description Standard FR
2 SAY.Flowchart.1.Character Name Say text Dites texte
3 MENU.Flowchart.2 Option text Texte Option
4 CHARACTER.Character Name Character Name Le nom du personnage

8
Assets/Tests/Localisation/CSV/localization_Narrative.csv.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5d25dc3ca14874409ad738ecbe1f7627
timeCreated: 1439990493
licenseType: Free
TextScriptImporter:
userData:
assetBundleName:
assetBundleVariant:

484
Assets/Tests/Localisation/LocalisationTests.unity

@ -261,7 +261,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 4 m_RootOrder: 5
--- !u!1 &263238434 --- !u!1 &263238434
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -302,6 +302,101 @@ Transform:
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 2 m_RootOrder: 2
--- !u!1 &292727465
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 292727466}
- 114: {fileID: 292727467}
m_Layer: 0
m_Name: NarrativeLocalizationTest
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &292727466
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 292727465}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 331926889}
- {fileID: 679750563}
- {fileID: 1141038908}
- {fileID: 622392413}
m_Father: {fileID: 0}
m_RootOrder: 4
--- !u!114 &292727467
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 292727465}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b1dba0b27b0864740a8720e920aa88c0, type: 3}
m_Name:
m_EditorClassIdentifier:
timeout: 5
ignored: 0
succeedAfterAllAssertionsAreExecuted: 1
expectException: 0
expectedExceptionList:
succeedWhenExceptionIsThrown: 0
includedPlatforms: -1
platformsToIgnore: []
dynamic: 0
dynamicTypeName:
--- !u!1 &331926888
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 149266, guid: ffbd0831d997545eab75c364da082c1b, type: 2}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 331926889}
- 114: {fileID: 331926890}
m_Layer: 0
m_Name: Localization
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &331926889
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 480768, guid: ffbd0831d997545eab75c364da082c1b, type: 2}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 331926888}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 292727466}
m_RootOrder: 0
--- !u!114 &331926890
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 11438504, guid: ffbd0831d997545eab75c364da082c1b,
type: 2}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 331926888}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e5724422a635e425bae0af9ffe2615d6, type: 3}
m_Name:
m_EditorClassIdentifier:
activeLanguage:
localizationFile: {fileID: 4900000, guid: 5d25dc3ca14874409ad738ecbe1f7627, type: 3}
--- !u!1 &365459144 --- !u!1 &365459144
GameObject: GameObject:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
@ -329,7 +424,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 61dddfdc5e0e44ca298d8f46f7f5a915, type: 3} m_Script: {fileID: 11500000, guid: 61dddfdc5e0e44ca298d8f46f7f5a915, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
selectedFlowchart: {fileID: 587159255} selectedFlowchart: {fileID: 679750556}
--- !u!4 &365459146 --- !u!4 &365459146
Transform: Transform:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
@ -357,7 +452,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 0
--- !u!4 &453921374 --- !u!4 &453921374
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -486,7 +581,8 @@ MonoBehaviour:
width: 1114 width: 1114
height: 859 height: 859
selectedBlock: {fileID: 587159257} selectedBlock: {fileID: 587159257}
selectedCommands: [] selectedCommands:
- {fileID: 587159256}
variables: [] variables: []
description: description:
stepPause: 0 stepPause: 0
@ -565,7 +661,7 @@ MonoBehaviour:
parentBlock: {fileID: 587159257} parentBlock: {fileID: 587159257}
--- !u!114 &587159259 --- !u!114 &587159259
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 587159254} m_GameObject: {fileID: 587159254}
@ -605,7 +701,7 @@ Transform:
m_RootOrder: 0 m_RootOrder: 0
--- !u!114 &587159261 --- !u!114 &587159261
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 587159254} m_GameObject: {fileID: 587159254}
@ -620,7 +716,7 @@ MonoBehaviour:
languageCode: FR languageCode: FR
--- !u!114 &587159262 --- !u!114 &587159262
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 587159254} m_GameObject: {fileID: 587159254}
@ -635,7 +731,7 @@ MonoBehaviour:
duration: 1 duration: 1
--- !u!114 &587159263 --- !u!114 &587159263
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 587159254} m_GameObject: {fileID: 587159254}
@ -655,7 +751,7 @@ MonoBehaviour:
_textObjectObsolete: {fileID: 0} _textObjectObsolete: {fileID: 0}
--- !u!114 &587159264 --- !u!114 &587159264
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 587159254} m_GameObject: {fileID: 587159254}
@ -693,6 +789,309 @@ MonoBehaviour:
compareType: 0 compareType: 0
comparisonType: 4 comparisonType: 4
ignoreCase: 0 ignoreCase: 0
--- !u!1 &622392412
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 622392413}
- 114: {fileID: 622392414}
m_Layer: 0
m_Name: TestAssertions
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &622392413
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 622392412}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 292727466}
m_RootOrder: 3
--- !u!114 &622392414
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 622392412}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8bafa54482a87ac4cbd7ff1bfd1ac93a, type: 3}
m_Name:
m_EditorClassIdentifier:
checkAfterTime: 0
repeatCheckTime: 0
repeatEveryTime: 1
checkAfterFrames: 1
repeatCheckFrame: 1
repeatEveryFrame: 1
hasFailed: 0
checkMethods: 2
m_ActionBase: {fileID: 2000112801}
checksPerformed: 0
--- !u!1 &679750555
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 142980, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, type: 2}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 679750563}
- 114: {fileID: 679750556}
- 114: {fileID: 679750558}
- 114: {fileID: 679750557}
- 114: {fileID: 679750559}
- 114: {fileID: 679750560}
- 114: {fileID: 679750564}
- 114: {fileID: 679750562}
- 114: {fileID: 679750561}
- 114: {fileID: 679750566}
- 114: {fileID: 679750565}
m_Layer: 0
m_Name: Flowchart
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &679750556
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 11430050, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a,
type: 2}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 679750555}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 1.0
scrollPos: {x: 0, y: 0}
variablesScrollPos: {x: 0, y: 0}
variablesExpanded: 1
blockViewHeight: 400
zoom: 1
scrollViewRect:
serializedVersion: 2
x: -380
y: -363
width: 1151
height: 1014
selectedBlock: {fileID: 679750558}
selectedCommands:
- {fileID: 679750557}
variables: []
description: 'This is a manual test to check that localization
works with the Say and Menu commands'
stepPause: 0
colorCommands: 1
hideComponents: 1
saveSelection: 1
localizationId:
--- !u!114 &679750557
MonoBehaviour:
m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 679750555}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ec422cd568a9c4a31ad7c36d0572b9da, type: 3}
m_Name:
m_EditorClassIdentifier:
itemId: 1
errorMessage:
indentLevel: 0
storyText: Say text
description:
character: {fileID: 1141038909}
portrait: {fileID: 0}
voiceOverClip: {fileID: 0}
showAlways: 1
showCount: 1
extendPrevious: 0
fadeIn: 0
fadeOut: 0
waitForClick: 1
setSayDialog: {fileID: 0}
--- !u!114 &679750558
MonoBehaviour:
m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 11433304, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a,
type: 2}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 679750555}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3d3d73aef2cfc4f51abf34ac00241f60, type: 3}
m_Name:
m_EditorClassIdentifier:
nodeRect:
serializedVersion: 2
x: 198
y: 128
width: 120
height: 40
itemId: 0
blockName: Say
description:
eventHandler: {fileID: 0}
commandList:
- {fileID: 679750557}
- {fileID: 679750559}
--- !u!114 &679750559
MonoBehaviour:
m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 679750555}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 841589fc622bc494aa5405f416fa1301, type: 3}
m_Name:
m_EditorClassIdentifier:
itemId: 2
errorMessage:
indentLevel: 0
text: Option text
description:
targetBlock: {fileID: 679750560}
hideIfVisited: 0
interactable:
booleanRef: {fileID: 0}
booleanVal: 1
setMenuDialog: {fileID: 0}
--- !u!114 &679750560
MonoBehaviour:
m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 679750555}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3d3d73aef2cfc4f51abf34ac00241f60, type: 3}
m_Name:
m_EditorClassIdentifier:
nodeRect:
serializedVersion: 2
x: 197
y: 210
width: 120
height: 40
itemId: 3
blockName: Menu Option
description:
eventHandler: {fileID: 0}
commandList:
- {fileID: 679750566}
- {fileID: 679750565}
--- !u!114 &679750561
MonoBehaviour:
m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 679750555}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d2f6487d21a03404cb21b245f0242e79, type: 3}
m_Name:
m_EditorClassIdentifier:
parentBlock: {fileID: 679750564}
--- !u!114 &679750562
MonoBehaviour:
m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 679750555}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 050fb9e6e72f442b3b883da8a965bdeb, type: 3}
m_Name:
m_EditorClassIdentifier:
itemId: 5
errorMessage:
indentLevel: 0
targetFlowchart: {fileID: 0}
targetBlock: {fileID: 679750558}
callMode: 2
--- !u!4 &679750563
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 467082, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, type: 2}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 679750555}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 292727466}
m_RootOrder: 1
--- !u!114 &679750564
MonoBehaviour:
m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 679750555}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3d3d73aef2cfc4f51abf34ac00241f60, type: 3}
m_Name:
m_EditorClassIdentifier:
nodeRect:
serializedVersion: 2
x: 196
y: 42
width: 120
height: 40
itemId: 4
blockName: Start
description:
eventHandler: {fileID: 679750561}
commandList:
- {fileID: 679750562}
--- !u!114 &679750565
MonoBehaviour:
m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 679750555}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 050fb9e6e72f442b3b883da8a965bdeb, type: 3}
m_Name:
m_EditorClassIdentifier:
itemId: 9
errorMessage:
indentLevel: 0
targetFlowchart: {fileID: 0}
targetBlock: {fileID: 679750558}
callMode: 0
--- !u!114 &679750566
MonoBehaviour:
m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 679750555}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3fc625e237d6048bf86f34835d8266d9, type: 3}
m_Name:
m_EditorClassIdentifier:
itemId: 8
errorMessage:
indentLevel: 0
languageCode: FR
--- !u!1 &881473892 --- !u!1 &881473892
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -844,6 +1243,53 @@ CanvasRenderer:
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1134558494} m_GameObject: {fileID: 1134558494}
--- !u!1 &1141038907
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 100000, guid: b20518d45890e4be59ba82946f88026c, type: 2}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 1141038908}
- 114: {fileID: 1141038909}
m_Layer: 0
m_Name: Character
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1141038908
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 400000, guid: b20518d45890e4be59ba82946f88026c, type: 2}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1141038907}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 292727466}
m_RootOrder: 2
--- !u!114 &1141038909
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 11400000, guid: b20518d45890e4be59ba82946f88026c,
type: 2}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1141038907}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 25fb867d2049d41f597aefdd6b19f598, type: 3}
m_Name:
m_EditorClassIdentifier:
nameText: Character Name
nameColor: {r: 1, g: 1, b: 1, a: 1}
soundEffect: {fileID: 0}
profileSprite: {fileID: 0}
portraits: []
portraitsFace: 0
description:
--- !u!1 &1242222009 --- !u!1 &1242222009
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1051,6 +1497,26 @@ RectTransform:
m_AnchoredPosition: {x: 33, y: 89} m_AnchoredPosition: {x: 33, y: 89}
m_SizeDelta: {x: 550, y: 50} m_SizeDelta: {x: 550, y: 50}
m_Pivot: {x: .5, y: .5} m_Pivot: {x: .5, y: .5}
--- !u!114 &2000112801
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 58783f051e477fd4e93b42ec7a43bb64, type: 3}
m_Name:
m_EditorClassIdentifier:
go: {fileID: 331926888}
thisPropertyPath: Localization.activeLanguage
compareToType: 1
other: {fileID: 0}
otherPropertyPath:
constantValueGeneric:
compareType: 0
comparisonType: 4
ignoreCase: 0
--- !u!1 &2104226803 --- !u!1 &2104226803
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

Loading…
Cancel
Save