private void OnResetAllRemainingMovement(DebugEvents.ResetAllRemainingMovementEvent e) { foreach (var unit in _gridModel.Units) { unit.GetBehavior <Movement>().RemainingMovement = unit.GetBehavior <Movement>().MaxMovement; } }
void Awake() { CardPreview.gameObject.SetActive(false); GenerateGridButton.onClick.AddListener(delegate { var gridEvent = new GridEvents.CreateDataEvent(); EventSystem.instance.Dispatch(gridEvent); }); PlaceHeroButton.onClick.AddListener(delegate { var heroEvent = new UnitEvents.PlaceHeroEvent(); EventSystem.instance.Dispatch(heroEvent); }); PlaceUnitButton.onClick.AddListener(delegate { var unitEvent = new UnitEvents.PlaceUnitEvent(); EventSystem.instance.Dispatch(unitEvent); }); ResetMovementButton.onClick.AddListener(delegate { var movementEvent = new DebugEvents.ResetAllRemainingMovementEvent(); EventSystem.instance.Dispatch(movementEvent); }); var previousContext = new NavigationEvents.PreviousContextEvent(); BackButton.onClick.AddListener(delegate { EventSystem.instance.Dispatch(previousContext); }); _model = ApplicationFacade.instance.GetModel <GridModel>(); EventSystem.instance.Connect <UnitEvents.UnitSelectedEvent>(OnUnitSelected); EventSystem.instance.Connect <CardEvents.CardPreviewEvent>(OnCardPreviewed); EventSystem.instance.Connect <CardEvents.HideCardPreviewEvent>(OnHideCardPreview); }