internal void TargetTile(Vector3Int target) { TargetedTile = target; var facingDirection = GameManager.CardinalDirectionTo(Vector3Int.FloorToInt(this.transform.position), target); foreach (var effect in MyLoadout.Abilities[0].Effects) { var offset = effect.TileAffected; var targetedTile = target + Ability.RotateEffectTarget(offset, facingDirection); var overlay = Instantiate(DangerzoneUI, targetedTile, Quaternion.identity); overlay.GetComponent <SpriteRenderer>().color = Color.red; overlay.GetComponent <OverlayTooltipUI>().Setup(effect); TargetedTileOverlays.Add(overlay); } }
internal void RenderAbilityInfoAt(Ability ability, Vector3Int pos) { ClearAbilityInfo(); var facingDirection = CardinalDirectionTo(Vector3Int.FloorToInt(UnitClicked.transform.position), pos); foreach (var effect in ability.Effects) { var target = pos + Ability.RotateEffectTarget(effect.TileAffected, facingDirection); var threatenedArea = Instantiate(ThreatenedAreaPrefab, target, Quaternion.identity); threatenedArea.transform.SetParent(this.transform); var toolTip = threatenedArea.GetComponent <OverlayTooltipUI>(); toolTip.Setup(effect); toolTip.ShowTooltip(); ThreatTiles.Add(threatenedArea); } }