using System.Collections; using System.Collections.Generic; using UnityEngine; using BITKit; using BITKit.SubSystems; using UnityEngine.UIElements; using Cysharp.Threading.Tasks; using System.Threading.Tasks; #if UNITY_EDITOR using UnityEditor; using UnityEditor.UIElements; #endif namespace BITKit.UX { public class UXMeshRenderer : UXElement { [Header(Constant.Header.Settings)] public Transform model; public override void OnStart() { base.OnStart(); CreateTexture(); } public async void CreateTexture() { //visualElement.style.backgroundImage = new(Background.FromTexture2D(texture)); visualElement.style.backgroundImage = new(await MeshRendering.Create(model)); } } #if UNITY_EDITOR //[CustomEditor(typeof(UXMeshRenderer))] public class UXMeshRendererInspector : BITInspector { public override VisualElement CreateInspectorGUI() { CreateSubTitle(Constant.Header.Gameobjects); var document = root.Create(); CreateSubTitle(Constant.Header.Settings); var model = root.Create(); var button = root.Create