Unity UIElements: kesan pertama dalam produksi

Hari ini kami akan membagikan kesan kami bekerja dengan kerangka kerja yang diakui dari Unity - UIToolkit, juga dikenal sebagai UIElements. Kami akan membahas fitur utamanya tanpa mendalami kode. Perlu diklarifikasi bahwa tim tidak memiliki pengalaman sebelumnya dalam bekerja dengan tata letak web dan hal-hal yang jelas bagi para profesional di bidang ini mungkin tidak terlihat jelas bagi kami.



gambar



Catatan dari mitra MAI IT-center dan penyelenggara program master β€œ VR / AR & AI ” - PHYGITALISM .



Latar Belakang



Unity IMGUI , . , , : , . IMGUI UGUI , . UI (Canvas, Image, Button .). IMGUI, : ( ), , , ..



, UGUI, Unity Asset Store. , DoozyUI , , β€” Procedural UI Image.





Unity 2019.1 β€” UIElements ( UIToolkit, ) β€” Unity. , Editor, Runtime roadmap.



gambar

Building UI for games with the new UI Builder β€” Unite Copenhagen.



HTML/XAML/XML CSS . UIElements : UXML , USS , .. , , . , , , USS ( ).



gambar

Building UI for games with the new UI Builder β€” Unite Copenhagen.



UIElements



: preview . , ?



, , 3D 2D , . , GUI . Unity UGUI Canvas, CanvasGroup, LayoutGroup. , . .



, UIElements.



-, runtime. . runtime Unite 2018 .



-, UI. , UGUI .



-, 2D GUI . UI ? .



-, UI . , , . UGUI , .



, Unity , β€” , Unity . β€” UGUI.





UIElements . 2019.4, 2020.1 .



runtime , , . - , , runtime. .



. UIElements UGUI. Unity , , UI , . . , UIElements .



Flexbox , , Unity , . , USS CSS , UIElements. , , , , UIBuilder β€” . UIElements , UGUI, .. UGUI . . , β€” . .



best practices . , ? . ? , . ? , , , . : - . , -- best practices , , β€” . .



UIElements UI, IMGUI , , . , , , UIElements , β€” UIElements . , , .



, , . UGUI, . . Figma, Unity, . , Figma flexbox, CSS , . USS CSS , , . Unity UIBuilder. UIElements inlined styles, UXML. , . . . , , . , , , UGUI.



, . DOTween Pro , , 2D , DOTween.

2020.1 , DOTween’, c . UIToolkitUnityRoyaleRuntimeDemo:



public void AnimatedScale(float endScale, float tweenDuration)
        {
            experimental.animation
               .Scale(endScale, Mathf.RoundToInt(tweenDuration * 1000))  
               .Ease(Easing.OutQuad);
        }

       public void MoveTo(Vector2 screenPosition)
        {
            transform.position = 
              new Vector3(
                 screenPosition.x, 
                 screenPosition.y, 
                 transform.position.z);
        }

       public void AnimatedMoveTo(Vector2 endPosition, float tweenDuration)
        {
            experimental.animation
                .Position(
                    new Vector3(
                        endPosition.x, 
                        endPosition.y, 
                        transform.position.z),
            Mathf.RoundToInt(tweenDuration * 1000)).Ease(Easing.OutQuad);
        }


Listview UIElements β€” , . UGUI β€œ ” , EnhancedScroller, . , .

. , . , EventSystem Event Generation: Read Input ( ) IMGUI Events.



gambar

Read Input Listview , .. ProcessMouseEvents() UIElementsEventSystem . IMGUI Events . , . , Unity Technologies.



. -. , CSS , . . VisualElement , UIBuilder. , , inlined , , β€” . , . , . . UIElements , .



, β€” , . , , Unity UIElements.



, , Unity. , . Windows WebGL, , . - UIElements . , . , , .





, UIElements , .. , Google, , Unity .



, , ?



gambar

Unity Forum.



, UIElements PC , , UIElements. β€œβ€ , , UGUI.




All Articles