fix: Move nearly all managers on Managers

This commit is contained in:
Michel Roux 2024-01-28 00:04:18 +01:00
parent b37a06faab
commit 5d75c6b827
4 changed files with 48 additions and 56 deletions

View File

@ -231,6 +231,9 @@ MonoBehaviour:
waitingForPlayersPage: {fileID: 0} waitingForPlayersPage: {fileID: 0}
roomCodeLabel: {fileID: 0} roomCodeLabel: {fileID: 0}
waitingForPlayersLabels: [] waitingForPlayersLabels: []
promptList: {fileID: 0}
explanationPage: {fileID: 0}
counter: {fileID: 0}
waitingForPropositionsPage: {fileID: 0} waitingForPropositionsPage: {fileID: 0}
waitingForPropositionsLabels: [] waitingForPropositionsLabels: []
propositionTime: 60 propositionTime: 60
@ -360,7 +363,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1} m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -66.94092} m_AnchoredPosition: {x: 0, y: -66.941}
m_SizeDelta: {x: 0, y: 112.377} m_SizeDelta: {x: 0, y: 112.377}
m_Pivot: {x: 0.5, y: 1} m_Pivot: {x: 0.5, y: 1}
--- !u!114 &204401156 --- !u!114 &204401156
@ -542,7 +545,7 @@ MonoBehaviour:
m_OnClick: m_OnClick:
m_PersistentCalls: m_PersistentCalls:
m_Calls: m_Calls:
- m_Target: {fileID: 1316036599} - m_Target: {fileID: 429358651}
m_TargetAssemblyTypeName: CameraManager, Assembly-CSharp m_TargetAssemblyTypeName: CameraManager, Assembly-CSharp
m_MethodName: WebcamStop m_MethodName: WebcamStop
m_Mode: 1 m_Mode: 1
@ -857,8 +860,10 @@ GameObject:
m_Component: m_Component:
- component: {fileID: 429358650} - component: {fileID: 429358650}
- component: {fileID: 429358649} - component: {fileID: 429358649}
- component: {fileID: 429358651}
- component: {fileID: 429358652}
m_Layer: 0 m_Layer: 0
m_Name: '[FirebaseInitialise]' m_Name: '[Managers]'
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
@ -891,6 +896,36 @@ Transform:
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 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
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: 3b41deef4ebd372d5a18eabdb00cfbb4, type: 3}
m_Name:
m_EditorClassIdentifier:
PicturePlayer: {fileID: 1316036595}
Canvas: {fileID: 1202782726}
--- !u!1 &436596783 --- !u!1 &436596783
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -2865,7 +2900,7 @@ MonoBehaviour:
m_OnClick: m_OnClick:
m_PersistentCalls: m_PersistentCalls:
m_Calls: m_Calls:
- m_Target: {fileID: 1316036599} - m_Target: {fileID: 429358651}
m_TargetAssemblyTypeName: CameraManager, Assembly-CSharp m_TargetAssemblyTypeName: CameraManager, Assembly-CSharp
m_MethodName: WebcamResume m_MethodName: WebcamResume
m_Mode: 1 m_Mode: 1
@ -3480,16 +3515,6 @@ MonoBehaviour:
name: name:
id: id:
creationDate: 0 creationDate: 0
currentQuestion:
promptId:
propositions:
photoUrl:
owner:
name:
id:
creationDate: 0
voters: []
creationDate: 0
explanationTime: 4 explanationTime: 4
roomCodeField: {fileID: 2023851070} roomCodeField: {fileID: 2023851070}
roomError: {fileID: 991600093} roomError: {fileID: 991600093}
@ -3786,7 +3811,6 @@ GameObject:
- component: {fileID: 1316036596} - component: {fileID: 1316036596}
- component: {fileID: 1316036598} - component: {fileID: 1316036598}
- component: {fileID: 1316036600} - component: {fileID: 1316036600}
- component: {fileID: 1316036599}
m_Layer: 5 m_Layer: 5
m_Name: PicturePlayer m_Name: PicturePlayer
m_TagString: Untagged m_TagString: Untagged
@ -3821,21 +3845,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1316036595} m_GameObject: {fileID: 1316036595}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!114 &1316036599
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1316036595}
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}
--- !u!114 &1316036600 --- !u!114 &1316036600
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -3920,7 +3929,7 @@ MonoBehaviour:
m_OnCullStateChanged: m_OnCullStateChanged:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
m_Sprite: {fileID: 21300000, guid: 141de4e4cebc12c489ea471b0df36fd8, type: 3} m_Sprite: {fileID: 0}
m_Type: 0 m_Type: 0
m_PreserveAspect: 0 m_PreserveAspect: 0
m_FillCenter: 1 m_FillCenter: 1
@ -4288,7 +4297,7 @@ MonoBehaviour:
m_OnClick: m_OnClick:
m_PersistentCalls: m_PersistentCalls:
m_Calls: m_Calls:
- m_Target: {fileID: 1316036599} - m_Target: {fileID: 429358651}
m_TargetAssemblyTypeName: CameraManager, Assembly-CSharp m_TargetAssemblyTypeName: CameraManager, Assembly-CSharp
m_MethodName: WebcamChange m_MethodName: WebcamChange
m_Mode: 1 m_Mode: 1
@ -4320,7 +4329,7 @@ MonoBehaviour:
m_OnCullStateChanged: m_OnCullStateChanged:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
m_Sprite: {fileID: 21300000, guid: 1380dfa5b6a644f45a1b60c91f4e151e, type: 3} m_Sprite: {fileID: 21300000, guid: 446bab8e06600e1418d7601d9ffe3fc6, type: 3}
m_Type: 0 m_Type: 0
m_PreserveAspect: 0 m_PreserveAspect: 0
m_FillCenter: 1 m_FillCenter: 1
@ -6198,7 +6207,6 @@ GameObject:
- component: {fileID: 2010012970} - component: {fileID: 2010012970}
- component: {fileID: 2010012969} - component: {fileID: 2010012969}
- component: {fileID: 2010012968} - component: {fileID: 2010012968}
- component: {fileID: 2010012971}
m_Layer: 5 m_Layer: 5
m_Name: SubmitBtn m_Name: SubmitBtn
m_TagString: Untagged m_TagString: Untagged
@ -6270,9 +6278,9 @@ MonoBehaviour:
m_OnClick: m_OnClick:
m_PersistentCalls: m_PersistentCalls:
m_Calls: m_Calls:
- m_Target: {fileID: 2010012971} - m_Target: {fileID: 429358652}
m_TargetAssemblyTypeName: StorageManager, Assembly-CSharp m_TargetAssemblyTypeName: StorageManager, Assembly-CSharp
m_MethodName: SaveFile m_MethodName: UploadPhoto
m_Mode: 1 m_Mode: 1
m_Arguments: m_Arguments:
m_ObjectArgument: {fileID: 0} m_ObjectArgument: {fileID: 0}
@ -6320,20 +6328,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2010012966} m_GameObject: {fileID: 2010012966}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!114 &2010012971
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2010012966}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3b41deef4ebd372d5a18eabdb00cfbb4, type: 3}
m_Name:
m_EditorClassIdentifier:
PicturePlayer: {fileID: 1316036595}
Canvas: {fileID: 1202782726}
--- !u!1 &2023851068 --- !u!1 &2023851068
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -8,6 +8,7 @@ public class CameraManager : MonoBehaviour
public WebCamDevice wDevice; public WebCamDevice wDevice;
public Button freezeButton; public Button freezeButton;
public Button resumeButton; public Button resumeButton;
public RawImage photoBox;
private Texture2D photo; private Texture2D photo;
// Start is called before the first frame update // Start is called before the first frame update
@ -30,7 +31,7 @@ void Start()
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {
gameObject.GetComponent<RawImage>().texture = GetPhoto(); photoBox.texture = GetPhoto();
Resources.UnloadUnusedAssets(); Resources.UnloadUnusedAssets();
} }

