Skip to content

Instantly share code, notes, and snippets.

View 0V's full-sized avatar
🛌
Always sleeping

G2 0V

🛌
Always sleeping
View GitHub Profile
[SerializeField]
private float speed = 10f;
void Update () {
transform.Translate (speed * Time.deltaTime, 0, 0);
}
using System.Text.RegularExpressions;
using UnityEditor;
using UnityEngine;
public class ToNumbering : EditorWindow
{
private string baseName = "";
// Add menu item named "My Window" to the Window menu
@0V
0V / aprrox.c
Last active May 14, 2019 04:23
Approximationa rough calculation without math.h (for my homework)
#include <stdio.h>
#define LOG2 0.693147180559945309417 //log(2)
#define chk_nan(x) x!=x
double log_fast(double x)
{
static double table[17]={
.0 , // log( 16 /16)
.0606246218164348425806 , // log( 17 /16)
.1177830356563834545387 , // log( 18 /16)
@0V
0V / CounterClickHandler.cs
Last active May 20, 2017 11:33
uGUIで指定回数連続クリックされたら何かをするスクリプト
using System;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
public class CounterClickHandler : MonoBehaviour, IPointerClickHandler
{
[SerializeField]
private ClickEvent clickHandler;
[SerializeField]
@0V
0V / SecretClickHandler.cs
Last active May 20, 2017 11:24
Unity(uGUI)で N 回クリックするとオブジェクトをアクティブにするスクリプト
using System;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
public class SecretClickHandler : MonoBehaviour, IPointerClickHandler
{
[SerializeField]
private ClickEvent clickHandler;
[SerializeField]
@0V
0V / root3.cpp
Last active May 19, 2017 02:46
1 * 2 = √√ * 2 = √√ * 2 = ... ; g++ root3.cpp -lm -std=c++11
#include <cmath>
#include <iostream>
#include <iomanip>
#include <limits>
double excute(){
double tmp = 1;
double current = 1;
while(1){
current *= 2;
@0V
0V / SerializeFieldProperty.cs
Last active December 21, 2017 08:04
Unity でインスペクター操作可能なプロパティを作るスニペット
[SerializeField]
private int _Score;
public int Score
{
get { return _Score; }
set { _Score = value; }
}
@0V
0V / Error
Created May 2, 2017 05:47
Search Replace DB でのエラー
The script encountered an error while running an AJAX request.
If you are using your hosts file to map a domain try browsing via the IP address directly.
If you are still running into problems we recommend trying the CLI script bundled with this package.
See the README for details.
@0V
0V / del_obj.bat
Last active April 29, 2017 04:40
for Moving Projects
COPY AND PASTE on CMD
for /D /R %d in (packages) do rmdir /S /Q "%d" &
for /D /R %d in (package) do rmdir /S /Q "%d" &
for /D /R %d in (.git) do rmdir /S /Q "%d" &
for /D /R %d in (Debug) do rmdir /S /Q "%d" &
for /D /R %d in (debug) do rmdir /S /Q "%d" &
for /D /R %d in (DebugPublic) do rmdir /S /Q "%d" &
for /D /R %d in (debugPublic) do rmdir /S /Q "%d" &
for /D /R %d in (Release) do rmdir /S /Q "%d" &
@0V
0V / g2-q1.js
Created March 13, 2017 08:05
【JSクイズ】ECMAScript 6 の仕様書を少しだけ読んできたので
// 問. 厳密でない等価演算子編
// 次のJavaScript(ES6)のコードを実行したとき、
// 出力はどうなるか答えよ。
a = Boolean(null == undefined);
if(a) console.log("true");
else console.log("false");
b = Boolean(0 == null);