public override bool CanBeCast(Vector3 mousePosition) { if (!MousePositionOnTerrain.GetRaycastHit(mousePosition, out hit)) { hit.point = Vector3.down; } return(true); }
private void PressedRightClick(Vector3 mousePosition) { bool hitTerrain = MousePositionOnTerrain.GetRaycastHit(mousePosition, out hit); Unit closestEnemyUnit = FindClosestEnemyUnit(); if (HoveredUnitIsAnEnemy(champion.Team)) { champion.ChampionMovementManager.PrepareMovementTowardsTarget(HoveredUnit); } else if (closestEnemyUnit != null) { champion.ChampionMovementManager.PrepareMovementTowardsTarget(closestEnemyUnit); } else if (hitTerrain) { champion.ChampionMovementManager.PrepareMovementTowardsPoint(hit.point); } }
public override bool CanBeCast(Vector3 mousePosition) { return(MousePositionOnTerrain.GetRaycastHit(mousePosition, out hit)); }