Skip to content
AvatarSettings

Settings / AvatarSettings

AvatarSettings Class

Control the opening and closing of some optimization items

Example usage: Create a script named "ClassExample", place it in the object bar, open the script, enter the following code to save, run the game, and you will see the corresponding method call information in the server log. The code is as follows:

ts
@Component
export default class ClassExample extends Script {

    protected onStart(): void {
       this.RoomSettings();
    }

    public RoomSettings(){
       let opt = AvatarSettings.optimizationEnabled;
       Console.log ("Whether role optimization is enabled:"+opt);
    }
}
@Component
export default class ClassExample extends Script {

    protected onStart(): void {
       this.RoomSettings();
    }

    public RoomSettings(){
       let opt = AvatarSettings.optimizationEnabled;
       Console.log ("Whether role optimization is enabled:"+opt);
    }
}

Table of contents

Accessors

optimizationEnabled(): boolean other
Turn character optimization on or off: limit the time to run animation data by dynamically limiting the tick frequency of component of the skeleton mesh. The purpose is to use a fixed CPU budget (not exceeding it),

Methods

setOptimization(character: Character, useAnimationBudget: boolean, useWave: boolean): void other
Turn on and off a character optimization: limit the time to run animation data by dynamically limiting the tick frequency of component of the skeleton mesh. The purpose is to use a fixed CPU budget (not exceeding it),

Accessors

optimizationEnabled

Static get optimizationEnabled(): boolean other

Static set optimizationEnabled(isEnabled): void other

Turn character optimization on or off: limit the time to run animation data by dynamically limiting the tick frequency of component of the skeleton mesh. The purpose is to use a fixed CPU budget (not exceeding it), Simultaneously maximizing the perceived animation quality with minimal system overhead. The system determines the fixed budget of each platform (the number of milliseconds (ms) of work executed on the game thread), and determines whether it can complete all the required work, Or whether it is necessary to reduce the workload to complete. If it needs to be reduced, it will do so based on importance and target several areas, with the goal of dynamically adjusting the load to fit a fixed (game thread) budget. The areas include: Stop checking and use Master Pose Component. Perform updates at a lower rate. Insert (or not insert) between update.

Returns

booleanBoolean: Whether role optimization is enabled. If the return value is undefined, please check if it is called on the client side. The default value is true

Turn character optimization on or off: limit the time to run animation data by dynamically limiting the tick frequency of component of the skeleton mesh. The purpose is to use a fixed CPU budget (not exceeding it), Simultaneously maximizing the perceived animation quality with minimal system overhead. The system determines the fixed budget of each platform (the number of milliseconds (ms) of work executed on the game thread), and determines whether it can complete all the required work, Or whether it is necessary to reduce the workload to complete. If it needs to be reduced, it will do so based on importance and target several areas, with the goal of dynamically adjusting the load to fit a fixed (game thread) budget. The areas include: Stop checking and use Master Pose Component. Perform updates at a lower rate. Insert (or not insert) between update.

Parameters

isEnabled booleanUsage: Whether to enable or disable role optimization

Methods

setOptimization

Static setOptimization(character, useAnimationBudget, useWave): void other

Turn on and off a character optimization: limit the time to run animation data by dynamically limiting the tick frequency of component of the skeleton mesh. The purpose is to use a fixed CPU budget (not exceeding it),

Parameters

character CharacterUsage: character object
useAnimationBudget booleanUsage: Whether to open or close character animation budget allocator
useWave booleanUsage: This parameter is now deprecated

Or whether it is necessary to reduce the workload to complete. If it needs to be reduced, it will do so based on importance and target several areas, with the goal of dynamically adjusting the load to fit a fixed (game thread) budget. The areas include: Stop checking and use Master Pose Component. Perform updates at a lower rate. Insert (or not insert) between update.