Fix store manager

This commit is contained in:
Michel Roux 2024-01-28 16:32:09 +01:00
parent b3843ab76c
commit a58a543514

View File

@ -6,6 +6,7 @@
public class StorageManager : MonoBehaviour public class StorageManager : MonoBehaviour
{ {
public GameObject managers;
private StorageReference storage; private StorageReference storage;
private DatabaseReference realtimeDB; private DatabaseReference realtimeDB;
@ -35,10 +36,10 @@ void Update()
public void UploadPhoto(string roomCode, string playerId, int question, int proposition) public void UploadPhoto(string roomCode, string playerId, int question, int proposition)
{ {
Texture2D photo = gameObject.GetComponent<CameraManager>().GetPhoto(); Texture2D photo = managers.GetComponent<CameraManager>().GetPhoto();
byte[] photoBytes = ImageConversion.EncodeToJPG(photo); byte[] photoBytes = ImageConversion.EncodeToJPG(photo);
GameManager game = gameObject.GetComponent<GameManager>(); GameManager game = managers.GetComponent<GameManager>();
string imageUuid = Guid.NewGuid().ToString(); string imageUuid = Guid.NewGuid().ToString();
StorageReference imageRef = storage.Child($"{roomCode}/{playerId}/{imageUuid}.png"); StorageReference imageRef = storage.Child($"{roomCode}/{playerId}/{imageUuid}.png");