Ejemplo n.º 1
0
        static void editorUpdate()
        {
            if (EditorApplication.isPlaying) //this is only for pure editor mode:  to allow updates so we can use the realsens to move things in the scene
            {
                return;
            }


            if (d)
            {
                d.editorUpdate();
                return; //we're done.
            }

            //try to supply the depthPlugin
            d = depthPlugin.get(); //this doesn't usually work in-editor.
            if (!d)
            {
                d = GameObject.FindObjectOfType <depthPlugin>();
            }

            //try again.
            if (d)
            {
                d.editorUpdate();
            }
            // else
            //      stop();
        }
Ejemplo n.º 2
0
        void Awake()
        {
            if (instance != null && instance != this)
            {
                Destroy(this.gameObject);
                return;
            }

            instance = this;
            DontDestroyOnLoad(this.gameObject);
            //end singleton
        }