Skip to content

Instantly share code, notes, and snippets.

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

mika unitycoder

✅
‏‏‎
View GitHub Profile
@unitycoder
unitycoder / alphashader.txt
Created September 20, 2016 03:41
Surface Shader issue with Alpha (self-seethrough)
PROBLEM:
Parts that are behind the mesh are shown on top of the front face.. (they should be invisible and behind, since alpha=1)
SOLUTION:
instead of alpha keyword, use keepalpha and add blending mode
http://answers.unity3d.com/answers/1154646/view.html
@unitycoder
unitycoder / RotateLerp.cs
Created September 21, 2016 06:56
Quaternion Rotation Lerp with IEnumerator
// rotate target transform from Quaternion A to Quaternion B, within duration
// to call
StartCoroutine(RotateLerp(transform, Quaternion.Euler(0,90,0)));
IEnumerator RotateLerp(Transform target, Quaternion endRot)
{
float duration = 1.5f;
var startRot = target.rotation; // current rotation
@unitycoder
unitycoder / GetVersion.cs
Last active January 20, 2019 12:46
Get app version number (the from player settings) at runtime
using UnityEngine;
using UnityEngine.UI;
// attach this to UI Text component
// it shows current version number from Android Player settings
public class GetVersion : MonoBehaviour
{
void Awake()
{
@unitycoder
unitycoder / Kojoney2-centos.txt
Last active September 23, 2016 13:46
Install Kojoney2 on Centos7
// install git if want to clone with it
sudo yum install git
git clone https://github.com/madirish/kojoney2.git
// use installer
cd kojoney2
chmod +x installer.sh
./installer.sh
// change ssh port
@unitycoder
unitycoder / texturejam.txt
Created September 27, 2016 02:58
Texture gets included in build, even if its not used
- Select texture file in project window
- Right click Find References in scene
- Select the gameobject it refers
- Set inspector to debug mode
- See material for Saved Properties/TexEnvs/Element0, most likely its there
@unitycoder
unitycoder / unity_context_item.reg
Created September 28, 2016 12:27
Add Custom Explorer Context Item for Opening a Folder with Unity
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\Background\shell\Unity]
"Icon"="\"D:\\Program Files\\Unity55Beta\\Editor\\Unity.exe\""
@="Open with Unity 5.5"
[HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\Background\shell\Unity\command]
@="\"D:\\Program Files\\Unity55Beta\\Editor\\Unity.exe\" -projectPath \"%V\""
@unitycoder
unitycoder / kinect-unity.md
Last active November 19, 2024 18:39
Kinect xbox one with Unity

Setting up Kinect xbox one with Windows 10

Using Kinect XBone One in Unity 5 (i'm using 5.50b5)

@unitycoder
unitycoder / ipad-itunes-ipa-file.txt
Last active September 23, 2025 09:22
Install .ipa file to ipad with iTunes
NEW
If drag & drop to itunes doesnt work then
- Right click over ipa file
- Open in iTunes
- Then it appears on the apps list (sync to install)
OLD
- Click ... and select Apps (shows all available apps on this machine, not the ipad)
- Remove your old app from the list if its there (right click, delete)
- Then drag and drop the .ipa file here (cannot drag and drop it directly to the ipad)
@unitycoder
unitycoder / crs-file-windows.txt
Last active November 22, 2016 13:23
Creating .crs and .p12 file in Windows
- Download openssl binary : https://indy.fulgan.com/SSL/ (i used https://indy.fulgan.com/SSL/openssl-0.9.8r-x64_86-win64-rev2.zip )
- Unzip
- Go to that folder with command prompt *Run command prompt as Administrator!
cmd> openssl genrsa -out mykey.key 2048
- Download missing openssl.cfg file from this page https://docs.oracle.com/cd/E19509-01/820-3503/ggeyz/index.html and place it to the same folder with openssl (with filename openssl.cfg)
cmd> set OPENSSL_CONF=c:\YourOpensslFolder\openssl.cnf
cmd> openssl req -new -key mykey.key -out CertificateSigningRequest.certSigningRequest -subj "/emailAddress=yourAddress@example.com, CN=BenchMan, C=US"
- Now you can upload the generated "CertificateSigningRequest.certSigningRequest" file into Apple Developer site (when creating new Production Certificate)
references:
@unitycoder
unitycoder / UndoListener.cs
Last active October 5, 2016 14:15
Editor Listener (test)
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
//using System.Reflection;
public class UndoListener : EditorWindow
{
[MenuItem("Window/Listener")]
static void Init()