mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
Initial commit
This commit is contained in:
commit
3c7cc0c973
8391 changed files with 704313 additions and 0 deletions
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
using UnityEditor.U2D.Animation;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
namespace UnityEditor.U2D.Layout
|
||||
{
|
||||
internal static class LayoutOverlayUtility
|
||||
{
|
||||
public static Button CreateButton(string name, Action clickEvent, string tooltip = null, string text = null, string imageResourcePath = null, string stylesheetPath = null)
|
||||
{
|
||||
Button button = new Button(clickEvent);
|
||||
button.name = name;
|
||||
button.tooltip = tooltip;
|
||||
|
||||
if (!String.IsNullOrEmpty(text))
|
||||
button.text = text;
|
||||
if (!String.IsNullOrEmpty(imageResourcePath))
|
||||
{
|
||||
var texture = ResourceLoader.Load<Texture>(imageResourcePath);
|
||||
if (texture != null)
|
||||
{
|
||||
Image image = new Image();
|
||||
image.image = texture;
|
||||
button.Add(image);
|
||||
}
|
||||
}
|
||||
if (!String.IsNullOrEmpty(stylesheetPath))
|
||||
button.styleSheets.Add(ResourceLoader.Load<StyleSheet>(stylesheetPath));
|
||||
|
||||
return button;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue