Skip to content

Instantly share code, notes, and snippets.

@hasanbayatme
hasanbayatme / DrawLine2D.cs
Last active January 16, 2025 05:35
Unity (Game Engine) Line Drawing with mouse using Line Renderer. Useful for painting, drawing 2d physics lines.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DrawLine2D : MonoBehaviour
{
[SerializeField]
protected LineRenderer m_LineRenderer;
[SerializeField]
@luke161
luke161 / TreeNode.cs
Created May 11, 2017 10:10
Simple tree data structure for use with C# and Unity. Start with a root TreeNode and add children as required.
/**
* TreeNode.cs
* Author: Luke Holland (http://lukeholland.me/)
*/
using System;
using System.Collections.Generic;
public class TreeNode<T>
{