神岛 API 文档 - ArenaPro版
    Preparing search index...

    Interface GameEntityConfig

    定义了用于创建或更新游戏实体的配置选项。

    Defines the configuration options for creating or updating a game entity.

    interface GameEntityConfig {
        anchorOffset: GameVector3;
        bounds: GameVector3;
        chatSound: GameSoundEffectConfig;
        collides: boolean;
        dieSound: GameSoundEffectConfig;
        enableInteract: boolean;
        fixed: boolean;
        friction: number;
        gravity: boolean;
        hurtSound: GameSoundEffectConfig;
        id: string;
        interactColor: GameRGBColor;
        interactHint: string;
        interactRadius: number;
        interactSound: GameSoundEffectConfig;
        mass: number;
        mesh: any;
        meshColor: GameRGBAColor;
        meshEmissive: number;
        meshMetalness: number;
        meshOrientation: GameQuaternion;
        meshScale: GameVector3;
        meshShininess: number;
        particleAcceleration: GameVector3;
        particleColor: GameRGBColor[];
        particleDamping: number;
        particleLifetime: number;
        particleLifetimeSpread: number;
        particleLimit: number;
        particleNoise: number;
        particleNoiseFrequency: number;
        particleRate: number;
        particleRateSpread: number;
        particleSize: number[];
        particleSizeSpread: number;
        particleTarget: GameEntity;
        particleTargetWeight: number;
        particleVelocity: GameVector3;
        particleVelocitySpread: GameVector3;
        position: GameVector3;
        restitution: number;
        tags: string[] | (() => string[]);
        velocity: GameVector3;
    }

    Implemented by

    Index

    General

    id: string

    实体的唯一标识符。

    The unique identifier of the entity.

    tags: string[] | (() => string[])

    实体的标签,可以是返回字符串数组的函数或字符串数组。

    The tags of the entity, which can be a function that returns a string array or a string array.

    Interaction

    enableInteract: boolean

    实体是否可以交互。

    Whether the entity can be interacted with.

    interactColor: GameRGBColor

    实体的交互颜色。

    The interaction color of the entity.

    interactHint: string

    实体的交互提示文本。

    The interaction hint text for the entity.

    interactRadius: number

    实体的交互半径。

    The interaction radius of the entity.

    Physics

    bounds: GameVector3

    实体的物理边界框大小。

    The size of the entity's physics bounding box.

    collides: boolean

    实体是否与其他对象发生碰撞。

    Whether the entity collides with other objects.

    fixed: boolean

    实体是否在世界中固定不动。

    Whether the entity is fixed in the world and immovable.

    friction: number

    实体在表面上移动时的摩擦系数。

    The friction coefficient of the entity when moving on surfaces.

    gravity: boolean

    实体是否受世界重力的影响。

    Whether the entity is affected by world gravity.

    mass: number

    实体的质量,影响物理交互。

    The mass of the entity, affecting physics interactions.

    position: GameVector3

    实体在世界中的初始位置。

    The initial position of the entity in the world.

    restitution: number

    实体的弹性恢复系数(“反弹”程度)。

    The restitution coefficient (bounciness) of the entity.

    velocity: GameVector3

    实体的初始速度。

    The initial velocity of the entity.

    Sound

    实体聊天时的声音配置。

    The sound configuration for when the entity chats.

    实体死亡时的声音配置。

    The sound configuration for when the entity dies.

    实体受伤时的声音配置。

    The sound configuration for when the entity is hurt.

    interactSound: GameSoundEffectConfig

    实体交互时的声音配置。

    The sound configuration for when the entity is interacted with.

    Visual

    anchorOffset: GameVector3

    实体几何中心与锚点的偏移量。

    The offset of the entity's geometric center from its anchor point.

    mesh: any

    实体的视觉模型(网格)。可以是预设的模型资源名称或空字符串。

    The visual model (mesh) of the entity. Can be a preset model asset name or an empty string.

    meshColor: GameRGBAColor

    实体模型的颜色和透明度。

    The color and opacity of the entity's model.

    meshEmissive: number

    实体的网格发光强度。

    The emissive intensity of the entity's mesh.

    meshMetalness: number

    实体的网格金属度。

    The metalness of the entity's mesh.

    meshOrientation: GameQuaternion

    实体模型的旋转朝向。

    The rotational orientation of the entity's model.

    meshScale: GameVector3

    实体模型的缩放比例。

    The scale of the entity's model.

    meshShininess: number

    实体的网格光泽度。

    The shininess of the entity's mesh.

    particleAcceleration: GameVector3

    实体的粒子加速度。

    The acceleration of the entity's particles.

    particleColor: GameRGBColor[]

    实体的粒子颜色数组。

    The color array of the entity's particles.

    particleDamping: number

    实体的粒子阻尼。

    The damping of the entity's particles.

    particleLifetime: number

    实体的粒子生命周期。

    The lifetime of the entity's particles.

    particleLifetimeSpread: number

    实体的粒子生命周期的随机范围。

    The random spread of the entity's particle lifetime.

    particleLimit: number

    实体的粒子数量上限。

    The maximum number of particles for the entity.

    particleNoise: number

    实体的粒子噪声强度。

    The noise intensity of the entity's particles.

    particleNoiseFrequency: number

    实体的粒子噪声频率。

    The noise frequency of the entity's particles.

    particleRate: number

    实体的粒子发射速率。

    The particle emission rate of the entity.

    particleRateSpread: number

    实体的粒子发射速率的随机范围。

    The random spread of the entity's particle emission rate.

    particleSize: number[]

    实体的粒子大小数组。

    The size array of the entity's particles.

    particleSizeSpread: number

    实体的粒子大小的随机范围。

    The random spread of the entity's particle size.

    particleTarget: GameEntity

    实体的粒子目标。

    The target of the entity's particles.

    particleTargetWeight: number

    实体的粒子目标权重。

    The target weight of the entity's particles.

    particleVelocity: GameVector3

    实体的粒子初速度。

    The initial velocity of the entity's particles.

    particleVelocitySpread: GameVector3

    实体的粒子初速度的随机范围。

    The random spread of the entity's particle initial velocity.