Start() public method

public Start ( float time ) : void
time float
return void
Exemplo n.º 1
0
    protected void TryCaptureOrRecharge(Portal portal, AchievementModel achievement)
    {
        if (portal.Model.Faction == Faction.None)
        {
            GameProvider.CapturePortal(portal, SelfFaction);

            achievement.Capture(portal.Model);
            if (ShouldSound)
            {
                SoundManager.GetInstance().PortalCapturedSound.Play();
            }
        }
        else if (portal.Model.Faction == SelfFaction)
        {
            if (portal.Energy < 100 && rechargeTimer.IsTimeout())
            {
                portal.RechargeEnergy(10);
                rechargeTimer.Start();

                achievement.Recharge();
                if (ShouldSound)
                {
                    SoundManager.GetInstance().PortalRechargedSound.Play();
                }
            }
        }
    }
Exemplo n.º 2
0
 // Update is called once per frame
 void Update()
 {
     if (!IsActive)
     {
         if (Input.touchCount > 0 || Input.GetMouseButton(0))
         {
             if (!activationTimerCounting)
             {
                 activationTimer.Start();
                 activationTimerCounting = true;
             }
             else
             {
                 if (activationTimer.IsTimeout())
                 {
                     InputPad.SetActive(true);
                     activationTimerCounting = false;
                     SoundManager.GetInstance().MenuSelectSound.Play();
                 }
             }
         }
         else
         {
             activationTimerCounting = false;
         }
     }
 }
Exemplo n.º 3
0
 static int Start(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         TimeTicker obj  = (TimeTicker)ToLua.CheckObject(L, 1, typeof(TimeTicker));
         float      arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
         obj.Start(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 4
0
    private void FinishGame(Boolean escape)
    {
        var muDiff      = LinkManager.GetMU(Faction.Player) - LinkManager.GetMU(Faction.Enemy);
        var finalResult =
            (muDiff < 0 || escape) ? Resultboard.FinalResult.Lose :
            (muDiff >= GameConstants.ExceedingMUToWin) ? Resultboard.FinalResult.Win :
            Resultboard.FinalResult.Draw;

        Resultboard.DisplayFinalResult(finalResult, new MedalHelper(PlayerAchievement).Results);
        Resultboard.Show();
        SoundManager.GetInstance().FinishSound.Play();

        IsGameOver = true;
        if (!escape)
        {
            gameOverScreenWaitTimer.Start();
        }
    }
Exemplo n.º 5
0
    // TODO Player specific?
    public bool TryHack(Faction faction, ItemInventoryModel inventory)
    {
        if (!coolDownTimer.IsTimeout())
        {
            return(false);
        }

        coolDownTimer.Start();

        inventory.AddBursters(Mathf.FloorToInt(Random.value * BursterDropRate));

        if (Random.value < KeyDropRate)
        {
            inventory.AddKey(Model);
        }

        return(true);
    }
Exemplo n.º 6
0
    private int GetInput()
    {
        var input = InputUtil.GetY();

        if (input != 0)
        {
            if (keyInputRepeatTimer.IsTimeout())
            {
                keyInputRepeatTimer.Start();
                return(input);
            }
            else
            {
                return(0);
            }
        }
        else
        {
            keyInputRepeatTimer.Reset();
            return(input);
        }
    }
Exemplo n.º 7
0
 public void DisplayHack()
 {
     hackIndicatorTimer.Start();
 }