Ejemplo n.º 1
0
 public BehaveResult Tick(Behave.Runtime.Tree sender, bool init)
 {
     Debug.Log("Ticked Received by unhandled " +
               (BLNewBehaveLibrary0.IsAction(sender.ActiveID) ? "Action " :
                "Decorator ") +
               " ... " + (BLNewBehaveLibrary0.IsAction(sender.ActiveID) ?
                          ((BLNewBehaveLibrary0.ActionType)sender.ActiveID).ToString() :
                          ((BLNewBehaveLibrary0.DecoratorType)sender.ActiveID).ToString()));
     return(BehaveResult.Success);
 }
Ejemplo n.º 2
0
    //Dette er grundstenen i Behave. I stedet for BLNewBehaveLibrary, skriver man sit eget navn



    IEnumerator Start()
    {
        m_Tree = BLNewBehaveLibrary0.InstantiateTree(
            BLNewBehaveLibrary0.TreeType.HeroAI1_NewTree1, this);
        while (Application.isPlaying && m_Tree != null)
        {
            yield return(new WaitForSeconds(1 / m_Tree.Frequency));

            AIUpdate();
        }
    }
Ejemplo n.º 3
0
    IEnumerator Start()
    {
        stepSecuence = 1;
        existsPath   = false;
        aStarDest    = Vector2.zero;
        dest         = (Vector2)transform.localPosition;
        position     = dest;
        vecinos      = maze.GetComponent <nivel>().getVecinos(position);
        direction    = Vector2.zero;
        m_Tree       = BLNewBehaveLibrary0.InstantiateTree(BLNewBehaveLibrary0.TreeType.NewCollection1_NewTree1, this);

        while (Application.isPlaying && m_Tree != null)
        {
            yield return(new WaitForSeconds(1.0f / m_Tree.Frequency));

            AIUpdate();
        }
    }