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

Extensions.ReplaceModel(GameObject, GameObject, bool) Method

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.

public static void ReplaceModel(this GameObject originalClonedObject, GameObject replacementModel, bool debug=false);

Parameters

originalClonedObject UnityEngine.GameObject
The whole original cloned object

replacementModel UnityEngine.GameObject
The replacement model loaded from an asset bundle

debug System.Boolean
Set to true to attach the Material Controller for modifying materials in-game.