private void OnTriggerEnter(Collider other) { if (noDamageTime > 0) { return; } noDamageTime = 2; HackerPlayer player = other.gameObject.GetComponentInParent <HackerPlayer>(); if (player != null) { player.GetComponent <HealthResource>().ChangeValue(-damageAmount); Debug.Log("Hacker was hit by Sawblade"); //if (transform.parent.childCount == 1) // Destroy(transform.parent.parent.gameObject); //else // Destroy(gameObject); } }
public void InitHackerPlayer(HackerPlayer script, HackerHand hand) { this.hackerPlayer = script.transform; this.hackerPlayerScript = script; this.hand = hand; }