public void SetEntityName(BIWEntity 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) { bridge?.ChangedEntityName(entityToApply, sceneToEdit); } }
public void DescriptiveName() { //Arrange string newName = "testingName"; //Act entity.SetDescriptiveName(newName); //Assert Assert.AreEqual(entity.GetDescriptiveName(), newName); }
public void TestNameComponentKernelUpdate() { //Arrange BIWEntity entity = entityHandler.CreateEmptyEntity(scene, Vector3.zero, Vector3.zero); entity.SetDescriptiveName("Test"); //Act biwBridge.ChangedEntityName(entity, scene); //Assert CheckMessageReceived(); }