Ejemplo n.º 1
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();
        }
    }
Ejemplo n.º 2
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();
        }
    }