示例#1
0
    //----------------------------------------------------------------------------------------------------
    /// <summary>
    /// 攻撃
    /// </summary>
    void Attack()
    {
        //ワールド座標で自分の原点と方向
        m_matrix.SetTRS(transform.position, transform.rotation, Vector3.one);

        //攻撃範囲頂点の決定
        for (var i = 0; i < MyCube.NUM_VERTICES; i++)
        {
            //絶対的な攻撃範囲の決定
            m_attackVerteces[i] = m_matrix.MultiplyPoint(ATTACK_VERTECES[i]);
        }

        //攻撃範囲の直方体の構築
        m_attackRange.SetCube(m_attackVerteces[0], m_attackVerteces[1], m_attackVerteces[2], m_attackVerteces[3],
                              m_attackVerteces[4], m_attackVerteces[5], m_attackVerteces[6], m_attackVerteces[7]);

        m_attackManager.EnemyAttack(m_attackRange, MaskAttribute.Non, m_power, m_effectiveAttackTime);
    }
示例#2
0
    //----------------------------------------------------------------------------------------------------
    /// <summary>
    /// 攻撃の攻撃
    /// </summary>
    void AttackEvent()
    {
        //ワールド座標でプレイヤーの原点と方向
        m_workMatrix.SetTRS(transform.position, transform.rotation, Vector3.one);

        //攻撃範囲頂点の決定
        for (var i = 0; i < MyCube.NUM_VERTICES; i++)
        {
            //絶対的な攻撃範囲の決定
            m_workVector3Array[i] = m_workMatrix.MultiplyPoint(ATTACK_VERTECES[i]);
        }

        //攻撃範囲の直方体の構築
        m_workMyCube.SetCube(m_workVector3Array[0], m_workVector3Array[1], m_workVector3Array[2], m_workVector3Array[3],
                             m_workVector3Array[4], m_workVector3Array[5], m_workVector3Array[6], m_workVector3Array[7]);

        //攻撃範囲の生成
        myAiManager.CharacterScript.AttackManagerScript.EnemyAttack(m_workMyCube, MaskAttribute.Non, m_powerAttack, m_effectiveAttackTime);

        //SEの再生
        MySoundManager.Instance.Play(SeCollection.SwordAttack, true, transform.position.x, transform.position.y, transform.position.z);
    }