Update() public méthode

public Update ( ) : void
Résultat void
Exemple #1
0
 /// <summary>
 /// Updates the sensor
 /// </summary>
 private void Update()
 {
     if (scanTimer.Update(Time.deltaTime))
     {
         Scan();
         scanTimer.Reset();
     }
 }
Exemple #2
0
 public override void Update(float dt)
 {
     Timer.Update(Time.deltaTime);
     if (Timer.isFinished)
     {
         this.CheckInput();
     }
 }
Exemple #3
0
    public override string DoBehaviour()
    {
        string time = "";

        if (isStopwatchTriggered == true)
        {
            stopwatch.Update();

            time = stopwatch.CurrentTime;
        }
        return(time);
    }
Exemple #4
0
    // Update is called once per frame
    void Update()
    {
        if (GameState.CurrentState == GameState.State.GameOver)
        {
            return;
        }

        timer.Update();
        if ((!timer.IsRunning) && onTable.Count > 4)
        {
            timer.Start();
        }
        else if (timer.IsRunning && onTable.Count < 4)
        {
            timer.Stop();
        }

        if (timer.IsRunning && (timer.getElapsedSeconds() > DISCHARGE))
        {
            // now ya done son
            GameObject[] blocks = GameObject.FindGameObjectsWithTag("Block");
            foreach (GameObject block in blocks)
            {
                float scoreF = (scoreKeeper.score / 1000f) * 40.0f;
                float force  = 10.0f + scoreF;
                block.GetComponent <Rigidbody>().AddExplosionForce(force, CameraControls.Instance.Focus, force);
                block.GetComponent <Rigidbody>().AddExplosionForce(2 * force, Vector3.zero, force);
                this.enabled = false;
            }

            GameState.ChangeState(GameState.State.GameOver);
        }

        // countdown
        if (timer.IsRunning)
        {
            countdown.enabled = true;
            countdown.text    = (((int)DISCHARGE) - (int)timer.getElapsedSeconds()).ToString();
        }
        else
        {
            countdown.enabled = false;
        }
    }
Exemple #5
0
            /// <summary>
            /// Updates the interpolator
            /// </summary>
            /// <param name="dt"></param>
            public void Update(float dt)
            {
                if (Active)
                {
                    if (Timer.Update(dt))
                    {
                        Timer.Reset();
                        _Active = false;
                    }

                    float t = Timer.normalizedProgress;
                    Interpolate(t);

                    // Interpolate depending on type
                    if (CurrentValue is Vector3)
                    {
                    }
                }
            }