public static void DetachSharedComponent(ParcelScene scene, string fromEntityId, string sharedComponentId) { DecentralandEntity entity = null; if (!scene.entities.TryGetValue(fromEntityId, out entity)) { return; } scene.GetSharedComponent(sharedComponentId).DetachFrom(entity); }
public static string GetComponentUniqueId(ParcelScene scene, string salt, int classId, string entityId) { string baseId = salt + "-" + (int)classId + "-" + entityId; string finalId = baseId; while (scene.GetSharedComponent(finalId) != null) { finalId = baseId + UnityEngine.Random.Range(1, 10000); } return(finalId); }