public void SetOwnerZone(CardZoneMaster zone) { if (Zone != zone) { Zone = zone; OwnerZoneChangedEvent?.Invoke(Zone); } }
protected override void OnRefresh() { SeatPhaseTag = Entity.GetComponent <SeatPhaseTag>(); CardZone[] cardZones = Enum.GetValues(typeof(CardZone)) as CardZone[]; for (int i = 0; i < cardZones.Length; i++) { CardZoneMaster cardZoneMaster = Entity.GetComponent <CardZoneMaster>(x => x.CardZoneTag?.CardZone == cardZones[i]); if (cardZoneMaster != null) { _cardZones[cardZones[i]] = cardZoneMaster; } else { _cardZones.Remove(cardZones[i]); } } }
public static void MoveToZone(Entity entity, CardZoneMaster zone) { InsideZoneTag ownerZoneTag = entity.GetComponent <InsideZoneTag>(); if (ownerZoneTag != null) { if (zone == null) { entity.RemoveComponent(ownerZoneTag); } else { ownerZoneTag.SetOwnerZone(zone); } } else if (zone != null) { entity.AddComponent(new InsideZoneTag(zone)); } }
public InsideZoneTag(CardZoneMaster zone) { Zone = zone; }