Files
AR-Menu/Library/PackageCache/com.unity.cloud.gltfast@db5a82ec0b47/Editor/Scripts/Utils.cs
2025-11-30 08:35:03 +02:00

31 lines
986 B
C#

// SPDX-FileCopyrightText: 2023 Unity Technologies and the glTFast authors
// SPDX-License-Identifier: Apache-2.0
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.UIElements;
using UnityEngine;
using UnityEngine.UIElements;
namespace GLTFast.Editor
{
static class Utils
{
internal static void CreateProperties(VisualElement container, IEnumerable<SerializedProperty> properties)
{
foreach (var property in properties)
{
CreateProperty(container, property);
}
}
internal static PropertyField CreateProperty(VisualElement container, SerializedProperty property, string label = null)
{
var propertyField = new PropertyField(property.Copy(), label) { name = "PropertyField:" + property.propertyPath };
propertyField.BindProperty(property.Copy());
container.Add(propertyField);
return propertyField;
}
}
}