private void OnTriggerExit(Collider other) { if (BossState == BossState.attacked) { return; } if (other.gameObject.tag == "PlayerSword") { HpPostionScript.enemyDamagedAndImageChange(0.2f); BossState = BossState.attacked; Invoke("stateChange", 0.4f); } }
private void OnTriggerExit(Collider other) { if (bossState == BossState.attacked) { return; } if (other.gameObject.tag == "PlayerSword01") { hpPostionScript.enemyDamagedAndImageChange(0.1f); hpPostionScript.enemyHpDeadCheck(); StartCoroutine("onDamgeColorChange"); camShackManagerScript.shake(); timeManagerScript.playerAttackTime(); hitObjOnOff(); if (hpPostionScript.deadOrLive == 1) { bossSkinMeshRender.materials[0].color = Color.white; aniScript.resetAttackPattern(); aniScript.dead(); Destroy(this.gameObject, 3f); bossSkinMeshRender.materials[0].color = Color.white; } else { aniScript.hitted(); bossState = BossState.attacked; Invoke("stateChange", 0.3f); } return; } if (other.gameObject.tag == "PlayerSword02") { hpPostionScript.enemyDamagedAndImageChange(0.3f); hpPostionScript.enemyHpDeadCheck(); StartCoroutine("onDamgeColorChange"); camShackManagerScript.shake(); timeManagerScript.playerAttackTime(); hitObjOnOff(); if (hpPostionScript.deadOrLive == 1) { bossSkinMeshRender.materials[0].color = Color.white; aniScript.resetAttackPattern(); aniScript.dead(); Destroy(this.gameObject, 3f); bossSkinMeshRender.materials[0].color = Color.white; } else { aniScript.hitted(); bossState = BossState.attacked; Invoke("stateChange", 0.3f); } return; } if (other.gameObject.tag == "PlayerSword03") { hpPostionScript.enemyDamagedAndImageChange(0.6f); hpPostionScript.enemyHpDeadCheck(); StartCoroutine("onDamgeColorChange"); camShackManagerScript.shake(); timeManagerScript.playerAttackTime(); hitObjOnOff(); if (hpPostionScript.deadOrLive == 1) { bossSkinMeshRender.materials[0].color = Color.white; aniScript.resetAttackPattern(); aniScript.dead(); Destroy(this.gameObject, 3f); bossSkinMeshRender.materials[0].color = Color.white; } else { aniScript.hitted(); bossState = BossState.attacked; Invoke("stateChange", 0.3f); } } }