UI/raid/implament/online mode#1640
Conversation
| public class Raid_EndMenu : MonoBehaviour | ||
| { | ||
| public static Raid_EndMenu Instance { get; private set; } | ||
|
|
||
| private static readonly Vector2 SpaceRemainingCloudMinimumSize = new Vector2(460f, 300f); | ||
|
|
||
| [SerializeField] | ||
| public RectTransform collectedFurniture; |
There was a problem hiding this comment.
Tarvitseeko näiden olla julkisia?
| [SerializeField] | ||
| public RectTransform collectedFurniture; | ||
| public RectTransform content; | ||
| public Raid_InventoryItem itemPrefab; | ||
| [SerializeField] private Raid_InventoryItem collectedLootItemPrefab; |
There was a problem hiding this comment.
Miksi tässä on kaksi eri Raid_inventory kenttää? Varsinkin kun tuota ylempää käytetään vain, jos tätä alempaa ei löydy...
| [SerializeField] private Vector2 collectedLootGridSpacing = new Vector2(180f, 310f); | ||
| [SerializeField] private int collectedLootGridPaddingTop = 80; | ||
| [SerializeField] private int collectedLootGridPaddingBottom = 40; | ||
| [SerializeField] private int collectedLootColumnCount = 3; | ||
|
|
||
| private CanvasGroup canvasGroup; |
There was a problem hiding this comment.
Tarvitseeko tässä olla erillinen CanvasGroup?
| { | ||
| Debug.LogError("Cannot show collected raid loot because content or itemPrefab is missing."); | ||
| return; | ||
| } | ||
|
|
||
| for (int i = 0; i < lootList.Count; i++) |
There was a problem hiding this comment.
Oliko tässä helpompi käyttää foreach looppia perus for-loopin sijasta.
| spaceRemainingText.text = $"{currentLootWeight:F0}kg\n/{maxLootWeight:F0}kg"; | ||
| spaceRemainingText.text = $"{currentLootWeight:F0} kg\n/{maxLootWeight:F0} kg"; | ||
|
|
||
| spaceRemainingHalo?.Sync(); | ||
| } | ||
|
|
||
| public void ReturnToLobby() | ||
| { | ||
| SceneManager.LoadScene("10-MenuUI"); |
There was a problem hiding this comment.
Tämä pitäisi varmaankin korvata WindowNavigation skriptillä, jolloin meillä on enemmän hallintaa siitä mikä ikkuna avataan seuraavaksi. Nyt se vain avaa päävalikon oletusikkunan.
There was a problem hiding this comment.
Tässä voisi varmaan käyttää foreach-looppia.
| return; | ||
| } | ||
|
|
||
| for (int i = 0; i < content.childCount; i++) |
There was a problem hiding this comment.
Foreach looppi antaisi tuon transformin tai jopa tuon Raid_InventoryItemin suoraan, jolloin sitä ei tarvitsisi hakea erikseen.
| } | ||
| } | ||
| } | ||
|
|
||
| private void SetVisible(bool visible) |
There was a problem hiding this comment.
Tarvitseeko meidän muokata Canvasgroupin arvoja tässä? Yhtä hyvin voisi vain pistää menu objektin päälle ja pois päältä tarvittaessa.
| } | ||
|
|
||
| originalMaterial = sourceMaterial; | ||
| haloMaterial = new Material(sourceMaterial) |
There was a problem hiding this comment.
Voisiko olla mitään järkeä antaa tälle ulkopuolelta haluttu haloMateriaali (esim. constructorissa.) Ja tämä jää tänne sitä varten jos sitä ei ole asetettuna.
| new(0.21f, 0.78f, 1f, 1f), | ||
| new(0.46f, 0.82f, 0.37f, 1f) | ||
| }; | ||
| private static readonly AvatarPiece[] AvatarPieces = |
There was a problem hiding this comment.
En oo täysin varma tarvitseeko tätä kova koodata. Tämänhän saisi vain hakemalla kyseisen enumin arvot ja asettamalla ne listaan. Sen listan sitten voi tallentaa jos sitä tarvitsee usein.
| private Coroutine scrollRoutine; | ||
| private bool warnedMissingReferences; | ||
|
|
||
| public static Raid_EventLog FindForInventory(Transform inventoryRoot) |
There was a problem hiding this comment.
Tämänhän voisi siirtää Raid_references skriptiin, jolloin todennäköisesti ei tarvitse suorittaa potentiaalisesti raskasta hakua, kun tämän referenssi pitäisi olla siellä jo tallessa.
Summary
Implements the online Raid matchmaking flow and updates the Raid UI/prefab setup around it.
Changes
EmptySlot,FurnitureSlot, andGraphicsChanger.