Add title to Puschlav, change BT-LoadImage to wait until img is fully loaded

This commit is contained in:
Nadine Ganz 2025-08-11 15:53:34 +02:00
parent e519f33126
commit 7cf10f27dc
4 changed files with 794954 additions and 419 deletions

View File

@ -68,7 +68,7 @@ Tree("40_Puschlav_Story_C_Puschlav") {
Composite(Marathon) { Composite(Marathon) {
BTC.Hide("GO.STATIC.Background") BTC.Hide("GO.STATIC.Background")
BTC.Hide("GO.UI.ViaggioLogo") BTC.Hide("GO.UI.Canvas")
} }
// Start Slideshow // Start Slideshow

View File

@ -46,6 +46,7 @@ public class NamedStereoscopicSlideshow : ComponentHandler {
public PhotoTransition photoTransition; public PhotoTransition photoTransition;
float _timeLeft; float _timeLeft;
public float totalTime = 5.0f; public float totalTime = 5.0f;
int _indexImgList = 0;
public override void Run(NodeState nodeState) public override void Run(NodeState nodeState)
{ {
@ -87,16 +88,21 @@ public class NamedStereoscopicSlideshow : ComponentHandler {
} }
} }
public override void LoadImage(NodeState nodeState, int index) public override void LoadImage(NodeState nodeState, int indexPath)
{ {
// LoadImage(0): 1. bild laden im hintergrund
// Show: Setup srctxt (1. bild einblenden) + im hintergrund loadImage(1)
// (Sprachinput): blendimage(2)
if (nodeState == NodeState.FirstRun) if (nodeState == NodeState.FirstRun)
{ {
string path = photoTransition.imgPathList[index]; string path = photoTransition.imgPathList[indexPath];
_indexImgList = photoTransition.GetLengthOfImgList();
StartCoroutine(photoTransition.ImageLoader(path)); StartCoroutine(photoTransition.ImageLoader(path));
Task.SetSucceeded(); }
if (nodeState == NodeState.Running)
{
Texture2D tex = photoTransition.GetTextureOfImgList(_indexImgList);
if (tex != null)
{
Task.SetSucceeded();
}
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -113,6 +113,20 @@ public class PhotoTransition : MonoBehaviour
} }
} }
public int GetLengthOfImgList()
{
return _imgList.Count;
}
public Texture2D GetTextureOfImgList(int index)
{
if (_imgList.Count > index)
{
return _imgList[index];
}
return null;
}
private void OnDestroy() private void OnDestroy()
{ {
Reset(); Reset();