Skip to content

Instantly share code, notes, and snippets.

using UnityEngine;
using System.Collections;
public class PhotonCam : MonoBehaviour
{
public float speed = 10;
public float rayLength = 0.3f;
public int gizmoReflections = 10;
@nothke
nothke / SReader.cs
Last active July 7, 2016 13:36
Simple text reader for lists
using UnityEngine;
using System.Collections.Generic;
using System.IO;
public class SReader
{
public static string[] GetLines(string path, string key)
{
if (!File.Exists(path))
Debug.LogWarning("SReader: File named " + path + " doesn't exist");
//
// ParticleSystem extensions for changes introduced in Unity 5.3
// by Nothke, unlicensed
//
// Each module in ParticleSystem in Unity 5.3 is now a struct,
// which makes setting some simple stuff more cumbersome
// These extensions provide shortcuts to simplify those tasks
//
// For example: setting constant emission rate now takes 3 lines at minimum,
// rather than a single line like before.
using UnityEngine;
[ExecuteInEditMode]
public class Darken : MonoBehaviour
{
Material mat;
void Start()
{
//GetComponent<Camera>().depthTextureMode = DepthTextureMode.Depth;
Shader "Custom/FlatShading"
{
Properties
{
_Color("Color", Color) = (1,0,0,1)
}
SubShader
{
///
/// Placas objects dynamically around the player
/// by Nothke
///
/// unlicensed, aka do whatever you want with it
///
using UnityEngine;
using System.Collections.Generic;
using UnityEngine;
using System.Collections;
public class PreviewPerlin : MonoBehaviour
{
public int samples = 5000;
public float previewLength = 10;
public float xValue = 1;
using UnityEngine;
using System.Collections;
using UnityEditor;
[CustomEditor(typeof(ContextDummy))]
public class ContextDummyEditor : Editor
{
Event prevMouseEvent;
bool contextIsOpen;
x = 64
y = 64
r = 20
sunz = 10
nmap = {}
cmap = {}
interleave = 1
using UnityEngine;
public class FlyCam : MonoBehaviour
{
public float speed = 1;
public float mouseScrollAccel = 2;
public bool localRotation;