Пример #1
0
    /// <summary>
    /// OnCollisionStay is called once per frame for every collider/rigidbody
    /// that is touching rigidbody/collider.
    /// </summary>
    /// <param name="other">The Collision data associated with this collision.</param>
    void OnCollisionStay(Collision other)
    {
        TouchableController tc = other.gameObject.GetComponent <TouchableController>();

        if (tc != null && _touched)
        {
            tc.Touch();
        }
    }
Пример #2
0
    /// <summary>
    /// OnControllerColliderHit is called when the controller hits a
    /// collider while performing a Move.
    /// </summary>
    /// <param name="hit">The ControllerColliderHit data associated with this collision.</param>
    void OnControllerColliderHit(ControllerColliderHit hit)
    {
        TouchableController tc = hit.gameObject.GetComponent <TouchableController>();

        if (tc != null)
        {
            tc.TouchWithSound();
        }
    }
Пример #3
0
    /// <summary>
    /// OnCollisionEnter is called when this collider/rigidbody has begun
    /// touching another rigidbody/collider.
    /// </summary>
    /// <param name="other">The Collision data associated with this collision.</param>
    void OnCollisionEnter(Collision other)
    {
        ExpoldeOnCollision(other);
        TouchableController tc = other.gameObject.GetComponent <TouchableController>();

        if (tc != null)
        {
            tc.TouchWithSound();
        }
    }