예제 #1
0
    protected override void FixedUpdate()
    {
        GetAnimator.SetBool("IsGround", groundChecker.IsGround);
        GetAnimator.SetFloat("VelocityY", Rigid.velocity.y);

        base.FixedUpdate();
    }
    // Update is called once per frame
    protected override void Update()
    {
        if (!IsDead)
        {
            if (PlayerInSight() && currentState == BossStage.None)
            {
                ChangeCurrentStage();
            }

            if (currentState == BossStage.Stage1)
            {
                //print("Stage1");
                base.Update();
            }

            if (currentState == BossStage.Stage2)
            {
                CanTakeDamage = false;
                NavMesh.speed = 15.0f;
                MoveEnemy(cocoon.transform.position);

                if (NavMesh.remainingDistance == 0)
                {
                    NavMesh.Stop();
                    GetAnimator.SetTrigger("Cocoon");
                    EnableCocoon();
                    SpawnBroodlings();
                }
            }

            if (currentState == BossStage.Stage3)
            {
                DisableCocoon();
                NavMesh.Resume();
                NavMesh.speed = 6.0f;
                CanTakeDamage = true;
                EnableAcidPools();
                base.Update();
            }

            if (CurrentHealth == (getMaxHealth() - getMaxHealth() / 3) && currentState == BossStage.Stage1)
            {
                ChangeCurrentStage();
            }

            if (!brood1.activeSelf && !brood2.activeSelf && !brood3.activeSelf && currentState == BossStage.Stage2)
            {
                CurrentHealth = CurrentHealth - getMaxHealth() / 3;
                ChangeCurrentStage();
            }
        }
        else
        {
            //Completion of level one indicated in character
            player.GetComponent <Character>().FinishedLevel(0);
            player.GetComponent <Character>().finishedLevel = true;
        }
    }
예제 #3
0
파일: Player.cs 프로젝트: dydgus5120/KGDI
    void Attack()
    {
        if (IsAttack == true)
        {
            return;
        }

        GetAnimator.SetTrigger("Attack");
    }
예제 #4
0
    private void FixedUpdate()
    {
        isGround = CheckGround();
        GetAnimator.SetBool("IsGround", isGround);

        Move(horizontal);

        float vY = Rigid.velocity.y;

        GetAnimator.SetFloat("VelocityY", vY);
    }
예제 #5
0
파일: Player.cs 프로젝트: dydgus5120/KGDI
    public override void OnHurt(int amount)
    {
        GetAnimator.SetTrigger("Hurt");
        base.OnHurt(amount);
        OffAttack();

        if (Health <= 0)
        {
            Dead();
        }
    }
예제 #6
0
    void Move(float h)
    {
        GetAnimator.SetInteger("Run", (int)h);

        if (h == 0)
        {
            return;
        }

        transform.localScale = new Vector3(h * 15, 15, 1);

        transform.Translate(Vector3.right * h * RunSpeed * Time.fixedDeltaTime);
    }
    void OnCollisionEnter(Collision col)
    {
        if (col.gameObject.CompareTag("Player"))
        {
            GetAnimator.SetTrigger("Attack");
        }

        if (col.gameObject.CompareTag("Weapon") && canTakeDamage && !sheildOn && base.IsAlive)
        {
            print("BOSS HIT");
            CurrentHealth -= 25.0f;
            StartCoroutine(damageDelay());
        }
    }
예제 #8
0
 private void RpcTurnAnimation(float value)
 {
     GetAnimator.SetFloat(_animatorTurn, value);
 }
예제 #9
0
 private void RpcMoveAnimation(Vector3 direction)
 {
     GetAnimator.SetFloat(_animatorMoveForward, direction.z);
     GetAnimator.SetFloat(_animatorMoveRight, direction.x);
 }