예제 #1
0
 private void OnMouseDown()
 {
     if (IsInteractable() && isDestroyable)
     {
         RemoveHealth?.Invoke(hpValue);
         Destroy(gameObject);
     }
 }
예제 #2
0
 // 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>();
 }