Skip to content

Instantly share code, notes, and snippets.

Avatar

Garry Newman garrynewman

View GitHub Profile
View Soreboard.cs
using Sandbox;
using Sandbox.Hooks;
using Sandbox.UI;
using Sandbox.UI.Construct;
using System;
using System.Collections.Generic;
namespace Sandbox.UI
{
View VirtualScroll.cs
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace Facepunch
{
public class VirtualScroll : MonoBehaviour
{
View TimeUntilExample.cs
TimeUntil timeUntilBurp;
void Update()
{
if ( timeUntilBurp <= 0 )
{
Burp();
timeUntilBurp = 5;
}
}
View TimeUntil.cs
public struct TimeUntil
{
float time;
public static implicit operator float( TimeUntil ts )
{
return ts.time - Time.time;
}
public static implicit operator TimeUntil( float ts )
View CreateNewMission.cs
using UnityEngine;
using UnityEditor;
public class CreateNewMission : EditorWindow
{
string MissionName = "Mission Name";
string FolderName = "MissionName";
void OnGUI()
{
View ScreenshotCamera.cs
using UnityEngine;
using System;
public class ScreenshotCamera
{
static Vector3 FocusPoint;
static float Aperture = 20.0f;
RealTimeSince timeSinceMessage;
string MessageText;
View SteamAvatar.cs
using UnityEngine;
using Facepunch.Steamworks;
using UnityEngine.UI;
//
// To change at runtime set SteamId then call Fetch()
//
public class SteamAvatar : MonoBehaviour
{
public ulong SteamId;
View gist:7ac9a67a4541be6c6563
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;
View gist:50ac0f22fb4588cf739b
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 );