View File

@ -16,7 +16,7 @@ public class PromptListLoader : MonoBehaviour
private FirebaseFirestore db; private FirebaseFirestore db;
private void Start() private void Awake()
{ {
FirebaseInitializer.Instance.onFirebaseReady += Initialize; FirebaseInitializer.Instance.onFirebaseReady += Initialize;
} }

View File

@ -6,20 +6,17 @@
public class StorageManager : MonoBehaviour public class StorageManager : MonoBehaviour
{ {
public GameObject PicturePlayer;
public GameObject Canvas; public GameObject Canvas;
private StorageReference storage; private StorageReference storage;
private DatabaseReference realtimeDB; private DatabaseReference realtimeDB;
void Awake() void Awake()
{ {
Debug.Log("non");
FirebaseInitializer.Instance.onFirebaseReady += Initialize; FirebaseInitializer.Instance.onFirebaseReady += Initialize;
} }
void Initialize() void Initialize()
{ {
Debug.Log("oui");
FirebaseInitializer.Instance.onFirebaseReady -= Initialize; FirebaseInitializer.Instance.onFirebaseReady -= Initialize;
storage = FirebaseStorage.DefaultInstance.RootReference; storage = FirebaseStorage.DefaultInstance.RootReference;
realtimeDB = FirebaseDatabase.DefaultInstance.RootReference; realtimeDB = FirebaseDatabase.DefaultInstance.RootReference;
@ -39,7 +36,7 @@ void Update()
public void UploadPhoto() public void UploadPhoto()
{ {
Texture2D photo = PicturePlayer.GetComponent<CameraManager>().GetPhoto(); Texture2D photo = gameObject.GetComponent<CameraManager>().GetPhoto();
byte[] photoBytes = ImageConversion.EncodeToJPG(photo); byte[] photoBytes = ImageConversion.EncodeToJPG(photo);
GameManager game = Canvas.GetComponent<GameManager>(); GameManager game = Canvas.GetComponent<GameManager>();