Skip to content

Instantly share code, notes, and snippets.

@unitycoder
unitycoder / LineDrawer.cs
Created November 5, 2021 20:09
Drawing a line with Unity UI Toolkit
// Drawing a line with UITK https://forum.unity.com/threads/drawing-a-line-with-uitk.1193470/
public class LineDrawer : VisualElement
{
private Vector3 startPos, endPos;
private float thickness;
public LineDrawer(Vector3 pos1, Vector3 pos2, float width)
{
startPos = pos1;
endPos = pos2;
@mob-sakai
mob-sakai / ComponentConverter.cs
Created November 29, 2017 02:19
Component converter for Unity
#if UNITY_EDITOR
using UnityEngine;
using UnityEditor;
/// <summary>
/// Component converter for editor.
/// </summary>
public static class ComponentConverter
{
//%%%% v Context menu for editor v %%%%