Add title to Puschlav, change BT-LoadImage to wait until img is fully loaded
This commit is contained in:
parent
e519f33126
commit
7cf10f27dc
@ -68,7 +68,7 @@ Tree("40_Puschlav_Story_C_Puschlav") {
|
||||
|
||||
Composite(Marathon) {
|
||||
BTC.Hide("GO.STATIC.Background")
|
||||
BTC.Hide("GO.UI.ViaggioLogo")
|
||||
BTC.Hide("GO.UI.Canvas")
|
||||
}
|
||||
|
||||
// Start Slideshow
|
||||
|
@ -46,6 +46,7 @@ public class NamedStereoscopicSlideshow : ComponentHandler {
|
||||
public PhotoTransition photoTransition;
|
||||
float _timeLeft;
|
||||
public float totalTime = 5.0f;
|
||||
int _indexImgList = 0;
|
||||
|
||||
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)
|
||||
{
|
||||
string path = photoTransition.imgPathList[index];
|
||||
string path = photoTransition.imgPathList[indexPath];
|
||||
_indexImgList = photoTransition.GetLengthOfImgList();
|
||||
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
@ -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()
|
||||
{
|
||||
Reset();
|
||||
|
Loading…
x
Reference in New Issue
Block a user