Skip to content

Instantly share code, notes, and snippets.

@CorbyO
CorbyO / HiddenManager.cs
Created December 8, 2022 04:37
Unity Hidden asset manager
using System.Collections.Generic;
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;
public class HiddenManager : EditorWindow
{
private static SortedSet<string> _hiddenPaths;
@CorbyO
CorbyO / UnixTimeConvert.cs
Created December 8, 2022 03:19
C# UnixTime convert functions for DateTime
public static int ToUnixTime(this DateTime dateTime)
{
return (int)(dateTime - new DateTime(1970, 1, 1, 0, 0, 0)).TotalSeconds;
}
public static DateTime ToDateTime(this Int32 unixTime)
{
return new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc).AddSeconds(unixTime);
}
@CorbyO
CorbyO / GetAllMembers.cs
Last active December 8, 2022 03:21
C# GetAllMembers for Type
using System;
using System.Collections.ObjctModel;
using System.Reflection;
public static class TypeExtension
{
public static ReadOnlyCollection<MemberInfo> GetAllMembers(this Type type, int capacity = 50)
{
var temp = new List<MemberInfo>(capacity);
for(var t = type; t != null; t = t.BaseType)