Пример #1
0
    public override Vector3[] ActivateBoss(Vector3[] lookAtPos)
    {
        for (int i = 0; i < movePosition.Length; i++)
        {
            movePosition[i] = Vector3.zero;
        }
        SetInitLookAt();

        //体力が半分を下回りビヘイビアツリーが変わった瞬間
        if (isHealthHalfDown && !isPreHealthHalfDown)
        {
            m_rootNode.SetFailuer();
        }

        if (!isHealthHalfDown)         //体力が半分以下じゃないなら
        {
            m_rootNode.Evaluate();
        }
        else
        {
            m_rootNode2.Evaluate();
        }

        isPreHealthHalfDown = isHealthHalfDown;

        lookAtPosition.CopyTo(lookAtPos, 0);

        return((Vector3[])movePosition.Clone());
    }
    //実行処理
    public override Vector3 Activate(ref Vector3 lookAtPos)
    {
        movePosition = Vector3.zero;
        m_rootNode.Evaluate();

        if (GetComponent <CharacterController>().isGrounded)
        {
            speed = 0;
        }
        speed          -= status.GetGravity() * Time.fixedDeltaTime;
        movePosition.y += speed * Time.fixedDeltaTime;

        lookAtPos = lookAtPosition;
        return(movePosition);
    }