- Improved map loading.

- Added extra video and map screens for the players to see better.
This commit is contained in:
2025-07-31 00:49:31 -04:00
parent 83bea35e17
commit 9b847375c7
10 changed files with 631 additions and 48 deletions
+30 -16
View File
@@ -63,22 +63,37 @@ public class CaseVideoSyncPlayer : UdonSharpBehaviour
{
if (_MapDownloadsInProgress)
{
Debug.LogError("[CaseVideoSyncPlayer] Cannot currently requeue a map download while one is in progress.");
return;
// Concatenate both caches into a new bigger cache and await new downloads as usual
int[] NewMapIndicesCache = new int[_CachedMapIndices.Length + MapIndices.Length];
Texture2D[] NewMapImages = new Texture2D[_CachedMapIndices.Length + MapIndices.Length];
for (int i = 0; i < _CachedMapIndices.Length; i++)
{
NewMapIndicesCache[i] = _CachedMapIndices[i];
NewMapImages[i] = _MapImages[i];
}
for (int i = 0; i < MapIndices.Length; i++)
{
NewMapIndicesCache[i + _CachedMapIndices.Length] = MapIndices[i];
NewMapImages[i + _CachedMapIndices.Length] = _PlaceholderMapTexture;
}
_CachedMapIndices = NewMapIndicesCache;
_MapImages = NewMapImages;
}
_MapDownloadsInProgress = true;
_CachedMapIndices = MapIndices;
_MapImages = new Texture2D[_CachedMapIndices.Length];
for (int i = 0; i < _MapImages.Length; i++)
else
{
_MapImages[i] = _PlaceholderMapTexture;
}
_MapDownloadsInProgress = true;
_CachedMapIndices = MapIndices;
_SubMapIndex = 0;
_MapDownloadIndex = 0;
LoadMapFromIndex(_CachedMapIndices[_MapDownloadIndex]);
_MapImages = new Texture2D[_CachedMapIndices.Length];
for (int i = 0; i < _MapImages.Length; i++)
{
_MapImages[i] = _PlaceholderMapTexture;
}
_SubMapIndex = 0;
_MapDownloadIndex = 0;
LoadMapFromIndex(_CachedMapIndices[_MapDownloadIndex]);
}
}
private void LoadMapFromIndex(int MapIndex)
{
@@ -88,15 +103,14 @@ public class CaseVideoSyncPlayer : UdonSharpBehaviour
AdditionalTextureInfo.WrapModeU = TextureWrapMode.Clamp;
AdditionalTextureInfo.WrapModeV = TextureWrapMode.Clamp;
AdditionalTextureInfo.GenerateMipMaps = true;
_MapDownloader.DownloadImage(
MapURL, null, _UdonEventReceiverThis, AdditionalTextureInfo);
_MapDownloader.DownloadImage(MapURL, null, _UdonEventReceiverThis, AdditionalTextureInfo);
}
public override void OnImageLoadSuccess(IVRCImageDownload Result)
{
_MapImages[_MapDownloadIndex] = Result.Result;
int MapPage = SubMapIndex / IMAGES_PER_MAP_ATLAS;
if (MapPage == _CachedMapIndices[MapPage])
if (MapPage == _MapDownloadIndex)
{
_MapScreenMesh.sharedMaterial.SetTexture("_EmissionMap", _MapImages[MapPage]);
}
@@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: BoneFollower
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: 52ecc8a73071e8e40928c3609699fcf4,
serializedUdonProgramAsset: {fileID: 11400000, guid: ccbda9bf23e2f714c9226283c77a92e5,
type: 2}
udonAssembly:
assemblyError:
@@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: InteractToggle
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: 873dfce61b1514e429c92e0d2fded7de,
serializedUdonProgramAsset: {fileID: 11400000, guid: 405e38d3dfb2f514daeed0e28fbb4864,
type: 2}
udonAssembly:
assemblyError:
@@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: PlayerModSetter
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: e81558796a212ab4d88e305e2010f24b,
serializedUdonProgramAsset: {fileID: 11400000, guid: f938e6c4ff027a74da405a1f9353fd2b,
type: 2}
udonAssembly:
assemblyError:
@@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: GlobalToggleObject
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: 2fe8ced6184000f49bca526cd2c5891c,
serializedUdonProgramAsset: {fileID: 11400000, guid: c49c9265a3ef24642a6a4465d0a78872,
type: 2}
udonAssembly:
assemblyError:
@@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: MasterToggleObject
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: a2d01d9f36ac6df49831be249e48ecc4,
serializedUdonProgramAsset: {fileID: 11400000, guid: 04024a76ab1924042ba521e11cb76d91,
type: 2}
udonAssembly:
assemblyError:
@@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: TrackingDataFollower
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: 1b89d4552983c0448a7389decec3b555,
serializedUdonProgramAsset: {fileID: 11400000, guid: 17f8fbbe6cc186d4f8dbb057b01a4ec2,
type: 2}
udonAssembly:
assemblyError:
@@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: WorldAudioSettings
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: 994b559b0f158b4499f8937980ed8694,
serializedUdonProgramAsset: {fileID: 11400000, guid: 128d924a3066b7546b2d1c73e61006ab,
type: 2}
udonAssembly:
assemblyError: