Skip to content

Instantly share code, notes, and snippets.

View unitycoder's full-sized avatar
✅
‏‏‎

mika unitycoder

✅
‏‏‎
View GitHub Profile
@unitycoder
unitycoder / manifold-garden-world-wrap.txt
Last active November 20, 2017 04:28
Manifold Garden Endless World Wrapping
- world is inside cube
- project world to each cube inner plane
- if player exits plane, wrap to other side of cube
@unitycoder
unitycoder / phonegap-notes.txt
Created November 23, 2017 08:09
PhoneGap Simple App
- setup https://phonegap.com/getstarted/
-
@unitycoder
unitycoder / UnityShaderFFS.md
Created December 2, 2017 09:22 — forked from smkplus/UnityShaderCheatSheet.md
Controlling fixed function states from materials/scripts in Unity

16999105_467532653370479_4085466863356780898_n

Shader "MaterialPropertyDrawer"
{
Properties
{
_MainTex("Texture", 2D) = "white" {}
 
[HideInInspector] _MainTex2("Hide Texture", 2D) = "white" {}
@unitycoder
unitycoder / flash-md5-missing.txt
Created December 16, 2017 10:49
Flash Error Definition com.adobe.crypto:MD5 could not be found
"Scene 1, Layer 'code', Frame 2, Line 20, Column 24 1172: Definition com.adobe.crypto:MD5 could not be found."
File / ActionScript settings...
Add & Browse to folder where your com/ folder is
you can get MD5 library from:
https://github.com/mikechambers/as3corelib/tree/master/src/com/adobe/crypto
so your com/ folder contents are from that as3corelib:
../com/adobe/air/
@unitycoder
unitycoder / as3-create-text-file.as
Created December 16, 2017 12:05
Flash AS3 AIR : Create Plain Text File
// maybe need some other imports also, add if needed
import flash.filesystem.File;
import flash.filesystem.FileStream;
import flash.filesystem.FileMode;
// saves file to C:\Users\username\AppData\Roaming\APPID\Local Store\
var myfile:File = File.applicationStorageDirectory.resolvePath("hello.txt");
var mystring = "Hello World!";
// c# companion script
// SpriteUVToShader.cs -------------------------------------------------------------------------------------------------------------------------------- //
// Save you your project, add to your SpriteRenderer gameObject
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
@unitycoder
unitycoder / node-presskey-console.js
Created December 21, 2017 05:18
node.js Wait For KeyPress in console
// node.js get keypress
var stdin = process.stdin;
// without this, we would only get streams once enter is pressed
//stdin.setRawMode( true );
// resume stdin in the parent process (node app won't quit all by itself
// unless an error or process.exit() happens)
stdin.resume();
// i don't want binary, do you?
@unitycoder
unitycoder / SquaredColorDistance.cs
Created December 24, 2017 10:02
Color Distance RGB1-RGB2
// https://www.compuphase.com/cmetric.htm
int squaredColorDistance(r1,g1,b1,r2,g2,b2)
{
var rmean=(r1+r2)>>1;
var r=r2-r1,g=g2-g1,b=b2-b1;
return (((512+rmean)*r*r)>>8) + ((g * g) << 2) + (((767-rmean)*b*b)>>8);
}
// https://twitter.com/CasualEffects/status/944471362713931776
@unitycoder
unitycoder / amazon-webapp.txt
Last active September 24, 2021 08:35
Amazon + NetBeans + WebApp Development
// Create Amazon Server (free tier)
- Login to your amazon account
- go to AWS Management Console
- Select Region from top right menu (to see your existing servers there, or to make new ones)
- From Console Home, Click "Launch a virtual machine"
- From "Launch a virtual machine" page, click " For more options, use the EC2 launch instance wizard"
- Select Region again if its not correct
- Click Launch Instance
- Select the first one "Amazon Linux AMI 2017.09.1 (HVM), SSD Volume Type - The default image includes AWS command line tools, Python, Ruby, Perl, and Java. The repositories include Docker, PHP, MySQL, PostgreSQL, and other packages"
- Then choose instance type, T2.micro is free
@unitycoder
unitycoder / recalculate-normals.cs
Last active January 31, 2025 04:11
Unity Recalculate Normals
/*
* The following code was taken from: http://schemingdeveloper.com
*
* Visit our game studio website: http://stopthegnomes.com
*
* License: You may use this code however you see fit, as long as you include this notice
* without any modifications.
*
* You may not publish a paid asset on Unity store if its main function is based on
* the following code, but you may publish a paid asset that uses this code.