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()
    {
        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.º 4
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;
        }
    }