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 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();
    }