Exemplo n.º 1
0
    void Update()
    {
        ShildMushroom.GroggyCheck();
        ShildMushroom.PlayerisDead();
        Dltime += Time.deltaTime;

        if (Dltime > 1.5f)
        {
            if (ShildMushroom.GetDistanceFromPlayer() > ShildMushroom.Stat.AttackDistance)
            {
                ShildMushroom.SetState(ShildMushroomState.Chase);
                Dltime = 0;
                ShildMushroom.AttackTimer = 0f;
                return;
            }

            else
            {
                ShildMushroom.SetState(ShildMushroomState.Return);
                Dltime = 0;
                ShildMushroom.AttackTimer = 0f;
                return;
            }
        }
    }
Exemplo n.º 2
0
    void Update()
    {
        ShildMushroom.GroggyCheck();

        if (ShildMushroom.GetDistanceFromPlayer() < ShildMushroom.Stat.ChaseDistance && (CPlayerManager._instance.isDead == false))
        {
            ShildMushroom.GoToDestination(ShildMushroom.Player.position, ShildMushroom.Stat.MoveSpeed, ShildMushroom.rotAnglePerSecond);
            ShildMushroom.SetState(ShildMushroomState.Chase);
            return;
        }
    }
Exemplo n.º 3
0
    void Update()
    {
        _groggy.Groggy(transform.position);
        Dltime += Time.deltaTime;
        ShildMushroom.GoToDestination(SavePosition, 0, 0);

        if (Dltime > 5f)
        {
            ShildMushroom.SetState(ShildMushroomState.Return);
            _groggy.GroggyEffect.SetActive(false);
            return;
        }
    }
Exemplo n.º 4
0
    void Update()
    {
        ShildMushroom.GroggyCheck();
        ShildMushroom.TurnToDestination();
        ShildMushroom.PlayerisDead();

        if (ShildMushroom.GetDistanceFromPlayer() < ShildMushroom.Stat.AttackDistance && ShildMushroom.AttackTimer > ShildMushroom.AttackDelay)
        {
            ShildMushroom.SetState(ShildMushroomState.Attack);
            return;
        }

        if (ShildMushroom.GetDistanceFromPlayer() < ShildMushroom.Stat.ChaseDistance && ShildMushroom.GetDistanceFromPlayer() > ShildMushroom.Stat.AttackDistance)
        {
            ShildMushroom.SetState(ShildMushroomState.Chase);
            return;
        }
    }
Exemplo n.º 5
0
    void Update()
    {
        ShildMushroom.GroggyCheck();
        ShildMushroom.PlayerisDead();

        ShildMushroom.GoToDestination(ShildMushroom.Player.position, ShildMushroom.Stat.MoveSpeed, ShildMushroom.rotAnglePerSecond);

        if (ShildMushroom.GetDistanceFromPlayer() < ShildMushroom.Stat.AttackDistance)
        {
            ShildMushroom.GoToDestination(ShildMushroom.Player.position, 0, ShildMushroom.rotAnglePerSecond);
            if (ShildMushroom.AttackTimer > ShildMushroom.AttackDelay)
            {
                ShildMushroom.SetState(ShildMushroomState.Attack);
                return;
            }
        }

        if (ShildMushroom.AttackTimer < ShildMushroom.AttackDelay && ShildMushroom.GetDistanceFromPlayer() <= ShildMushroom.Stat.AttackDistance)
        {
            ShildMushroom.SetState(ShildMushroomState.Return);
            return;
        }
    }