//---------------------------------------------------------------------------------------------------- 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); }
//---------------------------------------------------------------------------------------------------- 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); }
//---------------------------------------------------------------------------------------------------- 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); }
//---------------------------------------------------------------------------------------------------- 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); }
public void Setup() { Interpreters.Add(typeof(TestObject), new InterpreterTestObject()); }