I want the player to have the choice to change language at any point in the game.
When I drag the Dialogue Manager to my UP "On Click" button and tell it to ->SetLangauge English.
I can see the language changes in the Dialogue Manager object. But when I start playing the game, many strange things happens, I cant hit pause or move..
How can I acces this in Script:
""To use .NET enumerations, use the Localization.GetLanguage() method:
DialogueManager.SetLanguage(Localization.GetLanguage(SystemLanguage.Spanish)); // Use Spanish.""
If I write DialogueManager in my script, its RED lines. As if It cant find it. How do I find it?
Thansk!
How to find DialogueManager via Script?
Re: How to find DialogueManager via Script?
Hi,
DialogueManager.SetLangugage() is a static method. You don't need to find anything.
DialogueManager is in the PixelCrushers.DialogueSystem namespace. Did you put this line at the top of your script?
If you did, then it's probably an issue with Unity's Visual Studio plugin (or the plugin for whatever code editor you're using). If so, see this post to fix it.
DialogueManager.SetLangugage() is a static method. You don't need to find anything.
DialogueManager is in the PixelCrushers.DialogueSystem namespace. Did you put this line at the top of your script?
Code: Select all
using PixelCrushers.DialogueSystem;
Re: How to find DialogueManager via Script?
Yeah, if I inser this under "Using Untiy Engine" etc, It shows as error..:
using PixelCrushers.DialogueSystem;
I followed your link and tried both alternetavies but still no good. :S I updated to latest version of Visual Studio. i will look around a bit more .
using PixelCrushers.DialogueSystem;
I followed your link and tried both alternetavies but still no good. :S I updated to latest version of Visual Studio. i will look around a bit more .
Re: How to find DialogueManager via Script?
Tony Li wrote: ↑Mon Nov 22, 2021 9:33 am
DialogueManager is in the PixelCrushers.DialogueSystem namespace. Did you put this line at the top of your script?
Code: Select all
using PixelCrushers.DialogueSystem;
Hi again,
So I finally made it work with
Code: Select all
using PixelCrushers.DialogueSystem;
If I try to solve it through UI button:
If I place the DialougeManager on my UI button and assign it to -> DialougeSystemController -> SetLangague -> And I write Japanese. It works fine when I start playing the game. "Japanese" will also show up on the DialougeManager Language String field - and it will state "Japanese".
However, if I return back to the start menu from within the game, that UI "On Click" button field will be empty, since the DialougeManager is "tagging along" to the first scene.
So, I have to solve this through Script I suppose. But then another problem occurs.
If I solve it with scripts and start playing the game. "Japanese" will not show up on the DialougeManager Language String field, instead, it will state "ja" - At this point, it doesn't trigger the Japanese Conversations, it default back to english....
Any idea why it shows "Ja" instead of "Japanese" and where does "Ja" come from?
I have two images to show the inspector.
- Attachments
-
- ViaUI.png (189.21 KiB) Viewed 541 times
-
- viaScript.png (238.86 KiB) Viewed 541 times