Beispiel #1
0
    /// <summary>
    /// Called once per frame
    /// checks for "quit" command
    /// checks for button presses
    /// executes all updates on entities
    /// keeps the clock ticking
    /// Exports Frame if needed
    /// </summary>
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            Application.Quit();
        }

        // maybe obsolete
        Buttons();
        //running all updates
        if (TimeRunning && UpdateTick != null)
        {
            //I call my own Update <3
            if (UpdateTick != null)
            {
                UpdateTick();
            }

            timer    = timer + Time.deltaTime;
            currTime = currTime + Time.deltaTime;
            if (timer >= TimeToSave)
            {
                FManager.ExportByEntityData(entities);
                timer = 0;
            }
        }
        //Debug.Log ("Log");
    }