private void OnMouseDown() { if (IsInteractable() && isDestroyable) { RemoveHealth?.Invoke(hpValue); Destroy(gameObject); } }
// Use this for initialization void Start() { oldplayerpos = transform.position; fade = GameObject.Find("Fade").GetComponent <Animator>(); animator = GetComponent <Animator>(); body2d = GetComponent <Rigidbody2D>(); animator.SetTrigger("Death"); RmvHlth = GameObject.Find("Player").GetComponent <RemoveHealth>(); }