Рефакторинг VitrinaView
This commit is contained in:
parent
f252cd5f79
commit
af8062ec59
@ -11349,7 +11349,7 @@ Material:
|
||||
- _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767}
|
||||
- _EnvMatrixRotation: {r: 0, g: 0, b: 0, a: 0}
|
||||
- _FaceColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _GlowColor: {r: 0, g: 0.097905874, b: 1, a: 1}
|
||||
- _GlowColor: {r: 0, g: 0.38125563, b: 1, a: 1}
|
||||
- _MaskCoord: {r: 0, g: 0, b: 32767, a: 32767}
|
||||
- _OutlineColor: {r: 0.554717, g: 0.554717, b: 0.554717, a: 1}
|
||||
- _ReflectFaceColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
|
||||
@ -16,7 +16,6 @@ public class VitrinaView : MonoBehaviour
|
||||
if (instance == null)
|
||||
{
|
||||
instance = GameObject.FindObjectOfType<VitrinaView>();
|
||||
//CharacterEventBus.Instance.OnCharacterAppeared.AddListener(instance.ActivateIfNeed);
|
||||
instance.Deactivate();
|
||||
}
|
||||
return instance;
|
||||
@ -33,13 +32,6 @@ public class VitrinaView : MonoBehaviour
|
||||
[SerializeField] private Color AvailableEmptyColor;
|
||||
[SerializeField] private Color NotAvailableColor;
|
||||
|
||||
//private void Start()
|
||||
//{
|
||||
// instance = this;
|
||||
// CharacterEventBus.Instance.OnCharacterAppeared.AddListener(ActivateIfNeed);
|
||||
|
||||
//}
|
||||
|
||||
public void ActivateIfNeed()
|
||||
{
|
||||
if (GameManager.instance.gameMode == GameMode.pvp)
|
||||
@ -77,16 +69,10 @@ public class VitrinaView : MonoBehaviour
|
||||
{
|
||||
try
|
||||
{
|
||||
// Получаем готовые к выдаче ячейки
|
||||
int[] readyBoxes = await PrizeStandController.GetReadyBoxesAsync();
|
||||
|
||||
// Получаем ячейки, которые нужно выдать из VitrinaPrize
|
||||
int[] boxesToGive = vitrinaPrize?.Boxes ?? new int[0];
|
||||
|
||||
// Создаем HashSet для быстрого поиска готовых ячеек
|
||||
HashSet<int> readyBoxesSet = new HashSet<int>(readyBoxes);
|
||||
|
||||
// Создаем HashSet для быстрого поиска ячеек, которые нужно выдать
|
||||
HashSet<int> boxesToGiveSet = new HashSet<int>(boxesToGive);
|
||||
|
||||
// Проходим по всем ячейкам (индексы 0-based, номера ячеек 1-based)
|
||||
@ -122,7 +108,6 @@ public class VitrinaView : MonoBehaviour
|
||||
if (text != null)
|
||||
{
|
||||
text.color = NotAvailableColor;
|
||||
// НЕ ОЧИЩАЕМ ТЕКСТ! Оставляем номер ячейки
|
||||
}
|
||||
Cells[i].color = NotAvailableColor;
|
||||
}
|
||||
@ -138,7 +123,4 @@ public class VitrinaView : MonoBehaviour
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user