//Hover info. void OnMouseEnter() { if ((BattleInputController.inputState == BattleInputController.eInputState.PLAYER_DEFAULT || BattleInputController.inputState == BattleInputController.eInputState.NPC_DEFAULT) & currentUnit != null) { BattleInputController.mouseHoverEvent = true; if (cellHoverInfoEvent != null) { cellHoverInfoEvent(currentUnit); } currentUnit.SetIndicatorEnabled(true); if (currentUnit.stats.mp > 0) { int mpLoss = currentUnit.MovementLockPenalty(); HashSet <GridCell> remainingMoveRange = Pathfinder.GetMoveRange(this, currentUnit.stats.mp - mpLoss); HashSet <GridCell> unitMoveRange = Pathfinder.GetMoveRange(this, currentUnit.stats.mp); if (gridHighlighter == null) { gridHighlighter = GameObject.FindGameObjectWithTag("Battle Controller").GetComponent <GridHighlighter> (); } gridHighlighter.ClearAll(); if (currentUnit == BattleController.instance.currentUnit) { if (input == null) { input = GameObject.FindGameObjectWithTag("Battle Controller").GetComponent <BattleInputController> (); } input.ShowMovementRange(); } else { gridHighlighter.HighlightNonVisibleCell(unitMoveRange); gridHighlighter.HighlightMoveRange(remainingMoveRange); } } } else if (BattleInputController.inputState == BattleInputController.eInputState.TARGET_SELECT && currentUnit != null) { if (cellHoverInfoEvent != null) { cellHoverInfoEvent(currentUnit); } currentUnit.SetIndicatorEnabled(true); } }
public void ShowMovementRange() { highlighter.HighlightNonVisibleCell(lockedMovementIndicator); highlighter.HighlightMoveRange(movementRange); }