protected override void OnExecuteEvent(VEntity entity) { CardZoneMoveEvent eventity = VEntityComponentSystemManager.GetVComponent <CardZoneMoveEvent>(entity); CardZoneDataComponent comp = ecsManager.GetVSingletonComponent <CardZoneDataComponent>(); if (eventity.source != Zone.NULL) { //Assert.IsTrue(comp.zones[eventity.source].Contains(eventity.card)); if (!comp.zones[eventity.source].Contains(eventity.card)) { return; //HACK } comp.zones[eventity.source].Remove(eventity.card); comp.zones[eventity.destination].Add(eventity.card); } else { comp.zones[eventity.destination].Add(eventity.card); } ecsManager.QueueAnimationEvent(ecsManager.CreateEntity("CardMovementAnimation", component: new CardZoneMoveEvent { source = eventity.source, destination = eventity.destination, card = eventity.card })); }
public override void DoImmediateAnimation(VEntity entity) { CardZoneMoveEvent moveEvent = entity.GetVComponent <CardZoneMoveEvent>(); CardViewController.Instance.CardMove(moveEvent.source, moveEvent.destination, ecsManager.GetVEntityById(moveEvent.card).GetVComponent <CardDisplayComponent>().cardDisplay); }