Skip to content

Instantly share code, notes, and snippets.

🔒
‏‏‎

mika unitycoder

🔒
‏‏‎
Block or report user

Report or block unitycoder

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@unitycoder
unitycoder / vive-cosmos-unity.md
Created Oct 17, 2019
Unity Vive Cosmos VR issues
View vive-cosmos-unity.md
@unitycoder
unitycoder / Equirectangular.shader
Last active Oct 15, 2019
shader code to do equirectangular lookups on a texture
View Equirectangular.shader
// https://forum.unity.com/threads/mapping-a-point-in-world-space-to-a-uv-of-a-sphere.760868/
// https://forum.unity.com/threads/what-is-wrong-with-unitys-spherical-mapping-how-to-fix-it.321205/#post-2083408
Shader "Custom/Equirectangular" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Diffuse (RGB) Alpha (A)", 2D) = "gray" {}
}
SubShader{
Pass {
@unitycoder
unitycoder / Stochastic.shader
Created Oct 15, 2019
Unity Stochastic Texture Sample
View Stochastic.shader
// https://old.reddit.com/r/Unity3D/comments/dhr5g2/i_made_a_stochastic_texture_sampling_shader/
Shader "Custom/StochasticSample"
{
Properties
{
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_BumpMap ("BumpMap", 2D) = "bump" {}
_BumpScale ("BumpScale", Float) = 1
_Smoothness ("Smoothness", 2D) = "white" {}
View git-cheat-sheet.sh
# https://bitbucket.org/BitPusher16/dotfiles/raw/49a01d929dcaebcca68bbb1859b4ac1aea93b073/refs/git/git_examples.sh
#!/bin/bash
##########
# contents
##########
# contents
# notes
View html-css.html
// make all divs scale with window and stay in position
<div id="container" style="position: relative;width:6vw;height:4vw;top:1vw;background:yellow">
<div id="innerdiv1" style="z-index: 1; position:absolute; width: 3vw;2vw;background:red;">a</div>
<div id="innerdiv2" style="z-index: 2; position:absolute; width: 4vw;height:2vw;background:blue;left:0.2vw;top:0.2vw;"></div>
</div>
// make image not draggable (no ghost image when drag)
<img src="maps/wow.jpg" draggable="false" />
@unitycoder
unitycoder / MinecraftReader.cs
Last active Oct 10, 2019
Read Minecraft Worlds into Unity - Using Substrate.dll
View MinecraftReader.cs
// Unity Substrate example
// https://unitycoder.com/blog/2019/10/05/reading-minecraft-world-into-unity-(using-substrate)
// reads chunks and spawns particles as blocks
using UnityEngine;
using Substrate;
using Vector3 = UnityEngine.Vector3;
public class MinecraftReader : MonoBehaviour
{
@unitycoder
unitycoder / asyncbuttonclick.cs
Created Oct 4, 2019
C# Async Button Click Return Data
View asyncbuttonclick.cs
// button click
private async void OnGetUnityUpdatesClick(object sender, RoutedEventArgs e)
{
// if you call ShowTodaysInfo().Results, it blocks the call..
var task = ShowTodaysInfo();
var items = await task;
// items is your return value (string in this case, as the task below is Task<string>
}
// async stuff
@unitycoder
unitycoder / UniPix.cs
Created Oct 3, 2019
UniPix Source Code (Editor Pixel Art Tool)
View UniPix.cs
// UniPix : Pixel Art Tools by Unitycoder.com
// source from https://assetstore.unity.com/packages/tools/painting/unipix-pixel-art-tool-28312
using UnityEditor;
using UnityEngine;
using System.Collections.Generic;
using System.IO;
namespace unitycodercom_unipix
{
You can’t perform that action at this time.