Skip to content

Instantly share code, notes, and snippets.

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

mika unitycoder

✅
‏‏‎
View GitHub Profile
@unitycoder
unitycoder / MinecraftReader.cs
Last active October 10, 2019 07:13
Read Minecraft Worlds into Unity - Using Substrate.dll
// 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 October 4, 2019 15:55
C# Async Button Click Return Data
// 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 October 3, 2019 09:18
UniPix Source Code (Editor Pixel Art Tool)
// 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
{
@unitycoder
unitycoder / uvdebug.png
Last active January 30, 2020 10:50
UV Debug Texture
below
@unitycoder
unitycoder / seethroughwalls.shader
Created September 30, 2019 11:02
2 Pass SeeThrough Walls Standard Surface Shader
Shader "Custom/SeeThru1"
{
Properties
{
_Color("Color", Color) = (1,1,1,1)
_MainTex("Albedo (RGB)", 2D) = "white" {}
_Glossiness("Smoothness", Range(0,1)) = 0.5
_Metallic("Metallic", Range(0,1)) = 0.0
}
@unitycoder
unitycoder / Minecraft Bedrock Server Addons.txt
Last active April 2, 2020 11:17
Minecraft Bedrock Server Addons (mods)
create server locally first, enable experimental gameplay and add addons
then copy those files to server (from C:\Users\username\AppData\Local\Packages\Microsoft.MinecraftUWP_8wekyb3d8bbwe\LocalState\games\com.mojang\minecraftWorlds\)
the contents of the gamefolder
remember to set server settings, worldname, to same as the folder where you copied files to.
tree capitator:
https://for-minecraft.com/mods-for-minecraft-pocket-edition/4072-treecapitator-addon-for-minecraft-pe-111-amp-112.html
@unitycoder
unitycoder / SlideInOut.cs
Created September 27, 2019 08:32
Slide UI element position in and out
using UnityEngine;
using System.Collections;
namespace UnityLibrary
{
/*
public enum SlideAxis : byte
{
Y
}*/
@unitycoder
unitycoder / Standard-Tesselated.shader
Created September 18, 2019 09:03
Unity Standard Shader Tesselation
// source https://forum.unity.com/threads/unity-5-standart-shader-with-tesselation.318751/#post-2082612
Shader "Custom/Standard-Tesselated" {
Properties{
_Color("Color", Color) = (1,1,1,1)
_MainTex("Albedo (RGB)", 2D) = "white" {}
_Glossiness("Smoothness", Range(0,1)) = 0.5
_Metallic("Metallic", Range(0,1)) = 0.0
_Height("Height", 2D) = "black"{}
_HeightmapTiling("Heightmap tiling", Float) = 1.0
@unitycoder
unitycoder / Sprites-Default.shader
Created September 9, 2019 09:45
Unity Sprite Shader
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
Shader "Sprites/Default"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
[MaterialToggle] PixelSnap ("Pixel snap", Float) = 0
[HideInInspector] _RendererColor ("RendererColor", Color) = (1,1,1,1)