IEnumerator Move(Tile t) { MDebug.Log("^aiMOVE"); yield return(null); // MDebug.Log(m_unit.GetID()+ "Selecting move"); UnitAction_Move move = getMove(); m_Actions.SelectAbility(move); if (move == null || !move.HasRequirements(true)) { MDebug.Log("^ai no move, no requirements"); yield break; } yield return(new WaitForSeconds(0.5f)); MDebug.Log("^aihover tile to for move "); t.OnHover(); yield return(new WaitForSeconds(0.5f)); MDebug.Log("^aiSelect tile to for move "); TileSelecter.SelectTile(t); t.OnHoverEnd(); while (move.ActionInProgress) { yield return(null); } }
public override void UnSelectAction() { base.UnSelectAction(); TileSelecter.OnTileSelect -= SetMovementTile; TileSelecter.OnTileHover -= SetPreviewTile; TileSelecter.SetUnitColliders(true); ResetPathPreview(); ResetAttackPreview(); }
public override void SelectAction() { base.SelectAction(); if (OnTargetsFound != null) { OnTargetsFound(GetLootableTiles().Select(t => t.gameObject).ToList()); } TileSelecter.OnTileSelect += OnTileSelect; TileSelecter.SetUnitColliders(false); TileSelecter.OnTileHover += OnTileHover; TileSelecter.OnTileUnhover += OnTileUnhover; }
public override void SelectAction() { base.SelectAction(); MDebug.Log("^ability SELECT MOVE"); if (Owner.GetComponent <WaypointMover>().Moving) { return; } TileSelecter.SetUnitColliders(false); TileSelecter.OnTileSelect += SetMovementTile; TileSelecter.OnTileHover += SetPreviewTile; if (TileSelecter.HoveredTile != null) { SetPreviewTile(TileSelecter.HoveredTile); } }
public void Start() { if (WorldCrumbler.Instance != null) { WorldCrumbler.Instance.OnCrumble += OnCrumbleTurn; } else { // MDebug.Log("Möp"); } SelectibleObjectBase b = GetComponent <SelectibleObjectBase>(); if (b == null) { b = gameObject.AddComponent <SelectibleObjectBase>(); } b.OnHover += OnHover; b.OnHoverEnd += OnHoverEnd; b.OnSelect += delegate { TileSelecter.SelectTile(this); }; SetBaseState(); }
void Awake() { _instance = this; Unit.OnUnitHover += OnUnitHover; }
public override void UnSelectAction() { base.UnSelectAction(); TileSelecter.OnTileSelect -= OnTileSelect; TileSelecter.SetUnitColliders(true); }
public void OnHoverEnd() { TileSelecter.UnhoverTile(this); }
public void OnHover() { TileSelecter.HoverTile(this); }