Skip to content

Instantly share code, notes, and snippets.

using System;
namespace Example
{
public struct Mass : IComparable<Mass>, IEquatable<Mass>
{
#region Constants
public static readonly Mass MinValue = new Mass { Ticks = long.MinValue };
public static readonly Mass MaxValue = new Mass { Ticks = long.MaxValue };
public static readonly Mass Zero;
@LegoCylon
LegoCylon / AssetsDuplicateMenuItem.cs
Created September 4, 2018 01:11
Adds a Duplicate menu option to the Assets menu.
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
public static class AssetsDuplicateMenuItem {
//--------------------------------------------------------------------------------------------------------------
// Constants
//--------------------------------------------------------------------------------------------------------------
private const string c_menuName = "Assets/Duplicate";
@LegoCylon
LegoCylon / CommentNode.cs
Last active August 15, 2018 03:23
Demonstrates how to add documentation to Unity's ShaderGraph system
using UnityEngine;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph;
[Title("Utility", "Comment")]
public class CommentNode : AbstractMaterialNode {
[SerializeField]
private string m_comment = string.Empty;