Merge branch 'main' of ssh://patema.crystalyx.net:2222/GameJams/Snaparazzi

This commit is contained in:
Marine 2024-01-28 17:36:17 +01:00
commit 686b00b8d5
2 changed files with 21 additions and 5 deletions

View File

@ -1262,6 +1262,7 @@ GameObject:
serializedVersion: 6 serializedVersion: 6
m_Component: m_Component:
- component: {fileID: 531335862} - component: {fileID: 531335862}
- component: {fileID: 531335863}
m_Layer: 5 m_Layer: 5
m_Name: VotePicturesState m_Name: VotePicturesState
m_TagString: Untagged m_TagString: Untagged
@ -1292,6 +1293,19 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &531335863
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 531335861}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 02c0fa5c3e6cb4ce29942d8cb857076e, type: 3}
m_Name:
m_EditorClassIdentifier:
gameManager: {fileID: 429358653}
--- !u!1 &563000513 --- !u!1 &563000513
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -12,24 +12,26 @@ public class PropositionDownload : MonoBehaviour
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
{ {
} }
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {
} }
void OnEnable() void OnEnable()
{ {
List<Proposition> props = gameManager.myRoom.questions[gameManager.myRoom.currentQuestionId].propositions.Values.ToList(); List<Proposition> props = gameManager.myRoom.questions[gameManager.myRoom.currentQuestionId].propositions.Values.ToList();
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; i++)
storageManager.DownloadImage(props[i].photoUrl, (Texture texture) => { {
StartCoroutine(storageManager.DownloadImage(props[i].photoUrl, (Texture texture) =>
{
Sprite sprite = Sprite.Create(texture as Texture2D, new Rect(0, 0, texture.width, texture.height), Vector2.zero); Sprite sprite = Sprite.Create(texture as Texture2D, new Rect(0, 0, texture.width, texture.height), Vector2.zero);
btns[i].sprite = sprite; btns[i].sprite = sprite;
}); }));
} }
} }