Scene Loading Utility

thumb
Identnolankicks.sceneloadingutility
Typelibrary
Created
Updated
Latest Version 65380 249.3 KB +23 ~1
Links s&box
Summary
Description
About Scene Loading Utility A custom scene loading library that allows for manipulation of the scene file before loading Api public class CustomScene { public CustomScene( SceneFile sceneFile ); //Creates an object in the custom scene public void CreateObject( GameObject gameObject ); //Get a json object //Find all objects by a type of a component public IEnumerable GetAllObjectsByType( Type type ); //Gets an object within the scene from a guid public IEnumerable GetAllObjectsByGuid( string guid ); //Gets an object within the scene from a name public IEnumerable GetAllObjectsByName( string name ) //Manipulate the json object //Adds a component to a json object by a type public void AddComponentByType( JsonObject obj, Type componentType ) //Adds a component from a json object to a JsonObject GameObject public void AddComponent( JsonObject obj, JsonObject newComponent ) //Removes a component by a type from a JsonObject public void RemoveComponentByType( JsonObject obj, Type type ) //Remove an object from the scene public void RemoveObject( JsonNode obj ) //Loads the custom scene public void LoadScene(); } Example public void LoadScene() { var customScene = new CustomScene( sceneFile ); if ( customScene.GetAllObjectsByType( typeof( SkinnedModelRenderer ) ).Count() == 0 ) { customScene.CreateObject( new GameObject() ); } customScene.LoadScene(); }
About Scene Loading Utility A custom scene loading library that allows for manipulation of the scene file before loading Api public class CustomScene { public CustomScene( SceneFile sceneFile ); //Creates an object in the custom scene public void CreateObject( GameObject gameObject ); //Get a json object //Find all objects by a type of a component public IEnumerable GetAllObjectsByType( Type type ); //Gets an object within the scene from a guid public IEnumerable GetAllObjectsByGuid( string guid ); //Gets an object within the scene from a name public IEnumerable GetAllObjectsByName( string name ) //Manipulate the json object //Adds a component to a json object by a type public void AddComponentByType( JsonObject obj, Type componentType ) //Adds a component from a json object to a JsonObject GameObject public void AddComponent( JsonObject obj, JsonObject newComponent ) //Removes a component by a type from a JsonObject public void RemoveComponentByType( JsonObject obj, Type type ) //Remove an object from the scene public void RemoveObject( JsonNode obj ) //Loads the custom scene public void LoadScene(); } Example public void LoadScene() { var customScene = new CustomScene( sceneFile ); if ( customScene.GetAllObjectsByType( typeof( SkinnedModelRenderer ) ).Count() == 0 ) { customScene.CreateObject( new GameObject() ); } customScene.LoadScene(); }
Votes 0 0 0
Error Rate0%
Data
{}