RunnerBehavior.OnCollisionEnter2D C# (CSharp) Method

OnCollisionEnter2D() public method

public OnCollisionEnter2D ( Collision2D other ) : void
other Collision2D
return void
    public void OnCollisionEnter2D(Collision2D other)
    {
        if (other.gameObject.tag == "magma" || other.gameObject.tag == "spike" || other.gameObject.tag == "explosion" || other.gameObject.tag == "cinder") {
            OnDeath ();
        }

        if ((other.gameObject.tag == "imp" || other.gameObject.tag == "Player") && charging == true) {
            Rigidbody2D ragDoll = other.gameObject.GetComponent<Rigidbody2D>();
            ragDoll.AddForce((Vector2.up*0.7f+facingDir) * 800.0f);
        }
    }