Unity/게임 개발 스터디

게임 개발 스터디 12 : Tool에 SO 파일 적용, tap 메뉴 생성

sorry0101 2022. 11. 1. 13:46

아직..

 

 

button 연결

public void CreateGUI()
    {
        // Each editor window contains a root VisualElement object
        var root = rootVisualElement;

        // // Import UXML
        var visualTree = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>("Assets/Character/Editor/CharacterBuilder.uxml");
        VisualElement labelFromUXML = visualTree.Instantiate();
        root.Add(labelFromUXML);

		// 생성한 visualElement로 하는 것이었음..
        var button = labelFromUXML.Q<Button>("CreateButton");

        button.clickable.clicked += () => Debug.Log("Clicked");
    }

성공


참고

https://forum.unity.com/threads/how-to-display-a-scriptableobject-using-uitoolkit.1342436/

 

Question - How to display a ScriptableObject using UIToolkit

Previously I have been using Editor.CreateEditor + editor.OnInspectorGUI to display a scriptable object inside an IMGUIContainer. I'm looking to...

forum.unity.com

https://docs.unity3d.com/Manual/UIE-create-tabbed-menu-for-runtime.html

 

Unity - Manual: Create a tabbed menu for runtime

Create a drag-and-drop UI to drag between Editor windows Create a tabbed menu for runtime Version: 2021.3+ Tabbed menus are common in video games and application UI(User Interface) Allows a user to interact with your application. Unity currently supports t

docs.unity3d.com

 

이미지 미리보기
https://zergling.tistory.com/22?category=888486

 

https://forum.unity.com/threads/ui-builder-how-to-make-buttons-interactable.786701/

 

[UI Builder] How to make buttons interactable?

Hello, I am using UI Builder. I would like the functionality where the buttons Tab1, Tab2, Tab3 can be selected (only 1 of them at a time) and...

forum.unity.com

https://www.youtube.com/watch?v=9gscwiS3xsU