Skip to content

Instantly share code, notes, and snippets.

@fuqunaga
fuqunaga / CalculateObliqueMatrix
Created September 4, 2018 05:22
CalculateObliqueMatrix inplement
// https://forum.unity.com/threads/oblique-near-plane-clipping.194722/
public class Clipper : MonoBehaviour
{
Matrix4x4 projection;
Camera offscreenCam;
void Start ()
{
projection = camera.projectionMatrix;
}
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEditorInternal;
using System.Linq;
public class TwinBuild : EditorWindow
{
public const string configKey = "TwinBuildReimportAsset";
public const char configKeySeparator = ',';
@fuqunaga
fuqunaga / DiviedPolygon.cs
Created February 8, 2018 10:34
DiviedPolygon
public class Triangle
{
public Vector3[] vertices { get; protected set; }
public Triangle(Vector3 vtx0, Vector3 vtx1, Vector3 vtx2)
{
vertices = new[] { vtx0, vtx1, vtx2 };
}
@fuqunaga
fuqunaga / simple Dijkstra
Created December 11, 2017 06:34
Route search as a Dijkstra whose cost between nodes is always 1
public struct DijkstraData
{
public float cost;
public Node parent;
}
// Route search as a Dijkstra whose cost between nodes is always 1
protected List<Node> CalcRoute(Node from, Node to)
{
List<Node> ret = null;
@rem
@rem To use this with Visual Studio .Net
@rem Tools->External Tools...
@rem Add
@rem Title - Vim
@rem Command - d:\files\util\vim_vs_net.cmd
@rem Arguments - +$(CurLine) $(ItemPath)
@rem Init Dir - Empty
@rem
@rem Courtesy of Brian Sturk
@fuqunaga
fuqunaga / .gvimrc
Last active December 28, 2017 09:12
if has('gui_macvim')
set antialias
set guioptions-=r " 右スクロールバー非表示
set guioptions-=R
set guioptions-=l " 左スクロールバー非表示
set guioptions-=L
set guifont=Osaka-Mono:h14
set lines=90 columns=200
endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" for dein
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" deinパス設定
let s:dein_dir = expand('~/.vim/dein/') "<-お好きな場所
let s:dein_repo_dir = s:dein_dir . 'repos/github.com/Shougo/dein.vim' "<-固定
" dein.vim本体の存在チェックとインストール
if !isdirectory(s:dein_repo_dir)
execute '!git clone https://github.com/Shougo/dein.vim' shellescape(s:dein_repo_dir)
@fuqunaga
fuqunaga / MiniJSON.cs
Last active March 15, 2017 11:11 — forked from darktable/MiniJSON.cs
Unity3D: MiniJSON Decodes and encodes simple JSON strings. Not intended for use with massive JSON strings, probably < 32k preferred. Handy for parsing JSON from inside Unity3d.
/*
* Copyright (c) 2013 Calvin Rien
*
* Based on the JSON parser by Patrick van Bergen
* http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html
*
* Simplified it so that it doesn't throw exceptions
* and can be used in Unity iPhone with maximum code stripping.
*
* Permission is hereby granted, free of charge, to any person obtaining
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System;
public class TimeDebugger : MonoBehaviour
{
#region TypeDefine
@fuqunaga
fuqunaga / FindMissingScript
Last active November 29, 2016 11:11
EditorTestRunnerでMissingScriptをチェック
using UnityEngine;
using UnityEditor;
using NUnit.Framework;
using System.Linq;
using UnityEditor.SceneManagement;
public class CommonTest
{
/// <summary>