Exemplo n.º 1
0
    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);
        }
    }
Exemplo n.º 2
0
    public override void UnSelectAction()
    {
        base.UnSelectAction();


        TileSelecter.OnTileSelect -= SetMovementTile;
        TileSelecter.OnTileHover  -= SetPreviewTile;
        TileSelecter.SetUnitColliders(true);

        ResetPathPreview();
        ResetAttackPreview();
    }
Exemplo n.º 3
0
    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;
    }
Exemplo n.º 4
0
    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);
        }
    }
Exemplo n.º 5
0
    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();
    }
Exemplo n.º 6
0
    void Awake()
    {
        _instance = this;

        Unit.OnUnitHover += OnUnitHover;
    }
Exemplo n.º 7
0
 public override void UnSelectAction()
 {
     base.UnSelectAction();
     TileSelecter.OnTileSelect -= OnTileSelect;
     TileSelecter.SetUnitColliders(true);
 }
Exemplo n.º 8
0
 public void OnHoverEnd()
 {
     TileSelecter.UnhoverTile(this);
 }
Exemplo n.º 9
0
 public void OnHover()
 {
     TileSelecter.HoverTile(this);
 }