Skip to content

Instantly share code, notes, and snippets.

View osmanzeki's full-sized avatar
👋
Oh hi!

Osman Zeki osmanzeki

👋
Oh hi!
View GitHub Profile
@osmanzeki
osmanzeki / CustomEditorBase.cs
Created March 24, 2016 10:51 — forked from t0chas/CustomEditorBase.cs
Default Custom Inspector-Editor for Unity3D with ReorderableLists for arrays handling
using UnityEngine;
using UnityEditor;
using UnityEditorInternal;
using System.Collections.Generic;
using UnityEditor.AnimatedValues;
[CustomEditor(typeof(UnityEngine.Object), true, isFallback = true)]
[CanEditMultipleObjects]
public class CustomEditorBase : Editor
{
using UnityEditor;
using UnityEngine;
using System.Collections;
using System.Globalization;
// Put this file in folder named "Editor"
// This tool will be shown in menu "Window / Color HEX To C#"
namespace Toolbox
{
@osmanzeki
osmanzeki / ScrollElement.js
Created March 24, 2016 10:55 — forked from niclasnorgren/ScrollElement.js
Kinetic scrolling for WebKit on touch devices
/*
* ScrollElement - Kinetic scrolling for WebKit on touch devices.
* http://webkitjs.org/ScrollElement/
*
* Copyright (c) 2011 Niclas Norgren, http://niclas.n3g.net
* Created 2011-03-13
*/
/**
* Simple bind method
using UnityEngine;
using System.Collections;
/// <summary>
/// Automatically scales quality up or down based on the current framerate (average).
/// </summary>
///
/// \author Kaspar Manz
/// \date 2014-03-10
/// \version 1.0.0
@osmanzeki
osmanzeki / CubemapToEquirectangularWizard.cs
Created March 24, 2016 10:59 — forked from Farfarer/CubemapToEquirectangularWizard.cs
Create dynamic equirectangular maps for Unity. These have the benefit that, as they're flat images, you can sample lower mips to get blurry reflections. The straight cubemap version (detailed here: http://www.farfarer.com/blog/2011/07/25/dynamic-ambient-lighting-in-unity/ ) will give you hard seams when you sample mips from the cubemap. Although…
// Wizard to convert a cubemap to an equirectangular cubemap.
// Put this into an /Editor folder
// Run it from Tools > Cubemap to Equirectangular Map
using UnityEditor;
using UnityEngine;
using System.IO;
class CubemapToEquirectangularWizard : ScriptableWizard {
@osmanzeki
osmanzeki / PixelPerfectCam.cs
Created March 24, 2016 11:24 — forked from pixelrevision/PixelPerfectCam.cs
Script for unity to create a pixel locked orthogonal camera
using UnityEngine;
/**
* A camera to help with Orthagonal mode when you need it to lock to pixels. Desiged to be used on android and retina devices.
*/
public class PixelPerfectCam : MonoBehaviour {
/**
* The target size of the view port.
*/
public Vector2 targetViewportSizeInPixels = new Vector2(480.0f, 320.0f);
/**
@osmanzeki
osmanzeki / git-log-to-tsv.sh
Created March 24, 2016 11:25 — forked from pwenzel/git-log-to-tsv.sh
Git Log to Tab-Delimited CSV File
# Local Dates:
git log --date=local --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.local.tsv.txt
# ISO Dates:
git log --date=iso --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.iso.tsv.txt
@osmanzeki
osmanzeki / UnitySingleton.cs
Created March 24, 2016 11:31 — forked from nonathaj/UnitySingleton.cs
Generic UnitySingleton class for creating different types of singletons in Unity
using UnityEngine;
using System;
using System.Collections;
/// <summary>
/// Class for holding singleton component instances in Unity.
/// </summary>
/// <example>
/// [UnitySingleton(UnitySingletonAttribute.Type.LoadedFromResources, false, "test")]
/// public class MyClass : UnitySingleton&lt;MyClass&gt; { }
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEngine;
public class RemoveEmptyFolders
{
/// <summary>
/// Use this flag to simulate a run, before really deleting any folders.
/// </summary>
@osmanzeki
osmanzeki / UnitySynchronizeInvoke.cs
Created March 24, 2016 11:35 — forked from JakubNei/DeferredSynchronizeInvoke.cs
Implementation of ISynchronizeInvoke for Unity3D game engine. Can be used to invoke anything on main Unity thread. ISynchronizeInvoke is used extensively in .NET forms, it's is elegant and quite useful in Unity as well. I implemented it so i can use it with System.IO.FileSystemWatcher.SynchronizingObject.
/*
Implementation of ISynchronizeInvoke for Unity3D game engine.
Can be used to invoke anything on main Unity thread.
ISynchronizeInvoke is used extensively in .NET forms, it's is elegant and quite useful in Unity as well.
I implemented it so i can use it with System.IO.FileSystemWatcher.SynchronizingObject.
help from: http://www.codeproject.com/Articles/12082/A-DelegateQueue-Class
example usage: https://gist.github.com/aeroson/90bf21be3fdc4829e631
license: WTFPL (http://www.wtfpl.net/)