Пример #1
0
    void OnCollisionEnter2D(Collision2D coll)
    {
        groundAngle = Mathf.Atan2(coll.contacts [0].normal.y, coll.contacts [0].normal.x) * Mathf.Rad2Deg - 90;

        if (coll.gameObject.tag == "DeathBall")
        {
            Die();

            EffectManager.Instance.AddEffect(0, coll.transform.position);
            Destroy(coll.gameObject);
        }

        if (Mathf.Abs(coll.relativeVelocity.y) > 12f)
        {
            cam.Shake(-coll.relativeVelocity * 0.01f);
        }
    }