Example #1
0
        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);
        }
Example #2
0
        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);
        }