コード例 #1
0
    private void OnTriggerExit(Collider other)
    {
        if (IsAttackedState == CloseAttackEnemy01IsAttacked.attacked)
        {
            return;
        }
        switch (other.gameObject.tag)
        {
        case "PlayerSword01":
            hpPostionScript.enemyDamagedAndImageChange(0.2f);
            hpPostionScript.enemyHpDeadCheck();

            camShackManagerScript.shake();
            timeManagerScript.playerAttackTime();

            hitObjOnOff();

            if (hpPostionScript.deadOrLive == 1)
            {
                skinMeshRender.materials[0].color = Color.white;
                aniScript.aniSet("Dead");
                Destroy(this.gameObject, 3f);
            }
            else
            {
                if (isAttack == true)
                {
                    return;
                }

                aniScript.aniSet("Hitted");
                IsAttackedState = CloseAttackEnemy01IsAttacked.attacked;
                Invoke("stateChange", 0.3f);
            }

            if (stunParicle.isPlaying)
            {
                stunParicle.Stop();
            }
            break;

        case "PlayerSword02":
            hpPostionScript.enemyDamagedAndImageChange(0.5f);
            hpPostionScript.enemyHpDeadCheck();

            camShackManagerScript.shake();
            timeManagerScript.playerAttackTime();

            hitObjOnOff();

            if (hpPostionScript.deadOrLive == 1)
            {
                skinMeshRender.materials[0].color = Color.white;
                aniScript.aniSet("Dead");
                Destroy(this.gameObject, 3f);
            }
            else
            {
                Invoke("hitObjOnOff", 1f);

                if (isAttack == true)
                {
                    return;
                }

                aniScript.aniSet("Hitted");
                IsAttackedState = CloseAttackEnemy01IsAttacked.attacked;
                Invoke("stateChange", 0.3f);
            }

            if (stunParicle.isPlaying)
            {
                stunParicle.Stop();
            }
            break;

        case "PlayerSword03":
            hpPostionScript.enemyDamagedAndImageChange(0.8f);
            hpPostionScript.enemyHpDeadCheck();

            camShackManagerScript.shake();
            timeManagerScript.playerAttackTime();

            hitObjOnOff();

            if (hpPostionScript.deadOrLive == 1)
            {
                skinMeshRender.materials[0].color = Color.white;
                aniScript.aniSet("Dead");
                Destroy(this.gameObject, 3f);
            }
            else
            {
                Invoke("hitObjOnOff", 1f);

                if (isAttack == true)
                {
                    return;
                }

                aniScript.aniSet("Hitted");
                IsAttackedState = CloseAttackEnemy01IsAttacked.attacked;
                Invoke("stateChange", 0.3f);
            }

            if (stunParicle.isPlaying)
            {
                stunParicle.Stop();
            }
            break;
        }

        if ((IsAttackedState == CloseAttackEnemy01IsAttacked.stuned) ||
            (PlayerInputScript.Instance.state != PlayerState.parring) ||
            (isAttack == false))
        {
            return;
        }

        switch (other.gameObject.name)
        {
        case "Player_Weapon_Shield":
            hpPostionScript.enemyDamagedAndImageChange(0.2f);
            hpPostionScript.enemyHpDeadCheck();

            camShackManagerScript.shake();
            timeManagerScript.playerAttackTime();

            weaponColConScript.weaponColliderOff(0);

            parringObjOnOff();

            if (hpPostionScript.deadOrLive == 1)
            {
                skinMeshRender.materials[0].color = Color.white;
                aniScript.aniSet("Dead");
                Destroy(this.gameObject, 3f);
            }
            else
            {
                stunParicle.Play();
                isStun = true;

                aniScript.aniSet("Stuned");
                IsAttackedState = CloseAttackEnemy01IsAttacked.stuned;
                Invoke("parringObjOnOff", 3f);
                Invoke("stateChange", 1.5f);
            }
            break;
        }
    }
