Skip to content

Instantly share code, notes, and snippets.

using UnityEditor;
using UnityEngine;
[InitializeOnLoad]
public static class HotkeyTest
{
[MenuItem("HotkeyTest/Hotkey test alt #&S")]
public static void TestWithAlt()
{
Debug.Log("Alt+shift+S pressed");
@atil
atil / Util.cs
Created January 29, 2017 14:43
A number of extension / utility functions that come in handy for almost every project that I've worked on.
public static class Util
{
public static Vector3 Horizontal(this Vector3 v)
{
return Vector3.ProjectOnPlane(v, Vector3.up);
}
public static bool InBetween(this float val, float a, float b)
{
return (val < b && val > a) || (val < a && val > b);
@atil
atil / ApplicationConfig.cs
Last active August 24, 2016 09:20
A general purpose configuration file boilerplate
using System;
using UnityEngine;
using System.Collections;
using System.IO;
using System.Runtime.Serialization;
using System.Xml.Serialization;
[Serializable]
public class ApplicationConfig
{
@atil
atil / MeshExtractor.cs
Created May 6, 2016 14:04
Extracting mesh from a recast graph
using System.Collections;
using System.Collections.Generic;
using Pathfinding;
using UnityEngine;
public class MeshExtractor
{
public MeshExtractor()
{
// Assuming a valid recast graph exists...
using System.Collections;
using UnityEngine;
public class CoroutineStarter : MonoBehaviour
{
private static readonly MonoBehaviour coroutineStarter;
public static Coroutine StartCoroutine(IEnumerator function)
{
return coroutineStarter.StartCoroutine(function);
}
using UnityEngine;
using System.Collections;
public static class Utility
{
#region Rotation / Local Rotation
public static void SetRotation(this GameObject go, Quaternion rot)
{
go.transform.rotation = rot;
}
#include <stdio.h>
#include <stdlib.h>
#include "mpi.h"
#include "mkl.h"
#include <math.h>
#define DEBUG
#define N 500
char**