コード例 #1
0
    // check on collision with another collider
    /*** must be trigger enabled ***/
    void OnTriggerEnter(Collider other)
    {
        // only if this object is dashing...
        if (myStats.isDashing())
        {
            // if other object is a "Pickup":
            GameObject otherObject = other.gameObject;

            if (otherObject.CompareTag("Player"))
            {
                myStats.setColliding(true);
            }
        }
    }