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();
    }
示例#2
0
 private static void AddPoint(Vector2 Position)
 {
     PointsController.AddPoint(Position);
 }
示例#3
0
 private static void AddPoint(float X, float Y)
 {
     PointsController.AddPoint(new Vector2(X, Y));
 }