Skip to content

Instantly share code, notes, and snippets.

View SimonDarksideJ's full-sized avatar

Simon (Darkside) Jackson SimonDarksideJ

View GitHub Profile
@boj
boj / SimplexNoise.cs
Created February 7, 2012 14:14
Stefan Gustavson's "Simplex noise demystified" in C# + Unity3d Mathf methods.
using UnityEngine;
using System.Collections;
// copied and modified from http://webstaff.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
public class SimplexNoise { // Simplex noise in 2D, 3D and 4D
private static int[][] grad3 = new int[][] {
new int[] {1,1,0}, new int[] {-1,1,0}, new int[] {1,-1,0}, new int[] {-1,-1,0},
new int[] {1,0,1}, new int[] {-1,0,1}, new int[] {1,0,-1}, new int[] {-1,0,-1},
new int[] {0,1,1}, new int[] {0,-1,1}, new int[] {0,1,-1}, new int[] {0,-1,-1}};
@robfe
robfe / TileCanvas.cs
Created June 27, 2012 21:05
Tilebrush equivalent for WinRT XAML apps.
public class TileCanvas : Canvas
{
public static readonly DependencyProperty ImageSourceProperty = DependencyProperty.Register("ImageSource", typeof(ImageSource), typeof(TileCanvas), new PropertyMetadata(null, ImageSourceChanged));
private Size lastActualSize;
public TileCanvas()
{
LayoutUpdated += OnLayoutUpdated;
}
@dotMorten
dotMorten / HttpGZipClientHandler.cs
Last active May 8, 2018 19:38
GZip support for PCL HttpClient. Create HttpClient using: HttpClient client = new HttpClient(new HttpGZipClientHandler());
using System.IO;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading;
using System.Threading.Tasks;
namespace SharpGIS.Http
{
public class HttpGZipClientHandler : HttpClientHandler
{
@stramit
stramit / ControllerInputModule.cs
Last active December 27, 2018 18:20
ControllerInputModule.cs
using UnityEngine;
using UnityEngine.EventSystems;
[AddComponentMenu("Event/Controller Input Module")]
public class ControllerInputModule : BaseInputModule
{
private float m_NextAction;
protected ControllerInputModule()
{}
@flarb
flarb / VRInputModule.cs
Created August 20, 2014 22:27
Lets you use a VR world space cursor with World Space Canvases in Unity3D 4.6. Add this to the EventSystem object. Put some box colliders on your buttons in the World Space Canvas. Then, do a trace to see if you're looking at a menu object--if the trace hits one of those buttons, pass it to SetTargetObject. See ralphbarbagallo.com for a longer e…
using UnityEngine;
using UnityEngine.EventSystems;
//by Ralph Barbagallo
//www.flarb.com
//www.ralphbarbagallo.com
//@flarb
public class VRInputModule : BaseInputModule {
anonymous
anonymous / ToolTip
Created January 28, 2015 18:24
//ToolTip is written by Emiliano Pastorelli, H&R Tallinn (Estonia), http://www.hammerandravens.com
//Copyright (c) 2015 Emiliano Pastorelli, H&R - Hammer&Ravens, Tallinn, Estonia.
//All rights reserved.
//Redistribution and use in source and binary forms are permitted
//provided that the above copyright notice and this paragraph are
//duplicated in all such forms and that any documentation,
//advertising materials, and other materials related to such
//distribution and use acknowledge that the software was developed
//by H&R, Hammer&Ravens. The name of the
@DashW
DashW / ScreenRecorder.cs
Last active July 21, 2024 13:29
ScreenRecorder - High Performance Unity Video Capture Script
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Threading;
class BitmapEncoder
{
public static void WriteBitmap(Stream stream, int width, int height, byte[] imageData)
@phosphoer
phosphoer / SimpleGeo.cs
Last active June 11, 2024 16:16
Simple Geometry Painter for Unity
// The MIT License (MIT)
// Copyright (c) 2016 David Evans @phosphoer
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
@mfrederickson
mfrederickson / end.gcode
Last active January 10, 2024 12:07
anet a8 start/end gcode
M104 S0 ; turn off extruder
M140 S0 ; turn off heatbed
M107 ; turn off fan
G91 ; relative positioning
G1 Z25 ; raise head 25mm
G90 ; back to absolute positioning
G1 X0 Y220; home X axis and push Y forward
M84 ; disable motors
@ruccho
ruccho / WolfAutoTile.cs
Created February 17, 2018 10:28
An extension for Unity Tilemap.(Compatible with animation)
using System;
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace UnityEngine.Tilemaps
{
[Serializable]
public class WolfAutoTile : TileBase