Skip to content

Instantly share code, notes, and snippets.

View garrynewman's full-sized avatar

Garry Newman garrynewman

View GitHub Profile
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
public class FileSystem_AssetBundles : IFileSystem
{
public static bool isError = false;
public static string loadingError = "";
public static FileSystem_AssetBundles Instance = null;
@garrynewman
garrynewman / gist:50ac0f22fb4588cf739b
Created May 18, 2015 15:01
Asset bundle building
public static void Build( string strPath, BuildTarget target )
{
if ( !System.IO.Directory.Exists( strPath ) )
System.IO.Directory.CreateDirectory( strPath );
AssetBundleBuild[] existingBundles = AssetDatabase.GetAllAssetBundleNames().Select( x => new AssetBundleBuild() { assetBundleName = x, assetBundleVariant = "", assetNames = AssetDatabase.GetAssetPathsFromAssetBundle( x ) } ).ToArray();
EditorUtility.DisplayProgressBar( "SplitContent", "", 0 );
var newBundles = SplitContent( existingBundles );
using UnityEngine;
using UnityEditor;
public class CreateNewMission : EditorWindow
{
string MissionName = "Mission Name";
string FolderName = "MissionName";
void OnGUI()
{
public struct TimeUntil
{
float time;
public static implicit operator float( TimeUntil ts )
{
return ts.time - Time.time;
}
public static implicit operator TimeUntil( float ts )
TimeUntil timeUntilBurp;
void Update()
{
if ( timeUntilBurp <= 0 )
{
Burp();
timeUntilBurp = 5;
}
}
using UnityEngine;
using System;
public class ScreenshotCamera
{
static Vector3 FocusPoint;
static float Aperture = 20.0f;
RealTimeSince timeSinceMessage;
string MessageText;
using UnityEngine;
using Facepunch.Steamworks;
using UnityEngine.UI;
//
// To change at runtime set SteamId then call Fetch()
//
public class SteamAvatar : MonoBehaviour
{
public ulong SteamId;
using Sandbox;
using Sandbox.Hooks;
using Sandbox.UI;
using Sandbox.UI.Construct;
using System;
using System.Collections.Generic;
namespace Sandbox.UI
{
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace Facepunch
{
public class VirtualScroll : MonoBehaviour
{