コード例 #1
0
        void Start()
        {
            // find the clock and level if not assigned
            if (timer == null)
            {
                timer = FindObjectOfType <ClockController> ();
            }
            if (level == null)
            {
                level = FindObjectOfType <TiledMap> ();
            }

            // calculate fps

            fps = (int)(1 / (fixedUpdatesPerFrame * Time.fixedDeltaTime));


            // get all recordables in this level, filtered by
            // enabled-ness, and sorted by name (using System.Linq)

            dynamics = level.GetComponentsInChildren <DynamicRecorder> ();
            dynamics = dynamics.Where(
                gameObject => gameObject.enabled).ToArray();
            dynamics = dynamics.OrderBy(
                gameObject => gameObject.name).ToArray();

            statics = level.GetComponentsInChildren <StaticRecorder> ();
            statics = statics.Where(
                gameObject => gameObject.enabled).ToArray();
            statics = statics.OrderBy(
                gameObject => gameObject.name).ToArray();
        }
コード例 #2
0
        void Start()
        {
            // find the clock and level if not assigned
            if (timer == null)
            {
                timer = FindObjectOfType <ClockController> ();
            }
            if (level == null)
            {
                level = FindObjectOfType <TiledMap> ();
            }

            // get all replayables in this level, filtered by
            // enabled-ness, and sorted by name (using System.Linq)

            dynamics = level.GetComponentsInChildren <DynamicReplayer> ();
            dynamics = dynamics.Where(
                gameObject => gameObject.enabled).ToArray();
            dynamics = dynamics.OrderBy(
                gameObject => gameObject.name).ToArray();

            statics = level.GetComponentsInChildren <StaticReplayer> ();
            statics = statics.Where(
                gameObject => gameObject.enabled).ToArray();
            statics = statics.OrderBy(
                gameObject => gameObject.name).ToArray();
        }