Table of Contents

Class NPCPrefabBuilder.AvatarDefaultsBuilder

Namespace
S1API.Entities
Assembly
S1API.dll

Wrapper for authoring appearance defaults without exposing game types to modders.

public sealed class NPCPrefabBuilder.AvatarDefaultsBuilder
Inheritance
NPCPrefabBuilder.AvatarDefaultsBuilder
Inherited Members
Extension Methods

Constructors

AvatarDefaultsBuilder()

public AvatarDefaultsBuilder()

Properties

EyeBallTint

public Color EyeBallTint { get; set; }

Property Value

Color

EyeballMaterialIdentifier

public string EyeballMaterialIdentifier { get; set; }

Property Value

string

EyebrowRestingAngle

public float EyebrowRestingAngle { get; set; }

Property Value

float

EyebrowRestingHeight

public float EyebrowRestingHeight { get; set; }

Property Value

float

EyebrowScale

public float EyebrowScale { get; set; }

Property Value

float

EyebrowThickness

public float EyebrowThickness { get; set; }

Property Value

float

Gender

public float Gender { get; set; }

Property Value

float

HairColor

public Color HairColor { get; set; }

Property Value

Color

HairPath

public string HairPath { get; set; }

Property Value

string

Height

public float Height { get; set; }

Property Value

float

LeftEye

public (float topLidOpen, float bottomLidOpen) LeftEye { get; set; }

Property Value

(float topLidOpen, float bottomLidOpen)

LeftEyeLidColor

public Color LeftEyeLidColor { get; set; }

Property Value

Color

PupilDilation

public float PupilDilation { get; set; }

Property Value

float

RightEye

public (float topLidOpen, float bottomLidOpen) RightEye { get; set; }

Property Value

(float topLidOpen, float bottomLidOpen)

RightEyeLidColor

public Color RightEyeLidColor { get; set; }

Property Value

Color

SkinColor

public Color32 SkinColor { get; set; }

Property Value

Color32

Weight

public float Weight { get; set; }

Property Value

float

Methods

WithAccessoryLayer(string, Color)

public NPCPrefabBuilder.AvatarDefaultsBuilder WithAccessoryLayer(string path, Color color)

Parameters

path string
color Color

Returns

NPCPrefabBuilder.AvatarDefaultsBuilder

WithBodyLayer(string, Color)

public NPCPrefabBuilder.AvatarDefaultsBuilder WithBodyLayer(string path, Color color)

Parameters

path string
color Color

Returns

NPCPrefabBuilder.AvatarDefaultsBuilder

WithFaceLayer(string, Color)

public NPCPrefabBuilder.AvatarDefaultsBuilder WithFaceLayer(string path, Color color)

Parameters

path string
color Color

Returns

NPCPrefabBuilder.AvatarDefaultsBuilder

WithImpostor(AvatarImpostorDefinition)

Uses an existing game-owned NPC impostor discovered through NPCImpostorCatalog.

public NPCPrefabBuilder.AvatarDefaultsBuilder WithImpostor(AvatarImpostorDefinition impostor)

Parameters

impostor AvatarImpostorDefinition

The discovered impostor definition to use.

Returns

NPCPrefabBuilder.AvatarDefaultsBuilder

The current builder for chaining.

WithImpostor(string)

Uses an existing game-owned NPC impostor by character settings name.

public NPCPrefabBuilder.AvatarDefaultsBuilder WithImpostor(string name)

Parameters

name string

Name such as Kyle, or a resource path such as charactersettings/Kyle.

Returns

NPCPrefabBuilder.AvatarDefaultsBuilder

The current builder for chaining.

WithImpostorTexture(Texture2D)

Uses a texture supplied by the mod as this NPC's far-distance impostor.

public NPCPrefabBuilder.AvatarDefaultsBuilder WithImpostorTexture(Texture2D texture)

Parameters

texture Texture2D

Texture to use for the impostor.

Returns

NPCPrefabBuilder.AvatarDefaultsBuilder

The current builder for chaining.

Remarks

This is appropriate for textures loaded from an embedded resource with TextureUtils.LoadTextureFromResource(...). S1API does not network raw texture bytes; every visual client must be able to load the same texture locally.

WithRandomImpostor()

Uses a deterministic random game-owned NPC impostor from all available impostors.

public NPCPrefabBuilder.AvatarDefaultsBuilder WithRandomImpostor()

Returns

NPCPrefabBuilder.AvatarDefaultsBuilder

The current builder for chaining.

WithRandomImpostor(int, params string[])

Uses a seeded random game-owned NPC impostor from the supplied character settings names.

public NPCPrefabBuilder.AvatarDefaultsBuilder WithRandomImpostor(int seed, params string[] names)

Parameters

seed int

Seed used to select the impostor.

names string[]

Names such as Kyle, Mac, or Mick.

Returns

NPCPrefabBuilder.AvatarDefaultsBuilder

The current builder for chaining.

WithRandomImpostor(params string[])

Uses a deterministic random game-owned NPC impostor from the supplied character settings names.

public NPCPrefabBuilder.AvatarDefaultsBuilder WithRandomImpostor(params string[] names)

Parameters

names string[]

Names such as Kyle, Mac, or Mick.

Returns

NPCPrefabBuilder.AvatarDefaultsBuilder

The current builder for chaining.