public void OnCollisionEnter2D(Collision2D collision) { if (!collision.gameObject.CompareTag(Tags.Player)) { Destroy(collision.gameObject); } var explosion = Instantiate(ExplosionPrefab) as GameObject; explosion.transform.SetParent(explosionsParent.transform); explosion.transform.localPosition = new Vector3(gameObject.transform.localPosition.x, gameObject.transform.localPosition.y, explosion.transform.localPosition.z); Destroy(gameObject); pointsController.AddPoint(); }
private static void AddPoint(Vector2 Position) { PointsController.AddPoint(Position); }
private static void AddPoint(float X, float Y) { PointsController.AddPoint(new Vector2(X, Y)); }