which i am filling from editor for different localizations. And it’s turning green in editor.
I can see it filled in (Window > Asset Management > Localization Tables)
After that when I am hitting play the variable showing none in editor.
In tutorial page images loading by itself? Then this prefab should be loaded by itself?
Thank you, now it’s working.
What I was doing wrong is I am trying to record scripts, which are attached to the prefabs.
Now I tried to record prefabs and it’s working. I didn’t instantiate anything.
But there is one thing:
Prefab loading only after 0.5 seconds. If I am trying to access the prefab in 0.4 second or before it’s showing null reference exception.
There is no problem in my case but why it’s loading after 0.5 seconds?
They load asynchronously in the background by default so wont be immediately available.
You can force them by enabling the WaitForCompletion flag on the LocalizedAsset.
Hello,
Where I can find “WaitForCompletion” option? Because I can’t find this option anywhere.
I enable an other option Initialize Synchronously in Project settings > Localization. Are you talking about this?
I tried different approches, like
yield return new WaitUntil(() => dialogsPrefab != null); // Wait untill this variable filled by localization
I enabled Initialize Synchronously option.
There is absolutely no error inside the Editor and everything is working fine, but in Windows Standalone build above prefab never loading by Localization.
That has an option in the inspector.
If you are calling LocalizationSettings.AssetDatabase.LoadAsset then it will call WaitForCompletion automatically.
I am not using LocalizationSettings.AssetDatabase.LoadAsset
But how to use it?
I am very beginner to scripting even after years, and I am having trouble understanding documentation. Sorry for the troubles
This is my script:
public GameObject dialogsPrefab; // I recorded multiple localized prefabs using editor
void Start()
{
if(SceneManager.GetActiveScene().name == "Tutorial")
{
StartCoroutine(Initiate());
}
}
IEnumerator Initiate()
{
// dialogPrefab must be loaded here before reaching below lines
dialogs = dialogsPrefab.GetComponent<Dialogs>();
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
public class Dialogs : MonoBehaviour
{
[System.Serializable]
public class First
{
[TextArea(minLines: 5, maxLines: 10)]
public List<string> sentences;
}
public List<First> nestedList = new List<First>();
public int[] dialogWaitTimes;
}
Can you change it from List to List?
Although I think I may be misunderstanding the problem. What is it you are trying to solve? The prefab loading too slowly? How do you load the prefab?
Yes I can change. I just hope I know this before. dialogsPrefab not loading problem is fixed after switching from .NET Standard 2.0 to .NET 4.x. But now I can also switch to List if there is more problem in future. Thank you so much
Hello @karl_jones
I want remove asset table and all recorded data. I deleted all asset table files, I even changed variable name in the script but it’s not letting go Localized property. It’s keep turning green.