Пример #1
0
 // Update is called once per frame
 void Update()
 {
     fartTimer.Update();
     if (fartTimer.IsReady())
     {
         SpawnFart();
         fartTimer.Reset();
     }
 }
Пример #2
0
 // Update is called once per frame
 void Update()
 {
     fartCooldown.timer -= Time.deltaTime * pollutingSpeed;
     if (fartCooldown.IsReady())
     {
         fartCooldown.Reset();
         Fart();
     }
     else
     {
     }
 }
Пример #3
0
    // Update is called once per frame
    void Update()
    {
        attackCooldown.Update();

        if (isOwnByLocalPlayer)
        {
            var leftClick = Input.GetMouseButtonDown(0);
            if (leftClick && attackCooldown.IsReady())
            {
                CmdAttack(Util.MousePositionInWorld);
            }
        }
        if (isServer)
        {
            numOfFartAte -= Time.deltaTime;
            if (numOfFartAte < 0)
            {
                numOfFartAte = 0;
            }
        }
    }