Skip to content

Instantly share code, notes, and snippets.

@solkar
solkar / 81-C# Script-NewBehaviourScript.cs.txt
Last active August 25, 2016 04:20
My custom template for new MonoBehaviour
///
///
/// #SCRIPTNAME#, created by Karlos Zafra
///
//////
using UnityEngine;
using System.Collections;
public class #SCRIPTNAME# : MonoBehaviour
@solkar
solkar / .gitconfig
Last active April 3, 2019 10:01
My gitconfig file
[user]
name = Karlos Zafra
email = [email protected]
[alias]
amend = !git log -n 1 --pretty=tformat:%s%n%n%b | git commit -F - --amend
br = branch
co = checkout
cob = checkout -b
continue = rebase --continue
@solkar
solkar / DeletePlayerPrefs.cs
Created July 29, 2016 16:32
Add a command to Unity Editor to wipe out PlayerPrefs
//
//
// DeletePlayerPrefs, created by Karlos Zafra
//
//
using UnityEngine;
using UnityEditor;
public class DeletePlayerPrefs
@solkar
solkar / PlatformMonitor.cs
Created November 14, 2016 15:32 — forked from bzgeb/PlatformMonitor.cs
Example Platform Monitoring script
using UnityEngine;
using UnityEditor;
using System.Collections;
[InitializeOnLoad]
public class PlatformMonitor {
static BuildTarget cachedPlatform;
static PlatformMonitor() {
cachedPlatform = EditorUserBuildSettings.activeBuildTarget;
@solkar
solkar / DisableAnimations.cs
Created April 20, 2017 04:53
Disable animation from AssetImporter
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
public class DisableAnimations : AssetPostprocessor
{
void OnPreprocessModel()
{
var modelImporter = assetImporter as ModelImporter;
@solkar
solkar / EnableLatentFrame.cs
Created April 21, 2017 10:41
HoloLens Latent Frame ON
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnableLatentFrame : MonoBehaviour
{
void Start () {
UnityEngine.VR.WSA.HolographicSettings.ActivateLatentFramePresentation( true );
}
@solkar
solkar / EnvPresetChooser.cs
Created May 1, 2017 08:34
Camera Presets selection and Screeshot dump - from Unity3D Blacksmith demo
using UnityEngine;
using System.Collections;
using System.Linq;
public class EnvPresetChooser : MonoBehaviour {
public Transform[] presets { get { return transform.Cast<Transform>().ToArray(); } }
public int GetActivePreset() {
for(int i = 0, n = transform.childCount; i < n; ++i)
if(transform.GetChild(i).gameObject.activeSelf)
@solkar
solkar / FreeCamera.cs
Created May 1, 2017 09:40
Basic demo camera for Unity
//
// Controls:
// - Enable free look with right mouse button
//
//
using UnityEngine;
public class FreeCamera : MonoBehaviour {
public bool enableInputCapture = true;
@solkar
solkar / FreeCamera.cs
Created May 1, 2017 09:40
Basic demo camera for Unity
//
// Controls:
// - Enable free look with right mouse button
//
//
using UnityEngine;
public class FreeCamera : MonoBehaviour {
public bool enableInputCapture = true;
Shader "Name" {
Properties {
name ("display name", Range (min, max)) = number
name ("display name", Float) = number
name ("display name", Int) = number
name ("display name", Color) = (number,number,number,number)
name ("display name", Vector) = (number,number,number,number)