merge branch

This commit is contained in:
Marine 2024-01-28 01:01:34 +01:00
commit 4b20bfd11f
6 changed files with 227 additions and 15 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

@ -862,6 +862,7 @@ GameObject:
- component: {fileID: 429358649}
- component: {fileID: 429358651}
- component: {fileID: 429358652}
- component: {fileID: 429358653}
m_Layer: 0
m_Name: '[Managers]'
m_TagString: Untagged
@ -925,6 +926,42 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
Canvas: {fileID: 1202782726}
--- !u!114 &429358653
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 429358648}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 27a435387a7644784a6fc6ae538b68e5, type: 3}
m_Name:
m_EditorClassIdentifier:
currentPlayer:
name:
id:
creationDate: 0
explanationTime: 4
roomCodeField: {fileID: 2023851070}
roomError: {fileID: 991600093}
playerNameField: {fileID: 1163479463}
nameError: {fileID: 1224049646}
submitNewPlayer: {fileID: 1158329299}
listPlayersUI: {fileID: 1891690322}
submitStartGame: {fileID: 638947073}
HomeConnection: {fileID: 2027556831}
WaitingRoom: {fileID: 1590939977}
BeforeStart: {fileID: 563000513}
TakePicture: {fileID: 1181392805}
VotePicture: {fileID: 531335861}
WaitingOtherPlayers: {fileID: 2095389711}
EndGame: {fileID: 1850164816}
myRoom:
code:
currentQuestion: 0
creationDate: 0
currentState: 0
--- !u!1 &436596783
GameObject:
m_ObjectHideFlags: 0
@ -1257,7 +1294,7 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1202782732}
- m_Target: {fileID: 429358653}
m_TargetAssemblyTypeName: GameManager, Assembly-CSharp
m_MethodName: StartGame
m_Mode: 1
@ -3032,7 +3069,7 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1202782732}
- m_Target: {fileID: 429358653}
m_TargetAssemblyTypeName: GameManager, Assembly-CSharp
m_MethodName: OnClickSubmitSignIn
m_Mode: 1
@ -3407,7 +3444,6 @@ GameObject:
- component: {fileID: 1202782729}
- component: {fileID: 1202782728}
- component: {fileID: 1202782727}
- component: {fileID: 1202782732}
m_Layer: 5
m_Name: Canvas
m_TagString: Untagged
@ -3865,7 +3901,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 9ff1e55f8bf477a569e826492485e011, type: 3}
m_UVRect:
serializedVersion: 2
x: 0

View File

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

View File

@ -59,12 +59,13 @@ private void Start()
HomeConnection.SetActive(true);
submitNewPlayer.interactable = false;
}
private void OnApplicationQuit()
{
myOnlineRoom.Child("players").Child(currentPlayer.id).RemoveValueAsync().ContinueWithOnMainThread(task =>
{
Debug.Log($"delete player {currentPlayer.name}");
if(myOnlineRoom!= null)
if (myOnlineRoom != null)
{
myOnlineRoom.ValueChanged -= OnRoomUpdate;
}
@ -299,7 +300,8 @@ private void OnRoomUpdate(object sender, ValueChangedEventArgs e)
{
Debug.LogException(ex);
}
if(myRoom == null) {
if (myRoom == null)
{
return;
}
switch (myRoom.currentState)
@ -347,9 +349,9 @@ private void CheckIfIAmTheFirst(List<Player> players)
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;
}
@ -360,7 +362,7 @@ private void CheckIfIAmTheFirst(List<Player> players)
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 =>
{

View File

@ -42,7 +42,7 @@ public void UploadPhoto()
GameManager game = Canvas.GetComponent<GameManager>();
string imageUuid = Guid.NewGuid().ToString();
StorageReference imageRef = storage.Child(game.myRoom.code).Child(game.currentPlayer.id).Child($"{imageUuid}.jpg");
StorageReference imageRef = storage.Child($"{game.myRoom.code}/{game.currentPlayer.id}/{imageUuid}.png");
imageRef.PutBytesAsync(photoBytes).ContinueWith((Task<StorageMetadata> task) =>
{