void OnTriggerEnter2D(Collider2D other) { if (other.name == "PC") { HealthManager.Addpoints(PointToAdd); PC.GetComponent <Rigidbody2D>().velocity = new Vector2(GetComponent <Rigidbody2D>().velocity.x, JumpHeight); } }
void OnTriggerEnter2D(Collider2D Other) { if (Other.GetComponent <Rigidbody2D> () == null) { return; } HealthManager.Addpoints(PointToAdd); Destroy(gameObject); }