Add VRChat and GitHub packages to Unity project
This commit is contained in:
1 parent
0334a52b21
commit
85538aaccc
3297 files changed
+847877
No files matched your search
+56
@@ -0,0 +1,56 @@
|
||||
using UnityEngine.Experimental.UIElements;
|
||||
|
||||
namespace VRC.Udon.Editor.ProgramSources.UdonGraphProgram.UI.GraphView
|
||||
{
|
||||
public class UdonProgramSourceView : VisualElement
|
||||
{
|
||||
private UdonProgramAsset _asset;
|
||||
|
||||
private VisualContainer _assemblyContainer;
|
||||
private ScrollView _scrollView;
|
||||
private Label _assemblyHeader;
|
||||
private TextElement _assemblyField;
|
||||
|
||||
public UdonProgramSourceView ()
|
||||
{
|
||||
// Create and add container and children to display latest Assembly
|
||||
_assemblyContainer = new VisualContainer() { name = "Container", };
|
||||
_assemblyHeader = new Label("Udon Assembly")
|
||||
{
|
||||
name = "Header",
|
||||
};
|
||||
|
||||
_scrollView = new ScrollView();
|
||||
|
||||
_assemblyField = new TextElement()
|
||||
{
|
||||
name = "AssemblyField",
|
||||
};
|
||||
|
||||
_assemblyContainer.Add(_assemblyHeader);
|
||||
_assemblyContainer.Add(_scrollView);
|
||||
_assemblyContainer.Add(_assemblyField);
|
||||
_scrollView.SetContents(_assemblyField);
|
||||
|
||||
Add(_assemblyContainer);
|
||||
}
|
||||
|
||||
public void LoadAsset(UdonGraphProgramAsset asset)
|
||||
{
|
||||
_asset = asset;
|
||||
}
|
||||
|
||||
public void SetText(string newValue)
|
||||
{
|
||||
_assemblyField.text = newValue;
|
||||
}
|
||||
|
||||
public void Unload()
|
||||
{
|
||||
if(_asset != null)
|
||||
{
|
||||
_asset = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user