コード例 #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);
        }
    }
コード例 #2
0
    public void TestNameComponentKernelUpdate()
    {
        //Arrange
        DCLBuilderInWorldEntity entity = entityHandler.CreateEmptyEntity(scene, Vector3.zero, Vector3.zero);

        entity.SetDescriptiveName("Test");

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

        //Assert
        CheckMessageReceived();
    }