public override void Preview(GamePawn user) { if (HasAvailableTarget(user).Count > 0 && PlayerManager.instance.playerCharacter.currentPA >= cost) { GridManager.instance.AllTilesBecameNotClickable(); PlayerManager playerManager = PlayerManager.instance; PlayerCharacter player = playerManager.playerCharacter; if (SkillManager.instance.currentActiveSkill != this) { base.Preview(user); player.HideMoveRange(); List <Tile> tilesToHighlight = HasAvailableTarget(user); if (tilesToHighlight.Count > 0) { user.SetPreviewID(Highlight_Manager.instance.ShowHighlight(tilesToHighlight, HighlightMode.ActionPreview, true)); } playerManager.hoverMode = HoverMode.MeleeHover; } else { SkillManager.instance.currentActiveSkill = null; playerManager.hoverMode = HoverMode.MovePath; Highlight_Manager.instance.HideHighlight(player.GetSkillPreviewID(), null, false); UI_Manager.instance.characterInfoPanel.ResetAllCharacterInfo(); player.ShowMoveRange(); } } }
public void ThrowPreview(GamePawn user, GamePawn liftedPawn) { GridManager.instance.AllTilesBecameNotClickable(); List <Tile> tilesToHighlight = new List <Tile>(); Tile playerTile = user.GetTile(); if (liftedPawn is EnemieBehaviour) { Debug.Log("Lift Enemy"); //UP if (IsAvailableTile(playerTile.neighbours.up)) { tilesToHighlight.Add(playerTile.neighbours.up); } //RIGHT if (IsAvailableTile(playerTile.neighbours.right)) { tilesToHighlight.Add(playerTile.neighbours.right); } //DOWN if (IsAvailableTile(playerTile.neighbours.down)) { tilesToHighlight.Add(playerTile.neighbours.down); } //LEFT if (IsAvailableTile(playerTile.neighbours.left)) { tilesToHighlight.Add(playerTile.neighbours.left); } } else if (liftedPawn is Barrel || liftedPawn is Box) { Debug.Log("Lift Barrel"); RaycastHit[] hits = Physics.BoxCastAll(user.GetTile().transform.position + 2 * Vector3.up, ((range + 1) * Vector3.forward + (range + 1) * Vector3.right), Vector3.down, Quaternion.Euler(Quaternion.identity.eulerAngles + new Vector3(0f, 45f, 0f)), 2f, LayerMask.GetMask("FreeTile")); foreach (RaycastHit hit in hits) { Tile tile = hit.transform.GetComponent <Tile>(); if (IsAvailableTile(tile) || tile.GetPawnOnTile() == liftedPawn) { tilesToHighlight.Add(tile); } } } Debug.Log("THROW PREVIEW : " + tilesToHighlight.Count); Highlight_Manager.instance.HideHighlight(user.GetSkillPreviewID()); user.SetPreviewID(Highlight_Manager.instance.ShowHighlight(tilesToHighlight, HighlightMode.ActionPreview, true)); PlayerManager.instance.hoverMode = HoverMode.ThrowHover; }
public override void Preview(GamePawn user) { user.SetPreviewID(Highlight_Manager.instance.ShowHighlight(ComboManager.instance.AddBarrelToComboPreview((Barrel)user, true), HighlightMode.ExplosionPreview)); }