Skip to content

Instantly share code, notes, and snippets.

@goodmorningcmdr
goodmorningcmdr / SteamQueryBatchKey.js
Created October 23, 2023 19:44 — forked from petersvp/SteamQueryBatchKey.js
Batch Query Steam Keys for activation on SteamWorks
// 1. GO TO SteamWorks, into the Query CD Key page, here: https://partner.steamgames.com/querycdkey/
// 2. Fill in your keys below:
// 3. Go to DevTools, Console, and paste all of this here there!
// 4. Report will be printed to the console.
keys = `
0ZQR4-N0H7K-AEJ77
D05V5-P47AP-4ET3Q
GGJZ5-ZN0BR-F74C5
FWZP4-2IXHB-GYV3A
using UnityEngine;
public static class SmootherTime {
public static float deltaTime() {
return (1 - Mathf.Exp( -20 * Time.deltaTime));
}
public static float unscaledDeltaTime() {
return (1 - Mathf.Exp( -20 * Time.unscaledDeltaTime));
}
@goodmorningcmdr
goodmorningcmdr / GlobalFog.cs
Created February 11, 2017 13:20
change to standard assets global fog to use a texture instead of a color
using System;
using UnityEngine;
namespace UnityStandardAssets.ImageEffects
{
[ExecuteInEditMode]
[RequireComponent (typeof(Camera))]
[AddComponentMenu ("Image Effects/Rendering/Global Fog")]
class GlobalFog : PostEffectsBase
{
@goodmorningcmdr
goodmorningcmdr / GameSound.cs
Created February 11, 2017 13:10
sound pooler
using UnityEngine;
using System.Collections.Generic;
public class GameSound : MonoBehaviour
{
public float age = 0;
protected AudioClip _clip;
protected AudioSource _source;
public static List<GameSound> _pool;
using UnityEngine;
using System;
[DisallowMultipleComponent]
public class TakeScreenshot: MonoBehaviour {
public static int startNumber = 1;
[Space(10)]
public KeyCode screenshotKey = KeyCode.F6;
@goodmorningcmdr
goodmorningcmdr / CustomGradient.shader
Created July 15, 2016 01:00
Simple unlit gradient shader.
Shader "Custom/Gradient" {
Properties {
_direction("Direction", Range(0, 1)) = 0
_color1 ("Color 1", Color) = (1, 0.5, 0.5, 1)
_color2 ("Color 2", Color) = (0.5, 1, 1, 1)
}
SubShader {
Pass {
CGPROGRAM
#pragma vertex vert
@goodmorningcmdr
goodmorningcmdr / ReorderComponents.cs
Last active January 31, 2023 14:17
script to reorder components on a game object.
using UnityEngine;
using System.Collections;
using UnityEditor;
using System.Reflection;
using System.Collections.Generic;
[InitializeOnLoad]
[ExecuteInEditMode]
public class ReorderComponents : EditorWindow {
@goodmorningcmdr
goodmorningcmdr / FollowSceneViewCamera.cs
Created July 15, 2016 00:45
Main camera will follow scene camera rotation/position then return to its previous position/rotation.
#if UNITY_EDITOR
using UnityEngine;
using UnityEditor;
using System.Collections;
[ExecuteInEditMode]
public class FollowSceneViewCamera : Editor {
static bool follow = false;
static Camera followCam = null;
static Vector3 previousPos, previousRot;
@goodmorningcmdr
goodmorningcmdr / RemoveOrigFiles.cs
Created July 15, 2016 00:41
Generated .orig files can be useful, but mostly end up as clutter.
using UnityEngine;
using UnityEditor;
public class RemoveOrigFiles : Editor {
[MenuItem("Tools/Remove orig files")]
static void RemoveEm() {
Debug.Log("Moving all .orig files to trash");
string[] guids = AssetDatabase.FindAssets("");
foreach (string guid in guids)
{
@goodmorningcmdr
goodmorningcmdr / ClearPlayerPrefs.cs
Created July 15, 2016 00:37
Menu item to delete player prefs.
using UnityEngine;
using UnityEditor;
public class ClearPlayerPrefs.cs : Editor {
[MenuItem("Tools/Clear PlayerPrefs")]
static void ClearPrefs() {
Debug.Log("Clearing PlayerPrefs");
PlayerPrefs.DeleteAll();
}
}