Ejemplo n.º 1
0
    void ShieldState()
    {
        switch (the_FFS)
        {
        case ForceFieldStatus.Activated:
        {
            if (forcefield_up_Time > 0)
            {
                forcefield_up_Time -= Time.deltaTime;
            }
            else
            {
                the_FF_GameObject.SetActive(false);
                the_FFS = ForceFieldStatus.Recharging;
            }
            break;
        }

        case ForceFieldStatus.Recharging:
        {
            if (time_Recharge < time_Recharge_Needed)
            {
                time_Recharge += Time.deltaTime;
            }
            else
            {
                forcefield_up_Time = forcefield_Time_Span;
                the_FFS            = ForceFieldStatus.Activated;
                time_Recharge      = 0;
                the_FF_GameObject.SetActive(true);
            }
            break;
        }
        }
    }
Ejemplo n.º 2
0
    void ShieldState()
    {
        switch (the_FFS)
        {
        case ForceFieldStatus.Patrolling:
        {
            if (the_BMEC.the_PM != null)
            {
                the_FFS = ForceFieldStatus.PlayerDetected;
            }
            break;
        }

        case ForceFieldStatus.PlayerDetected:
        {
            the_FF_GameObject.SetActive(true);
            if (the_BMEC.the_PM == null)
            {
                the_FFS = ForceFieldStatus.PlayerOutOfRange;
            }
            break;
        }

        case ForceFieldStatus.PlayerOutOfRange:
        {
            if (forcefield_Timer > 0)
            {
                forcefield_Timer -= Time.deltaTime;
            }
            else
            {
                the_FFS          = ForceFieldStatus.Patrolling;
                forcefield_Timer = forcefield_Down_Timer;
                the_FF_GameObject.SetActive(false);
            }
            break;
        }
        }
    }