private void OnTriggerEnter2D(Collider2D collision) { TankBlueprint Tank = collision.GetComponent <TankBlueprint>(); // see if here iks the best placxe to actually call all the scoring for the players and stars if (Tank != null) { Tank.TakeDamage(1); } /* if (collision.name == ("star")) * { * if (FindObjectOfType<Shell>().SelectShooter == true) * * { * // FindObjectOfType<ScoreSystem>().AddPtsP1(); // TODO reference the player Id instead of the select shooter bool, it is a crap. * } * else if (FindObjectOfType<Shell>().SelectShooter == false) * { * //FindObjectOfType<ScoreSystem>().AddPtsP2(); * } * }*/ //Debug.Log("Projectile//: " + collision.name); //Instantiate(explosionEffect, transform.position, transform.rotation); Destroy(gameObject); }
private void OnTriggerEnter2D(Collider2D collision) //How the Projectile affect players { TankBlueprint Tank = collision.GetComponent <TankBlueprint>(); if (Tank != null) { Tank.TakeDamage(1); } Destroy(gameObject); }