Skip to content

Instantly share code, notes, and snippets.

View brunomikoski's full-sized avatar
🛹

Bruno Mikoski brunomikoski

🛹
View GitHub Profile
@brunomikoski
brunomikoski / CodeGuidelines.cs
Last active November 7, 2015 20:48
CodeGuidelines
using System;
using UnityEngine;
// Add one empty line at the end of your file
//Use interfaces
//Max 4 words for per variable
//One method should be do only one thing (Save some exceptions)
//Maximum line width is 100 characters.
//Namespace following the folder order after _ProjectName/Scripts/...
@brunomikoski
brunomikoski / ResourceAsset.cs
Created September 1, 2015 16:06
Dynamically load assets from resource, saving the reference for the Object it self instead of string
using UnityEngine;
[System.Serializable]
public class ResourceAsset
{
public string GUID;
public string path;
public string name;
protected Object cachedObject;
protected ResourceRequest resourceRequest;
void OnEnable()
{
Application.RegisterLogCallback(HandleUnityLog);
}
private void OnDisable()
{
Application.RegisterLogCallback(null);
}
@brunomikoski
brunomikoski / ReplaceTextForTextMeshPro.cs
Created March 31, 2015 14:24
Replace all Text instances for TextMeshPROUGUI ones
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using TMPro;
using UnityEngine.UI;
public class ReplaceFont
CurrentBundleVersion.version
public static class CurrentBundleVersion
{
public static readonly string version = "1.0.31";
}
using UnityEngine;
using UnityEditor;
using System.IO;
[InitializeOnLoad]
public class BundleVersionChecker
{
/// <summary>
/// Class name to use when referencing from code.
/// </summary>
@brunomikoski
brunomikoski / designer.html
Last active August 29, 2015 14:13
designer
<link rel="import" href="../paper-button/paper-button.html">
<polymer-element name="my-element">
<template>
<style>
:host {
box-sizing: border-box;
background-color: rgb(255, 255, 255);
}
public void OnPreprocessTexture()
{
if (!isAssetProcessed)
{
var textureImporter = assetImporter as TextureImporter;
textureImporter.compressionQuality = 100;
textureImporter.filterMode = FilterMode.Bilinear;
textureImporter.maxTextureSize = 2048;
textureImporter.textureFormat = TextureImporterFormat.AutomaticCompressed;
}
@brunomikoski
brunomikoski / DiffuseOverlay.shader
Created December 17, 2014 14:42
Overlay difuse shader (Object Above Everything else)
Shader "Custom/DiffuseOverlay" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
// Tags {"RenderType"="Opaque"} // original
Tags {"Queue" = "Overlay" "RenderType"="Opaque"} // modified
ZTest Always // this line is added
LOD 200