This commit is contained in:
Morgan - 6 Freedom 2024-01-28 01:49:42 +01:00
commit f7dcf0ce0d
3 changed files with 31 additions and 68 deletions

View File

@ -233,11 +233,13 @@ MonoBehaviour:
waitingForPlayersLabels: []
promptList: {fileID: 0}
explanationPage: {fileID: 0}
counter: {fileID: 0}
explanationCounter: {fileID: 0}
explanationTime: 0
counterSFX: {fileID: 0}
waitingForPropositionsPage: {fileID: 0}
waitingForPropositionsLabels: []
propositionCounter: {fileID: 0}
propositionTime: 60
timerGUI: {fileID: 0}
waitingForPropositionsLabels: []
votingTime: 20
--- !u!4 &157909815
Transform:
@ -545,7 +547,7 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 429358651}
- m_Target: {fileID: 1181392807}
m_TargetAssemblyTypeName: CameraManager, Assembly-CSharp
m_MethodName: WebcamStop
m_Mode: 1
@ -860,7 +862,6 @@ GameObject:
m_Component:
- component: {fileID: 429358650}
- component: {fileID: 429358649}
- component: {fileID: 429358651}
- component: {fileID: 429358652}
- component: {fileID: 429358653}
m_Layer: 0
@ -897,22 +898,6 @@ Transform:
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &429358651
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: efbbc7abb0db8c7e0b29ec4bb986d783, type: 3}
m_Name:
m_EditorClassIdentifier:
wTexture: {fileID: 0}
freezeButton: {fileID: 223773138}
resumeButton: {fileID: 1114535086}
photoBox: {fileID: 1316036600}
--- !u!114 &429358652
MonoBehaviour:
m_ObjectHideFlags: 0
@ -925,7 +910,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 3b41deef4ebd372d5a18eabdb00cfbb4, type: 3}
m_Name:
m_EditorClassIdentifier:
Canvas: {fileID: 1202782726}
--- !u!114 &429358653
MonoBehaviour:
m_ObjectHideFlags: 0
@ -950,6 +934,7 @@ MonoBehaviour:
submitNewPlayer: {fileID: 1158329299}
listPlayersUI: {fileID: 1891690322}
submitStartGame: {fileID: 638947073}
counter: {fileID: 0}
HomeConnection: {fileID: 2027556831}
WaitingRoom: {fileID: 1590939977}
BeforeStart: {fileID: 563000513}
@ -2936,7 +2921,7 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 429358651}
- m_Target: {fileID: 1181392807}
m_TargetAssemblyTypeName: CameraManager, Assembly-CSharp
m_MethodName: WebcamResume
m_Mode: 1
@ -3399,13 +3384,14 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 1181392806}
- component: {fileID: 1181392807}
m_Layer: 5
m_Name: TakePictureState
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &1181392806
RectTransform:
m_ObjectHideFlags: 0
@ -3432,6 +3418,22 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1181392807
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1181392805}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: efbbc7abb0db8c7e0b29ec4bb986d783, type: 3}
m_Name:
m_EditorClassIdentifier:
wTexture: {fileID: 0}
freezeButton: {fileID: 223773138}
resumeButton: {fileID: 1114535086}
photoBox: {fileID: 1316036600}
--- !u!1 &1202782726
GameObject:
m_ObjectHideFlags: 0
@ -3534,43 +3536,6 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!114 &1202782732
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1202782726}
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}
counter: {fileID: 1383251891}
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 &1224049644
GameObject:
m_ObjectHideFlags: 0
@ -4333,7 +4298,7 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 429358651}
- m_Target: {fileID: 1181392807}
m_TargetAssemblyTypeName: CameraManager, Assembly-CSharp
m_MethodName: WebcamChange
m_Mode: 1

View File

@ -349,9 +349,9 @@ private void CheckIfIAmTheFirst(List<Player> players)
if (players.Count > 1)
{
IOrderedEnumerable<Player> sortedList = players.OrderBy(x => x.creationDate);
List<Player> sortedList = players.OrderBy(x => x.creationDate).ToList();
if (sortedList.Last().id == currentPlayer.id)
if (sortedList[0].id == currentPlayer.id)
{
isFirst = true;
}
@ -397,5 +397,3 @@ public enum GameState
VoteSent = 6,
Score = 7
}

View File

@ -6,7 +6,6 @@
public class StorageManager : MonoBehaviour
{
public GameObject Canvas;
private StorageReference storage;
private DatabaseReference realtimeDB;
@ -39,7 +38,7 @@ public void UploadPhoto()
Texture2D photo = gameObject.GetComponent<CameraManager>().GetPhoto();
byte[] photoBytes = ImageConversion.EncodeToJPG(photo);
GameManager game = Canvas.GetComponent<GameManager>();
GameManager game = gameObject.GetComponent<GameManager>();
string imageUuid = Guid.NewGuid().ToString();
StorageReference imageRef = storage.Child($"{game.myRoom.code}/{game.currentPlayer.id}/{imageUuid}.png");
@ -55,6 +54,7 @@ public void UploadPhoto()
{
// Metadata contains file metadata such as size, content-type, and md5hash.
StorageMetadata metadata = task.Result;
}
});