RoR2-ChensHelpers

Contains simple and useful helpers for RoR2 mod creators to use. Mainly caters to Chen's mods.

View on GitHub

ChensHelpers

Chen.Helpers.GeneralHelpers

Extensions Class

Extensions related to Components defined by Risk of Rain 2.

public static class Extensions

Inheritance System.Object 🡒 Extensions

Methods  
BuildRendererInfos(CharacterModel, GameObject) Builds the renderer information data structure from scratch based on the given GameObject’s MeshRenderer components.
This overload uses a ShadowCastingMode of Off and IgnoreOverlays of value false.
BuildRendererInfos(CharacterModel, GameObject, ShadowCastingMode, bool) Builds the renderer information data structure from scratch based on the given GameObject’s MeshRenderer components.
ConvertShaders(AssetBundle) Replaces all the shaders of the materials in the specified asset bundle.
Uses the prefix “Fake RoR” as a prefix to match materials whose shaders will be replaced.
It also uses RoR2Helpers.DefaultData.ShaderReplacements dictionary as reference for replacements.
ConvertShaders(AssetBundle, Dictionary<string,string>, string) Replaces all the shaders of the materials in the specified asset bundle.
The Replacement Dictionary should have keys that should be looked from materials for modification. It should include a prefix to determine which should be modified.
The respective values for each key will be the replacement.
ReplaceModel(GameObject, GameObject, bool) Replaces the model inside a GameObject’s Model Base.
This is only applicable to GameObjects that have a “ModelBase” or “Model Base” object, as well as a ModelLocator component.
The method will do nothing if it cannot find the model base object.