Example #1
0
    private void OnCollisionEnter2D(Collision2D collision)
    {
        if (collision.gameObject.tag == "Player")
        {
            Vector3    vector = gameObject.transform.position;
            GameObject temp   = Instantiate(funken, vector, new Quaternion(0, 0, 0, 0)) as GameObject;

            if (collision.gameObject.GetComponent <PlayerMovment>() != null && movment != null)
            {
                if (collision.gameObject.GetComponent <PlayerMovment>().IsInDash())
                {
                    if (!movment.IsInDash())
                    {
                        movment.Hit();
                    }
                }
            }
        }
    }