Example #1
0
    void Update()
    {
        if (!worldFactoryScript)
        {
            //Get world factory script
            GameObject worldFactory = null;
            worldFactory = GlobalOptions.GetWorldFactory();
            if (worldFactory)
            {
                worldFactoryScript = worldFactory.GetComponent <WorldFactory>();
            }
        }

        if (!worldFactoryScript)
        {
            return;
        }

        timeleft -= Time.deltaTime;

        // Interval ended - update GUI text and start new interval
        if (timeleft <= 0.0)
        {
            timeleft = updateInterval;
            string format = worldFactoryScript.GetCurrentObstacleSet();
            guiText.text           = format;
            guiText.material.color = Color.blue;
        }
    }