Ejemplo n.º 1
0
    //更新関数
    public void Activate()
    {
        if (!isFrozen)
        {
            movePosition = behaviorTree.ActivateBoss(lookAtPos);

            //攻撃中や敵出し中じゃないなら上書き(追いかけるだけ)
            if (status.GetCanbePersuit())
            {
                SetMovePosition();
                SetLookAt(lookAtPos);
            }
        }

        //ダメージを受けた時、赤く点滅させる
        if (status.GetDamaged())
        {
            status.DamageExpression();
        }

        //向きの処理
        for (int i = 0; i < status.GetFoots().Length; i++)
        {
            status.GetFoots()[i].LookAt(lookAtPos[i]);
        }
        //上書き
        if (isFrozen)
        {
            for (int i = 0; i < footsPosition.Length; i++)
            {
                footsPosition[i].position = freezePos[i];
            }
        }
        else
        {
            for (int i = 0; i < footsPosition.Length; i++)
            {
                footsPosition[i].position = movePosition[i];
            }
        }
    }
Ejemplo n.º 2
0
    public void SetInitLookAt()
    {
        Vector3[]   vecfromCenter = new Vector3[4];
        Transform[] foot          = status.GetFoots();
        Vector3[]   lookAtPos     = new Vector3[4];
        for (int i = 0; i < vecfromCenter.Length; i++)
        {
            vecfromCenter[i]   = foot[i].position - status.GetFootCenter().position;
            vecfromCenter[i].y = 0;
            lookAtPos[i]       = foot[i].position + vecfromCenter[i];
        }

        lookAtPos.CopyTo(lookAtPosition, 0);
    }