Skip to content

Instantly share code, notes, and snippets.

@keiranlovett
keiranlovett / ExportPBRTextures.jsx
Last active August 29, 2015 14:27 — forked from GetUpKidAK/ExportTextures.jsx
Photoshop script to export textures from layered PSD
// Enables exporting of several PBR maps from a single PSD with a few clicks:
// 1. Select an export folder (default to PSD path on Windows)
// 2. Choose which PSD layer group corresponds to which map (split into separate RGB/Alpha channels)
// 3. Change the file export options (if required)
// 4. Hit export.
#target photoshop
app.bringToFront();
// DEFAULT EXPORT OPTIONS
Shader "Custom/Skybox RGBM HDR Linear" {
Properties {
_Cubemap ("Cubemap", Cube) = "white" {}
_Exposure ("Exposure", Float) = 20.0
}
SubShader {
Tags { "Queue"="Background" "RenderType"="Background" }
Cull Off
ZWrite Off
using UnityEngine;
using System.Collections;
public class CameraOrbit : MonoBehaviour
{
public float angularSpeed = 180;
public float zoomSpeed = 1;
public float sensibility = 6;
Vector2 prevMousePosition;
@keiranlovett
keiranlovett / NoClipMouseLook.cs
Created August 18, 2015 07:48
NoClipMouseLook
using UnityEngine;
using System.Collections;
public class NoClipMouseLook : MonoBehaviour {
public float sensitivityX = 8F;
public float sensitivityY = 8F;
float mHdg = 0F;
float mPitch = 0F;
@keiranlovett
keiranlovett / Settings.cs
Created August 17, 2015 02:53
Unity: Player Settings
using UnityEngine;
public static class Settings
{
#region Constant Variables
/// <summary>
/// The Name of the Player
/// </summary>
/// <remarks>This defaults to null, so that if you wish to display something else, you may.</remarks>
@keiranlovett
keiranlovett / extensions.cs
Created August 17, 2015 01:34
Unity: Extensions
using UnityEngine;
using System.Collections;
using System;
public static class Extensions
{
//
// MonoBehaviour
@keiranlovett
keiranlovett / UnbreakableCollider.cs
Created August 17, 2015 01:25
Unity: Stupid Simple Tron
using UnityEngine;
using System.Collections;
public class UnbreakableCollider : MonoBehaviour
{
public Transform DotPrefab;
Vector3 lastDotPosition;
bool lastPointExists;
void Update()
{
@keiranlovett
keiranlovett / vehicleManager.cs
Last active December 5, 2016 03:50
For use with VisionPunks Ultimate First Person Shooter. This is an extension of vp_Interactable that allows players to board interactive items - such as computer terminals or vehicles via input. The script allows for different 'seat' positions and permissions Check for the method InputInteract() in the vp_FPInput class.
/////////////////////////////////////////////////////////////////////////////////
//
// Vehiclemanager.cs
// https://twitter.com/keiranlovett
// http://www.keiranlovett.com
//
// Description: This is an extension of vp_Interactable that allows players
// to board interactive items - such as computer terminals or
// vehicles via input. The script allows for different 'seat'
// positions and permissions Check for the method InputInteract()
@keiranlovett
keiranlovett / CrossHair
Created June 18, 2014 12:59
Unity: Crosshair
using UnityEngine;
using System.Collections;
public class CrossHair : MonoBehaviour {
// Use this for initialization
public enum preset { none, shotgunPreset, crysisPreset }
public preset crosshairPreset = preset.none;
@keiranlovett
keiranlovett / wkwstatus
Created June 18, 2014 12:05
Scrolling GUI Status (Who Killed Who)
import System.Collections.Generic;
import System.Linq;
import System;
class Message
{
//Holds the messages being displayed
static var messages : List.<Message> = new List.<Message>();
//Holds the messages waiting for display
static var queue : List.<Message> = new List.<Message>();