SharedTableRegistry

Mostrar obsoleto

*Este contenido se traduce usando la IA (Beta) y puede contener errores. Para ver esta página en inglés, haz clic en aquí.

No creable
Servicio
No replicado

Proporciona un registro global de objetos llamados SharedTable objetos. Se puede utilizar para almacenar objetos SharedTable que son utilizados por múltiples scripts.

Resumen

Métodos

Propiedades

Métodos

GetSharedTable

Escribir paralelo

Obtiene el registrado SharedTable con el nombre especificado.Si no existe ningún SharedTable con ese nombre, se crea un nuevo SharedTable con ese nombre y se devuelve.


local SharedTableRegistry = game:GetService("SharedTableRegistry")
local st = SharedTableRegistry:GetSharedTable("MyData")

Parámetros

name: string

El nombre del registrado SharedTable .

Valor predeterminado: ""

Devuelve

SetSharedTable

()
Escribir paralelo

Registra el proporcionado SharedTable con el nombre especificado.Si el proporcionado SharedTable es nil , cualquier existente SharedTable con el nombre especificado no se registra.


local SharedTableRegistry = game:GetService("SharedTableRegistry")
-- Registre una tabla compartida con el nombre "MyData":
local st = SharedTable.new({1, 2, 3})
SharedTableRegistry:SetSharedTable("MyData", st)
-- Desregistre la tabla compartida con el nombre "MyData":
SharedTableRegistry:SetSharedTable("MyData", nil)

Parámetros

name: string

El nombre del registrado SharedTable .

Valor predeterminado: ""

El objeto SharedTable para registrarse, o nil para desregistrar cualquier objeto SharedTable previamente registrado.

Valor predeterminado: ""

Devuelve

()

Eventos