コード例 #2
0
    private void OnTriggerExit(Collider other)
    {
        if (IsAttackedState == DistacneAttackEnemy01IsAttacked.attacked)
        {
            return;
        }

        switch (other.gameObject.tag)
        {
        case "PlayerSword01":
            hpPostionScript.enemyDamagedAndImageChange(0.2f);
            hpPostionScript.enemyHpDeadCheck();

            camShackManagerScript.shake();
            timeManagerScript.playerAttackTime();

            hitObjOnOff();

            if (hpPostionScript.deadOrLive == 1)
            {
                skinMeshRender.materials[0].color = Color.white;

                aniScript.aniSet("Dead");
                Destroy(this.gameObject, 3f);
            }
            else
            {
                skinMeshRender.materials[0].color = Color.white;

                aniScript.aniSet("Hitted");
                IsAttackedState = DistacneAttackEnemy01IsAttacked.attacked;
                Invoke("stateChange", 0.3f);
            }
            break;

        case "PlayerSword02":
            hpPostionScript.enemyDamagedAndImageChange(0.5f);
            hpPostionScript.enemyHpDeadCheck();

            camShackManagerScript.shake();
            timeManagerScript.playerAttackTime();

            hitObjOnOff();

            if (hpPostionScript.deadOrLive == 1)
            {
                skinMeshRender.materials[0].color = Color.white;

                aniScript.aniSet("Dead");
                Destroy(this.gameObject, 3f);
            }
            else
            {
                skinMeshRender.materials[0].color = Color.white;

                aniScript.aniSet("Hitted");
                IsAttackedState = DistacneAttackEnemy01IsAttacked.attacked;
                Invoke("stateChange", 0.3f);
            }
            break;

        case "PlayerSword03":
            hpPostionScript.enemyDamagedAndImageChange(0.8f);
            hpPostionScript.enemyHpDeadCheck();

            camShackManagerScript.shake();
            timeManagerScript.playerAttackTime();

            hitObjOnOff();

            if (hpPostionScript.deadOrLive == 1)
            {
                skinMeshRender.materials[0].color = Color.white;

                aniScript.aniSet("Dead");
                Destroy(this.gameObject, 3f);
            }
            else
            {
                skinMeshRender.materials[0].color = Color.white;

                aniScript.aniSet("Hitted");
                IsAttackedState = DistacneAttackEnemy01IsAttacked.attacked;
                Invoke("stateChange", 0.3f);
            }
            break;
        }
    }
