private IEnumerator AreaCalc() { TakeScreenShot(16, 9); OnAreaChange?.Invoke(fillAmount); yield return(new WaitForSeconds(.05f)); StartCoroutine(AreaCalc()); }
private void LateUpdate() { if (_lmbPressed == false && OnAreaChange != null) { OnAreaChangeArgs e = new OnAreaChangeArgs(); Vector2Int cursorCoords = Utils.CursorToCoordinates(); e.rectangle = new fidt17.Utils.IntRectangle(cursorCoords, cursorCoords); e.startMousePosition = cursorCoords; e.currentMousePosition = cursorCoords; e.dragEnded = false; OnAreaChange.Invoke(e); } }
public void RefreshState() { var igsd = Root.Game.IngameState.Data; AreaTemplate clientsArea = igsd.CurrentArea; int curAreaHash = igsd.CurrentAreaHash; if (CurrentArea != null && curAreaHash == CurrentArea.Hash) { return; } CurrentArea = new AreaInstance(clientsArea, curAreaHash, igsd.CurrentAreaLevel); OnAreaChange?.Invoke(this); }
public void RefreshState() { GController.Cache.UpdateCache(); var ingameData = GController.Game.IngameState.Data; AreaTemplate clientsArea = ingameData.CurrentArea; var curAreaHash = ingameData.CurrentAreaHash; if (CurrentArea != null && curAreaHash == CurrentArea.Hash) { return; } CurrentArea = new AreaInstance(clientsArea, curAreaHash, ingameData.CurrentAreaLevel); OnAreaChange?.Invoke(this); }
private void ProcessSelectionArea(Vector2 start, Vector2 end) { DeselectEverything(); GetSelectableInArea(start, end).ForEach(x => Select(x)); ResetSelectionArea(); OnSelect?.Invoke(); if (OnAreaChange != null) { OnAreaChangeArgs e = new OnAreaChangeArgs(); e.rectangle = new fidt17.Utils.IntRectangle(Utils.WorldToGrid(start), Utils.WorldToGrid(end)); e.dragEnded = true; OnAreaChange.Invoke(e); } }
private IEnumerator StartSelectionAreaDrag() { if (UnityEngine.EventSystems.EventSystem.current.IsPointerOverGameObject()) { yield break; } _lmbPressed = true; Vector2 startMousePosition = Utils.CursorToWorldPosition(); Vector2 currentMousePosition = startMousePosition; while (_lmbPressed) { currentMousePosition = Utils.CursorToWorldPosition(); if (_settings.shouldDrawArea) { DrawSelectionArea(startMousePosition, currentMousePosition); } if (OnDrag != null) { List <SelectableComponent> selectableInArea = GetSelectableInArea(startMousePosition, currentMousePosition); OnDrag.Invoke(selectableInArea); } if (OnAreaChange != null) { OnAreaChangeArgs e = new OnAreaChangeArgs(); e.rectangle = new fidt17.Utils.IntRectangle(Utils.WorldToGrid(startMousePosition), Utils.WorldToGrid(currentMousePosition)); e.startMousePosition = startMousePosition; e.currentMousePosition = currentMousePosition; e.dragEnded = false; OnAreaChange.Invoke(e); } yield return(null); } ProcessSelectionArea(startMousePosition, currentMousePosition); }
private void ActionAreaChange() { OnAreaChange?.Invoke(CurrentArea); }