示例#1
0
    void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject.CompareTag("Floor"))
        {
            isGrounded = true;
        }

        if (collision.gameObject.CompareTag("Antagonist"))
        {
            if (hasKey && (transform.position.y < (collision.transform.position.y - 0.01f)))
            {
                key.KeyDropped(key, transform.TransformPoint(Vector3.zero));
                hasKey = false;
            }
        }
    }