fix: no camera no flood

This commit is contained in:
Michel Roux 2024-01-28 00:21:38 +01:00
parent 97860e4232
commit 5e207ddae7
5 changed files with 188 additions and 13 deletions

BIN
Assets/2DAssets/404.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,166 @@
fileFormatVersion: 2
guid: 9ff1e55f8bf477a569e826492485e011
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -924,7 +924,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 3b41deef4ebd372d5a18eabdb00cfbb4, type: 3} m_Script: {fileID: 11500000, guid: 3b41deef4ebd372d5a18eabdb00cfbb4, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
PicturePlayer: {fileID: 1316036595}
Canvas: {fileID: 1202782726} Canvas: {fileID: 1202782726}
--- !u!1 &436596783 --- !u!1 &436596783
GameObject: GameObject:
@ -3865,7 +3864,7 @@ MonoBehaviour:
m_OnCullStateChanged: m_OnCullStateChanged:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
m_Texture: {fileID: 0} m_Texture: {fileID: 2800000, guid: 9ff1e55f8bf477a569e826492485e011, type: 3}
m_UVRect: m_UVRect:
serializedVersion: 2 serializedVersion: 2
x: 0 x: 0

View File

@ -31,8 +31,11 @@ void Start()
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {
photoBox.texture = GetPhoto(); if (wTexture)
Resources.UnloadUnusedAssets(); {
photoBox.texture = GetPhoto();
Resources.UnloadUnusedAssets();
}
} }
public void WebcamResume() public void WebcamResume()
@ -115,11 +118,13 @@ Texture2D CropTexture(WebCamTexture originalTexture)
public Texture2D GetPhoto() public Texture2D GetPhoto()
{ {
if (photo) { if (photo)
{
return photo; return photo;
} }
if (!wTexture) { if (!wTexture)
{
return null; return null;
} }

View File

@ -54,12 +54,13 @@ private void Start()
HomeConnection.SetActive(true); HomeConnection.SetActive(true);
submitNewPlayer.interactable = false; submitNewPlayer.interactable = false;
} }
private void OnApplicationQuit() private void OnApplicationQuit()
{ {
myOnlineRoom.Child("players").Child(currentPlayer.id).RemoveValueAsync().ContinueWithOnMainThread(task => myOnlineRoom.Child("players").Child(currentPlayer.id).RemoveValueAsync().ContinueWithOnMainThread(task =>
{ {
Debug.Log($"delete player {currentPlayer.name}"); Debug.Log($"delete player {currentPlayer.name}");
if(myOnlineRoom!= null) if (myOnlineRoom != null)
{ {
myOnlineRoom.ValueChanged -= OnRoomUpdate; myOnlineRoom.ValueChanged -= OnRoomUpdate;
} }
@ -276,7 +277,8 @@ private void OnRoomUpdate(object sender, ValueChangedEventArgs e)
{ {
Debug.LogException(ex); Debug.LogException(ex);
} }
if(myRoom == null) { if (myRoom == null)
{
return; return;
} }
switch (myRoom.currentState) switch (myRoom.currentState)
@ -321,9 +323,9 @@ private void CheckIfIAmTheFirst(List<Player> players)
if (players.Count > 1) if (players.Count > 1)
{ {
IOrderedEnumerable<Player> sortedList = players.OrderBy(x=>x.creationDate); IOrderedEnumerable<Player> sortedList = players.OrderBy(x => x.creationDate);
if(sortedList.Last().id == currentPlayer.id) if (sortedList.Last().id == currentPlayer.id)
{ {
isFirst = true; isFirst = true;
} }
@ -334,7 +336,7 @@ private void CheckIfIAmTheFirst(List<Player> players)
submitStartGame.SetActive(true); submitStartGame.SetActive(true);
} }
} }
public void sendCurrentState(GameState state,Action callback_oncCurrentStateSent) public void sendCurrentState(GameState state, Action callback_oncCurrentStateSent)
{ {
myOnlineRoom.Child("currentState").SetValueAsync((int)state).ContinueWithOnMainThread(task => myOnlineRoom.Child("currentState").SetValueAsync((int)state).ContinueWithOnMainThread(task =>
{ {