Skip to content

Instantly share code, notes, and snippets.

using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using CraftingLegends.Framework;
using CraftingLegends.Core;
using System;
using CraftingLegends.ExtendedFramework;
/// <summary>
/// short example class showing how you can adapt to user switching control scheme
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public static class ListExtensions
{
public static T PickRandom<T>(this IList<T> source)
{
if (source.Count == 0)
return default(T);
@talecrafter
talecrafter / Open.bat
Created March 5, 2014 13:05
Windows batch file that opens Unity project and C# solution
@echo off
:: find first filename with *csharp.sln
FOR %%F IN (*csharp.sln) DO (
set filename=%%F
goto filenamefound
)
:: no csharp solution found, skip to opening unity
goto openunity
@talecrafter
talecrafter / AtlasFileRenamer.cs
Last active December 29, 2015 10:19
Unity3D Editor Script that renames .atlas files on import to .atlas.txt. Put this script in an "Editor" subfolder.
using UnityEngine;
using UnityEditor;
using System.IO;
/// <summary>
/// editor script that renames imported .atlas files to .atlas.txt files
/// </summary>
public class AtlasFileRenamer : AssetPostprocessor
{
static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)