Game.Settings.AnimationQualitySettings
Assembly: Assembly-CSharp
Namespace: Game.Settings
Type: class
Base: QualitySetting
Summary:
Represents animation-related quality settings for the game, specifically controlling skinning (maximum bone influence per vertex). The class is annotated with UI attributes ([SettingsUIAdvanced], [SettingsUISection("AnimationQualitySettings")], [SettingsUIDisableByCondition(typeof(AnimationQualitySettings), "IsOptionsDisabled")]) so it participates in the game's settings UI. The static constructor registers default presets for Medium and High quality levels. Apply() enables or disables the shader keyword "TWO_BONES_INFLUENCE" depending on the selected skinning mode, allowing shaders to use either two-bone or four-bone skinning.
Fields
-
private static AnimationQualitySettings highQuality
Private static read-only (expression-bodied) property returning a preconfigured AnimationQualitySettings instance for High quality (maxBoneInfuence = Skinning.FourBones). Used by the static constructor to register the High preset. -
private static AnimationQualitySettings mediumQuality
Private static read-only (expression-bodied) property returning a preconfigured AnimationQualitySettings instance for Medium quality (maxBoneInfuence = Skinning.TwoBones). Used by the static constructor to register the Medium preset.
Properties
public Skinning maxBoneInfuence { get; set; }
Controls the maximum bone influence used by skinning. Note: the source name is spelled "maxBoneInfuence" (missing an 'l' in "Influence"). Possible values are defined by the nested enum Skinning:- Skinning.TwoBones — limit to two bone influences per vertex (uses shader keyword "TWO_BONES_INFLUENCE").
- Skinning.FourBones — allow four bone influences per vertex (disable the "TWO_BONES_INFLUENCE" keyword).
Constructors
-
public AnimationQualitySettings()
Default constructor. Creates an instance without changing the current quality level. -
public AnimationQualitySettings(Level quality)
Constructs an instance and calls SetLevel(quality, apply: false) to initialize fields from the specified quality level without immediately applying the setting to runtime systems.
Methods
static AnimationQualitySettings()
Static constructor that registers the medium and high presets with QualitySetting.RegisterSetting: - Level.Medium -> mediumQuality (TwoBones)
-
Level.High -> highQuality (FourBones)
-
public override void Apply()
Calls base.Apply() and then applies the skinning-related shader keyword: - If maxBoneInfuence == Skinning.FourBones, it disables the "TWO_BONES_INFLUENCE" keyword so shaders will use four-bone skinning.
- If maxBoneInfuence == Skinning.TwoBones, it enables the "TWO_BONES_INFLUENCE" keyword so shaders will use two-bone skinning. This is how the setting affects rendering behavior at runtime.
Nested Types
public enum Skinning
Defines supported skinning limits:TwoBones
FourBones
Usage Example
// Create an instance for High quality (four bones) and apply it immediately.
var high = new AnimationQualitySettings(AnimationQualitySettings.Skinning.FourBones); // constructor overload expects Level normally; this example shows setting property directly
high.maxBoneInfuence = AnimationQualitySettings.Skinning.FourBones;
high.Apply();
// Alternatively, construct from a quality level preset:
var settings = new AnimationQualitySettings(Level.High);
settings.Apply();
// Toggle to two-bone skinning at runtime:
settings.maxBoneInfuence = AnimationQualitySettings.Skinning.TwoBones;
settings.Apply();
Notes:
- The class integrates with the game's QualitySetting