Skip to content

Instantly share code, notes, and snippets.

@Gerndal
Gerndal / SkinnedMeshUpdater.cs
Created June 11, 2020 02:35 — forked from tsubaki/SkinnedMeshUpdater.cs
update SkinnedMesh
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.Assertions;
using System;
public class SkinnedMeshUpdater : MonoBehaviour
{
[SerializeField]
SkinnedMeshRenderer original;
@Gerndal
Gerndal / GpuDetection.cs
Created May 22, 2020 05:14 — forked from davidfoster/GpuDetection.cs
GPU Detection and Auto Quality Designation in Unity
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
[InitializeOnLoad]
#endif
@Gerndal
Gerndal / KalmanFilterFloat.cs
Created May 22, 2020 04:07 — forked from davidfoster/KalmanFilterFloat.cs
Simple Kalman filtering in Unity.
using System.Collections.Generic;
/// <summary>A Kalman filter implementation for <c>float</c> values.</summary>
public class KalmanFilterFloat {
//-----------------------------------------------------------------------------------------
// Constants:
//-----------------------------------------------------------------------------------------
public const float DEFAULT_Q = 0.000001f;
@Gerndal
Gerndal / UVTransform.shader
Created January 16, 2020 10:50 — forked from mattatz/UVTransform.shader
Example of uv transform shader for Unity.
Shader "Mattatz/UVTransform" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_TexScale ("Scale of Tex", Float) = 1.0
_TexRatio ("Ratio of Tex", Float) = 1.0
_Theta ("Rotation of Tex", Float) = 0.0
_PlaneScale ("Scale of Plane Mesh", Vector) = (1, 1, 0, 0)
}
@Gerndal
Gerndal / UVTransform.shader
Created January 16, 2020 10:50 — forked from mattatz/UVTransform.shader
Example of uv transform shader for Unity.
Shader "Mattatz/UVTransform" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_TexScale ("Scale of Tex", Float) = 1.0
_TexRatio ("Ratio of Tex", Float) = 1.0
_Theta ("Rotation of Tex", Float) = 0.0
_PlaneScale ("Scale of Plane Mesh", Vector) = (1, 1, 0, 0)
}
@Gerndal
Gerndal / ReplaceTextForTextMeshPro.cs
Created January 15, 2020 08:22 — forked from brunomikoski/ReplaceTextForTextMeshPro.cs
Replace all Text instances for TextMeshPROUGUI ones
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using TMPro;
using UnityEngine.UI;
public class ReplaceFont
@Gerndal
Gerndal / ReplaceTextForTextMeshPro.cs
Created January 15, 2020 08:22 — forked from brunomikoski/ReplaceTextForTextMeshPro.cs
Replace all Text instances for TextMeshPROUGUI ones
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using TMPro;
using UnityEngine.UI;
public class ReplaceFont
@Gerndal
Gerndal / Flashlight.mm
Created October 16, 2019 10:20 — forked from ddutchie/Flashlight.mm
Native Flash Light Controller for Unity3D and iOS
#import <AVFoundation/AVFoundation.h>
extern "C" {
void _EnableFlashlight(bool enable) {
AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
if ([device hasTorch]) {
[device lockForConfiguration:nil];
[device setTorchMode:enable ? AVCaptureTorchModeOn : AVCaptureTorchModeOff];
[device unlockForConfiguration];
@Gerndal
Gerndal / EditorCoroutine.cs
Created January 31, 2019 05:59 — forked from benblo/EditorCoroutine.cs
EditorCoroutine: coroutines for Unity editor operations. Usage: EditorCoroutine.start(myIEnumerator)
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using Object = UnityEngine.Object;
namespace Swing.Editor
{
public class EditorCoroutine
@Gerndal
Gerndal / unity.gradle
Created July 19, 2017 07:12 — forked from mattak/unity.gradle
build.gradle for unity
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.8.+'
classpath 'com.deploygate:gradle:0.5'
}
}