Skip to content

Instantly share code, notes, and snippets.

View ddutchie's full-sized avatar

Gerard Slee ddutchie

  • Tenebris Lab (PTY) LTD
  • Cape Town, South Africa
View GitHub Profile
@andreiagmu
andreiagmu / FastPlatformSwitcherSymlink_Windows.cs
Last active June 19, 2024 07:26
Improved FastPlatformSwitcher for Unity 2018 (and maybe other Unity versions), for Asset Database v1 - Symlink version (for Windows systems)
@andreiagmu
andreiagmu / FastPlatformSwitcher.cs
Last active June 19, 2024 07:26
Improved FastPlatformSwitcher for Unity 2018 (and maybe other Unity versions), for Asset Database v1
// Improved FastPlatformSwitcher for Unity 2018 (and maybe other Unity versions)
// For Asset Database v1
// by Andy Miira (Andrei Müller), October 2019
//
// Based on:
// Unity – fast build platform switcher script! (by Aymeric - Da Viking Code)
// https://davikingcode.com/blog/unity-fast-build-platform-switcher-script/
//
// A simple fast platform switcher for Unity (by Waldo Bronchart)
// https://gist.github.com/waldobronchart/b3cb789c028c199e2855
@unitycoder
unitycoder / AndroidManifest.xml
Last active March 30, 2024 19:39
Oculus Quest Android Manifest (with READ_EXTERNAL_STORAGE, LAUNCHER and SkipPermissionsDialog)
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="auto">
<uses-feature android:name="android.hardware.vr.headtracking" android:version="1" android:required="true" /><!-- Request the headset DoF mode -->
<application
android:label="@string/app_name"
android:icon="@mipmap/app_icon">
<activity
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
android:configChanges="locale|fontScale|keyboard|keyboardHidden|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"
@Vonflaken
Vonflaken / VirtualJoystick.cs
Last active June 1, 2021 02:36
Virtual joystick component for Unity mobile projects.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
#if UNITY_EDITOR && !UNITY_CLOUD_BUILD
using UnityEditor;
#endif
@munkbusiness
munkbusiness / Vibration.cs
Last active November 24, 2023 00:42
Vibration for Unity3d with Android native Call that supports both the new vibrationEffectClass and the old simple vibrate, with fallback to Handlheld.Vibrate().
using UnityEngine;
using System.Collections;
public class Vibration : MonoBehaviour {
public static AndroidJavaClass unityPlayer;
public static AndroidJavaObject vibrator;
public static AndroidJavaObject currentActivity;
public static AndroidJavaClass vibrationEffectClass;
public static int defaultAmplitude;
@luciditee
luciditee / BatchBurner.cs
Last active June 16, 2018 17:09
Batch Burner, a script designed to reduce static mesh draw calls in Unity scenes with a large number of static mesh entities.
/*
* Unity Batch Burner: A script designed to reduce static mesh draw calls automatically in scenes
* with a large amount of static geometry entities.
*
* Copyright 2016-2017 Will Preston & Die-Cast Magic Studios, LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@mrcarriere
mrcarriere / BuildSceneProcessor.cs
Last active June 7, 2021 12:58
Automatically add a scene to your Build Settings when you create or save the scene. Scenes that are ignored will not re-prompt for the current session.
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
// docs: https://docs.unity3d.com/ScriptReference/AssetModificationProcessor.OnWillSaveAssets.html
public class BuildSceneProcessor : UnityEditor.AssetModificationProcessor
{
private const string DIALOG_TITLE = "Add to Build Settings?";
private const string DIALOG_MSG = "Add to build settings for inclusion in future builds?";
@alexcmd
alexcmd / MeshCut.cs
Created December 29, 2015 08:29
Mesh cut algorithm for Unity
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class MeshCut
{
private static Plane blade;
private static Transform victim_transform;
private static Mesh victim_mesh;
// UnityからAndroidのCamera LEDを制御する例
// startPreview() でカメラのプレビューを開始した状態で LEDOn() で光る
public class AndroidCamera {
AndroidJavaObject camera = null;
public AndroidCamera() {
WebCamDevice[] devices = WebCamTexture.devices;
Debug.Log("Camera Name:"+devices[0].name);
using UnityEngine;
using UnityEditor;
using UnityEngine.UI;
using System.Collections;
using System.Linq;
[InitializeOnLoad]
public class HideShowCanvas : Editor
{
static HideShowCanvas()