Skip to content

Instantly share code, notes, and snippets.

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

mika unitycoder

✅
‏‏‎
View GitHub Profile
@unitycoder
unitycoder / unityforumstylish.css
Last active February 16, 2017 02:14
Unity Forum CSS Fixes (for Stylish plugin)
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("forum.unity3d.com") {
/* forum is now fixed, no need to use this */
/* optional: disable all rounded edges */
* {
@unitycoder
unitycoder / unity-deep-linking.txt
Last active July 17, 2020 15:25
unity deep linking url schemes
new: https://blogs.unity3d.com/2020/07/16/add-deep-links-to-your-unity-mobile-apps-for-better-user-experience/
https://forum.unity3d.com/threads/callback-on-launching-from-url-scheme.455503/#post-2952951
https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Inter-AppCommunication/Inter-AppCommunication.html#//apple_ref/doc/uid/TP40007072-CH6-SW1
@unitycoder
unitycoder / Reload.cs
Created March 4, 2017 10:43
Reload Current Level
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
public class Reload : MonoBehaviour
{
void Update()
{
if (Input.GetKeyDown(KeyCode.R)) // reload current scene with R key
{
@unitycoder
unitycoder / luatest.lua
Created March 5, 2017 06:42
Moonsharp Lua Test
-- access unity class
newType = CustomType;
-- call instantiate from the class
newType:Instantiate("Sphere");
-- creates line object from x1,y1,z1 to x2,y2,z2
newType:DrawLine(0,0,0,100,0,0);
@unitycoder
unitycoder / testflight-macmini-unity.txt
Last active December 5, 2025 08:52
Setup Mac Mini for Unity Development and Upload your first App to App Store TestFlight
- install xcode from appstore
- install unity
- install sourcetree or other git tools
build to device
- open unity project
- set player settings if not already done (appname etc)
- set target platform to ios
- hit build
- after build is done, folder opens with the xcode project
- open any website
- open website with SSL cert error
- click (lock) error button in URL bar, displays previous sites TITLE instead of current one
@unitycoder
unitycoder / sort-vector3-x.cs
Created March 15, 2017 07:42
Sort Vector3 Array by X-value
// https://forum.unity3d.com/threads/sorting-a-list-of-vector3-by-x-values.126237/#post-850924
list.Sort((a, b) => a.x.CompareTo(b.x));
@unitycoder
unitycoder / fast-branchless-raybounding-box-intersections.c
Created April 3, 2017 02:32
fast-branchless-raybounding-box-intersections
// https://tavianator.com/fast-branchless-raybounding-box-intersections/
bool intersection(box b, ray r) {
double tx1 = (b.min.x - r.x0.x)*r.n_inv.x;
double tx2 = (b.max.x - r.x0.x)*r.n_inv.x;
double tmin = min(tx1, tx2);
double tmax = max(tx1, tx2);
double ty1 = (b.min.y - r.x0.y)*r.n_inv.y;