Beispiel #1
0
        //----------------------------------------------------------------------------------------------------

        static void SetupGQL()
        {
            // node interpreters for types

            Interpreters.Add(typeof(GameObject), new InterpreterGameObject());
            Interpreters.Add(typeof(GameObject[]), new InterpreterGameObjectArray());
            Interpreters.Add(typeof(Root), new InterpreterSearchRoot());

            Func <object> scene = () => UnityEngine.SceneManagement.SceneManager.GetActiveScene().GetRootGameObjects();

            Root.Add("scene", scene);
            Root.Add("stats", Stats.Singleton);
            Root.Add("events", Events.Singleton);
        }
Beispiel #2
0
        //----------------------------------------------------------------------------------------------------

        static void SetupGQL()
        {
            // node interpreters for types

            Interpreters.Add(typeof(GameObject), new InterpreterGameObject());
            Interpreters.Add(typeof(GameObject[]), new InterpreterGameObjectArray());
            Interpreters.Add(typeof(Root), new InterpreterSearchRoot());

            // /q/scene queries all root-level game objects across scenes

            Func <object> scene = () => Enumerable.Range(0, SceneManager.sceneCount).SelectMany(i => SceneManager.GetSceneAt(i).GetRootGameObjects()).ToArray();

            Root.Add("scene", scene);
            Root.Add("stats", Stats.Singleton);
            Root.Add("events", Events.Singleton);
        }
Beispiel #3
0
        //----------------------------------------------------------------------------------------------------

        static void SetupGQL()
        {
            // node interpreters for types

            Interpreters.Add(typeof(GameObject), new InterpreterGameObject());
            Interpreters.Add(typeof(GameObject[]), new InterpreterGameObjectArray());
            Interpreters.Add(typeof(Root), new InterpreterSearchRoot());

            // /q/scene queries root-level game objects from all loaded scenes, and the "DontDestroyOnScene" pseudo-scene if running

            Func <object> scene = () =>
                                  Enumerable
                                  .Range(0, SceneManager.sceneCount)
                                  .SelectMany(i => SceneManager.GetSceneAt(i).GetRootGameObjects())
                                  .Concat(UniumComponent.Singleton ? UniumComponent.Singleton.gameObject.scene.GetRootGameObjects() : Enumerable.Empty <GameObject>())
                                  .ToArray();

            Root.Add("scene", scene);
            Root.Add("stats", Stats.Singleton);
            Root.Add("events", Events.Singleton);
        }
Beispiel #4
0
        //----------------------------------------------------------------------------------------------------

        static void SetupGQL()
        {
            // node interpreters for types

            Interpreters.Add(typeof(GameObject), new InterpreterGameObject());
            Interpreters.Add(typeof(GameObject[]), new InterpreterGameObjectArray());
            Interpreters.Add(typeof(Root), new InterpreterSearchRoot());

            // /q/scene queries all root-level game objects

            Func <object> scene = () =>
                                  Enumerable
                                  .Range(0, SceneManager.sceneCount)
                                  .SelectMany(i => SceneManager.GetSceneAt(i).GetRootGameObjects())       // all loaded scenes
                                  .Concat(UniumComponent.Singleton.gameObject.scene.GetRootGameObjects()) // don't destroy on load 'scene'
                                  .ToArray();

            Root.Add("scene", scene);
            Root.Add("stats", Stats.Singleton);
            Root.Add("events", Events.Singleton);
        }
Beispiel #5
0
 public void Setup()
 {
     Interpreters.Add(typeof(TestObject), new InterpreterTestObject());
 }