コード例 #3
0
    // 골드 획득만 예외적으로 다른 스크립트에서 처리한다.
    private void OnTriggerEnter(Collider other)
    {
        // 죽었을떄도 넣기 //
        if (
            playerParringConScript.isSucess == true ||
            inputScript.playerHitted == PlayerHitted.normalAttacked ||
            inputScript.playerHitted == PlayerHitted.airborneAttacked ||
            inputScript.playerHitted == PlayerHitted.airborneAttackedCoolTime
            )
        {
            return;
        }
        // 구르기로 도피시 슬로우 모션
        if (inputScript.state == PlayerState.dodge && dodgeConScript.playerDodgeCoolTime == true)
        {
            if (other.gameObject.tag == "TrapType2FireAttack" || other.gameObject.tag == "enemyWeapon" ||
                other.gameObject.tag == "TrapType3BoomAttack" || other.gameObject.tag == "pattern08" ||
                other.gameObject.tag == "enemyStun")
            {
                timeManagerScript.playerDodgeTime();
                spConScript.isPlayerDodgeSucess = true;
                StartCoroutine("dodgeSuccess");
                return;
            }
        }

        //공격당함 1
        if (other.gameObject.tag == "enemyWeapon" ||
            other.gameObject.tag == "DistanceAttackTypeFireAttack01" ||
            other.gameObject.tag == "TrapType2FireAttack" ||
            other.gameObject.tag == "TrapType3BoomAttack" ||
            other.gameObject.tag == "pattern08" ||
            other.gameObject.tag == "TrapType1Thorn")
        {
            hitParticleOn(other.gameObject.tag);
            Invoke("hitParticleOff", 1f);

            inputScript.playerHitted = PlayerHitted.normalAttacked;

            camShackManagerScript.shake();

            playerHpManagerScript.isPlayerDamaged(0.1f);
            playerCurseScript.isplayerCursed(0.2f);

            StartCoroutine(PlayerAttackedCoroutine());
            return;
        }

        /*
         * if (other.gameObject.tag == "pattern08")
         * {
         *  inputScript.playerHitted = PlayerHitted.airborneAttacked;
         *
         *  playerCamManagerScript.shake();
         *  playerCurseScript.isplayerCursed(0.2f);
         *  playerHpManagerScript.isPlayerDamaged(0.1f);
         *
         * StartCoroutine(PlayerAttackedCoroutine());
         *  return;
         * }
         */
        if (other.gameObject.tag == "enemyStun")
        {
            inputScript.playerHitted = PlayerHitted.stunAttacked;
            camShackManagerScript.shake();
            StartCoroutine(PlayerAttackedCoroutine());
            return;
        }

        if (other.gameObject.tag == "DoorOfDungeon" + 1.ToString())
        {
            GameObject cam = GameObject.Find("DoorOfDungeon1_Set").transform.Find("CM vcam1").gameObject;
            cam.SetActive(true);

            inputScript.state = PlayerState.waitForMoveNextStage;

            aniConScript.playerDodgeAniReset();
            aniConScript.playerAniWait();
            StageManager.Instance.playerStageMapUI();
            StageManager.Instance.dungeonNum = 1;
            return;
        }

        if (other.gameObject.name == "GoToStartStage")
        {
            inputScript.state  = PlayerState.idle;
            playerPos.position = transformPos[0].position;
            aniConScript.playerDodgeAniReset();
            aniConScript.playerAniWait();
            LoadingManager.loadScene("Start_Stage");
            return;
        }
        if (other.gameObject.name == "GoToStartStage_ForSecondPlayer")
        {
            inputScript.state  = PlayerState.idle;
            playerPos.position = transformPos[0].position;
            aniConScript.playerDodgeAniReset();
            aniConScript.playerAniWait();
            LoadingManager.loadScene("Start_Stage_ForSecondPlayer");
            return;
        }
        if (other.gameObject.name == "DialogueStart")
        {
            BoxCollider box = other.GetComponent <BoxCollider>();
            box.enabled = false;
            dialogueManagerScript.uiOn();
            return;
        }
        if (other.gameObject.tag == "BossStageSceneManager")
        {
            inputScript.state = PlayerState.stopForCutSceen;

            aniConScript.playerAniWait();
            playerUISeletMangerScript.turnOnOffIngameUi();
            Invoke("waitForBossStage", 8.2f);
            return;
        }
        if (other.gameObject.tag == "Dwarf_ShopOwner")
        {
            checkWhatItis = other.gameObject;
            playerUISeletMangerScript.turnOnOffImageE(true);
            return;
        }
        if (other.gameObject.tag == "PlayerWeaponDroped")
        {
            checkWhatItis = other.gameObject;

            playerGetWeaponUINNo5.dropWeaponObj = other.gameObject;
            playerUISeletMangerScript.turnOnOffImageE(true);
            return;
        }
        if (other.gameObject.tag == "PlayerPowerGetSet")
        {
            playerPowerGetUINo2Script.stateObj = other.gameObject;
            playerUISeletMangerScript.turnOnOffImageE(true);
            checkWhatItis = other.gameObject;
            return;
        }
        if (other.gameObject.name == "Save_State")
        {
            checkWhatItis = other.gameObject;
            playerUISeletMangerScript.turnOnOffImageE(true);
            return;
        }
    }
コード例 #4
0
    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);
            }
        }
    }