void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.layer == 9)//alice tools { AliceWeapon aw = other.gameObject.GetComponent <AliceWeapon>(); reduceEnemyHP(aw.damage); } }
void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.name.Contains("room")) { Debug.Log("bump"); movement = new Vector2(Random.Range(-1f, 1f), Random.Range(-1f, 1f)); } if (other.gameObject.layer == 9)//alice tools { AliceWeapon aw = other.gameObject.GetComponent <AliceWeapon>(); reduceBossHP(aw.damage); } }
void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.layer == 9)//alice tools { Debug.Log("Hit"); if (other.gameObject.tag == "AliceSword") { Die(); } AliceWeapon aw = other.gameObject.GetComponent <AliceWeapon>(); reduceEnemyHP(aw.damage); } }
public void UpdateSlashInput() { if (sword_instance == null && Input.GetButtonDown("X") && !alice.isSlashing) { Debug.Log(wielder_rb); alice.isSlashing = true; wielder_rb.velocity = Vector2.zero; sword_instance = Instantiate(sword, transform.position, transform.rotation); AliceWeapon alice_sword = sword_instance.gameObject.GetComponentInChildren <AliceWeapon>(); if (current_mode > 0) { alice_sword.damage = current_mode; } //pushes alice forward wielder_rb.velocity = (transform.up * slash_forward_value); // Debug.Log(current_mode +"\n" + current_rotation); } }