public void SetEntityName(DCLBuilderInWorldEntity entityToApply, string newName, bool sendUpdateToKernel = true) { string currentName = entityToApply.GetDescriptiveName(); if (currentName == newName) { return; } if (entityNameList.Contains(newName)) { newName = GetNewNameForEntity(newName); } if (entityNameList.Contains(currentName)) { entityNameList.Remove(currentName); } entityToApply.SetDescriptiveName(newName); entityNameList.Add(newName); if (sendUpdateToKernel) { builderInWorldBridge?.ChangedEntityName(entityToApply, sceneToEdit); } }
public void TestNameComponentKernelUpdate() { //Arrange DCLBuilderInWorldEntity entity = entityHandler.CreateEmptyEntity(scene, Vector3.zero, Vector3.zero); entity.SetDescriptiveName("Test"); //Act biwBridge.ChangedEntityName(entity, scene); //Assert CheckMessageReceived(); }