Skip to content

Instantly share code, notes, and snippets.

View yoeven's full-sized avatar
🍁

Yoeven D Khemlani yoeven

🍁
View GitHub Profile
@yoeven
yoeven / SimpleCameraShake.cs
Created October 17, 2018 06:57
A simple camera shake that just shakes the camera from its current rotation and resets it back to its original location. Forked from http://wiki.unity3d.com/index.php/Camera_Shake
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SimpleCameraShake : MonoBehaviour
{
public static SimpleCameraShake Instance;
float shakeAmount;
float shakeDuration;
@yoeven
yoeven / postJSON.cs
Created October 1, 2018 07:31 — forked from manuerumx/postJSON.cs
Unity 3D example POST JSON Data to a Server with http Auth
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class goLevel : MonoBehaviour {
//With the @ before the string, we can split a long string in many lines without getting errors
private string json = @"{
'hello':'world',
'foo':'bar',
'count':25
@yoeven
yoeven / IconTypes.json
Created March 13, 2018 11:13
All popular and common file extensions categories by icons in JSON format.
{
"ExtensionReference":"https://www.computerhope.com/issues/ch001789.htm",
"IconsReference":"https://react.semantic-ui.com/elements/icon",
"Extensions": [
{
"Ext": [
"txt",
"md",
"tex",
"doc",
/*
* The following code is based of this thread: https://answers.unity.com/questions/798510/flat-shading.html
*
* This function flat shades any mesh.
*
*/
using UnityEngine;
@yoeven
yoeven / AutoWeld.cs
Last active January 30, 2018 15:47
A function to remove vertices that share the same position which is calculated by the distance between the two vertices and then compared to a threshold. Code is based of this thread: https://answers.unity.com/questions/228841/dynamically-combine-verticies-that-share-the-same.html
/*
* The following code is based of this thread: https://answers.unity.com/questions/228841/dynamically-combine-verticies-that-share-the-same.html
*
* This function gets rid of shared vertices that fall within the same threshold distance.
*
*/
using System.Collections;