Skip to content

Instantly share code, notes, and snippets.

@prime31
prime31 / prime[31] + Vuforia
Last active September 8, 2016 17:50
Activity override system that will work with Vuforia. Note that this is provided as-is and we do not provide support for working with Vuforia.
- download the jar file from here: https://mega.co.nz/#!pd81gYBA!ui33ktU2xDqmcsYOv5oSZ6v-niPp1ofwh02naT7Vqbs Note that anytime you import any other plugins make sure that file doesn't get overwritten!
- overwrite the file with the same name in the Plugins/Android folder with the downloaded jar
- generate an AndroidManifest.xml file
- add the required permissions for Vuforia to the generated AndroidManifest.xml (see their docs for the details)
@mattbenic
mattbenic / SpecificInstanceOfGameExample.cs
Last active June 11, 2023 14:40
Example of using Win32 API to get specific window instance in Unity. This is useful for when running multiple instances of the same application, as the window handle can then be used to correctly position and size the different windows for multi screen use.
using UnityEngine;
using System;
using System.Runtime.InteropServices;
using System.Text;
public class SpecificInstanceOfGameExample : MonoBehaviour
{
#region DLL Imports
private const string UnityWindowClassName = "UnityWndClass";
Shader "Custom/yar" {
Properties {
_ColorLow ("Color Low", COLOR) = (1,1,1,1)
_ColorHigh ("Color High", COLOR) = (1,1,1,1)
_yPosLow ("Y Pos Low", Float) = 0
_yPosHigh ("Y Pos High", Float) = 10
_GradientStrength ("Graident Strength", Float) = 1
_EmissiveStrengh ("Emissive Strengh ", Float) = 1
_ColorX ("Color X", COLOR) = (1,1,1,1)
_ColorY ("Color Y", COLOR) = (1,1,1,1)
@Fonserbc
Fonserbc / Easing.cs
Last active August 27, 2024 23:41
Compact and simple easing functions for Unity
using UnityEngine;
/*
* Most functions taken from Tween.js - Licensed under the MIT license
* at https://github.com/sole/tween.js
* Quadratic.Bezier by @fonserbc - Licensed under WTFPL license
*/
public delegate float EasingFunction(float k);
public class Easing
@simonbroggi
simonbroggi / TouchScriptInputModule.cs
Last active May 7, 2024 09:16
Input Module to use the new unity ui with multitouch from https://github.com/TouchScript
/**
* Input Module to use the new unity ui with multitouch from https://github.com/TouchScript
* Install TouchScript in your unity project, then add an EventSystem and replace the InputModules by this one.
*
*
* Basically modified TouchInputModule from
* https://bitbucket.org/Unity-Technologies/ui/src/5fc21bb4ecf4b40ff6630057edaa070252909b2e/UnityEngine.UI/EventSystem/InputModules/TouchInputModule.cs?at=4.6
* and changing ProcessTouchEvent to take events from TouchScript
*
* Got the TouchScript stuff from
@benhysell
benhysell / WebApiPostWithProgress.cs
Last active February 13, 2024 16:51
c# web api post with progress reporting
//in setup define client and progress reporter
var httpProgressHandler = new ProgressMessageHandler();
httpProgressHandler.InnerHandler = new HttpClientHandler();
var client = new HttpClient(httpProgressHandler) { BaseAddress = new Uri(Settings.Default.ServerUrl) };
//register to use elsewhere in the application, note it is better to resuse for lifetime of application than create for every call
Mvx.RegisterSingleton(client);
Mvx.RegisterSingleton(httpProgressHandler);
@Scapal
Scapal / tree-node.css
Created March 16, 2016 21:23
Aurelia Bootstrap Tree
.treeview .list-group-item {
cursor: pointer;
}
.treeview span.indent {
margin-left: 10px;
margin-right: 10px;
}
.treeview span.icon {
@nemotoo
nemotoo / .gitattributes
Last active October 14, 2024 00:03
.gitattributes for Unity3D with git-lfs
## Unity ##
*.cs diff=csharp text
*.cginc text
*.shader text
*.mat merge=unityyamlmerge eol=lf
*.anim merge=unityyamlmerge eol=lf
*.unity merge=unityyamlmerge eol=lf
*.prefab merge=unityyamlmerge eol=lf
@juanarzola
juanarzola / ChangeType.cs
Last active October 6, 2016 08:44
UniRx observable wrappers for Entitas entity and group events
using System;
namespace Entitas {
/** Used in the *AnyChangeObservable methods to observe multiple change types */
[Flags]
public enum ChangeType : short{
Addition = 1 << 0,
Replacement = 1 << 1,
Removal = 1 << 2,
@ThePhiMa
ThePhiMa / Blend Add Particle.shader
Created August 18, 2016 12:45
Blend Add Shader (as used in Diablo 3)
// Blend Add Shader (as used in Diablo 3)
// Uses the alpha channel to determine if the pixel needs to be blended additively or by transparency.
// Is a good way prevent the additive buildup that makes a scene with a lot of particle effects white and unreadable while still having some particle texture features.
// Idea by Julian Love - http://www.gdcvault.com/play/1017660/Technical-Artist-Bootcamp-The-VFX
Shader "Custom/Blend Add Particle Test"
{
Properties
{
_MainTex("Base (RGB) Trans (A)", 2D) = "white" {}
_BlendThreshold("Blend Treshold (0.0:Additive, 1.0:Trasparency)", Range(0.0, 1.0)) = 0.5