After many rewrites and much debugging, video syncing finally works properly.
This commit is contained in:
@@ -116,8 +116,6 @@ public class CaseManager : UdonSharpBehaviour
|
||||
_CaseFileVideosFallback = CaseFile.FallbackVideoFiles;
|
||||
_CaseFileClueImages = CaseFile.ClueImages;
|
||||
|
||||
_Round1Manager.SetNewVideoPlayerLists(_CaseFileMaps, _CaseFileVideos);
|
||||
|
||||
VRCStringDownloader.LoadUrl(_CaseFileCluesURL, (IUdonEventReceiver)this);
|
||||
}
|
||||
|
||||
@@ -268,6 +266,10 @@ public class CaseManager : UdonSharpBehaviour
|
||||
return CrookToString(_AccusedCrook);
|
||||
}
|
||||
|
||||
public VRCUrl[] GetMaps()
|
||||
{
|
||||
return _CaseFileMaps;
|
||||
}
|
||||
public VRCUrl GetMap(int MapIndex)
|
||||
{
|
||||
return _CaseFileMaps[MapIndex];
|
||||
@@ -282,6 +284,10 @@ public class CaseManager : UdonSharpBehaviour
|
||||
return _CaseFileLootImage;
|
||||
}
|
||||
|
||||
public VRCUrl[] GetVideos()
|
||||
{
|
||||
return _CaseFileVideos;
|
||||
}
|
||||
public int GetIntroVideo()
|
||||
{
|
||||
return _CaseIntroVideo;
|
||||
|
||||
@@ -140,25 +140,9 @@ public class GameManagerRound1 : GameManagerBase
|
||||
Interface.CommentUI.text = _CaseManager.GetCaseDescription();
|
||||
|
||||
_GameHasBegun = false;
|
||||
}
|
||||
|
||||
|
||||
public void SetNewVideoPlayerLists(VRCUrl[] Maps, VRCUrl[] Videos)
|
||||
{
|
||||
_VideoPlayer.SetNewLists(Maps, Videos);
|
||||
}
|
||||
public void TryIntroVideoLoad()
|
||||
{
|
||||
int IntroVideoIndex = _CaseManager.GetIntroVideo();
|
||||
if (IntroVideoIndex >= 0)
|
||||
{
|
||||
_VideoPlayer.SetVideoIndexLocal(IntroVideoIndex);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("[GameManagerRound1] Intro video index is currently invalid. Retrying...");
|
||||
SendCustomEventDelayedSeconds(nameof(TryIntroVideoLoad), 1.0f);
|
||||
}
|
||||
_VideoPlayer.InitialiseLists(_CaseManager.GetMaps(), _CaseManager.GetVideos());
|
||||
_VideoPlayer.SetVideoIndex(_CaseManager.GetIntroVideo());
|
||||
}
|
||||
|
||||
|
||||
@@ -1802,7 +1786,7 @@ public class GameManagerRound1 : GameManagerBase
|
||||
if (Presentation.ContainsKey("Videos"))
|
||||
{
|
||||
DataList Videos = Presentation["Videos"].DataList;
|
||||
_VideoPlayer.VideoIndex = (int)Videos[_QuestionSubstage].Number;
|
||||
_VideoPlayer.SetVideoIndex((int)Videos[_QuestionSubstage].Number);
|
||||
|
||||
VideosAvailable = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user