Esempio n. 1
0
    //---------------------------------------------------------------

    /*
     *  @brief      衝突検知の瞬間
     */
    //---------------------------------------------------------------
    void OnCollisionEnter(Collision collision)
    {
        GameObject itemObj = null;

        itemObj = GetItem(GameDefine.ITEM_TYPE.ITEM_TYPE_ROCKET);

        if (itemObj != null)
        {
            itemObj.GetComponent <ItemRocket>().ResetItem();
        }

        PlayAfterBurner(false);

        // ゴール処理
        if (collision.gameObject.name == "Goal")
        {
            Debug.Log("Goooooaaaaallllll !!!!!!!!!!");

            m_bGoal = true;

            /*
             * rb.useGravity = false;
             * rb.isKinematic = true;
             */
//            rb.velocity = m_vectorToMove;
//            rb.angularVelocity = m_vectorToMove;
            rb.AddForce(m_vectorToMove, ForceMode.VelocityChange);

            if (updater)
            {
                if (updater.IsPlayDustStorm())
                {
                    updater.PlayDustStorm(false);
                }
            }
        }
        else if (collision.gameObject.tag == "CollisionOBJ")
        {
            PlaySECollision();
        }
    }