Beispiel #1
0
    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);
        }
    }
Beispiel #2
0
    public void DescriptiveName()
    {
        //Arrange
        string newName = "testingName";

        //Act
        entity.SetDescriptiveName(newName);

        //Assert
        Assert.AreEqual(entity.GetDescriptiveName(), newName);
    }
Beispiel #3
0
    public void TestNameComponentKernelUpdate()
    {
        //Arrange
        DCLBuilderInWorldEntity entity = entityHandler.CreateEmptyEntity(scene, Vector3.zero, Vector3.zero);

        entity.SetDescriptiveName("Test");

        //Act
        biwBridge.ChangedEntityName(entity, scene);

        //Assert
        CheckMessageReceived();
    }