Skip to content

Instantly share code, notes, and snippets.

Avatar

kyusyukeigo anchan828

View GitHub Profile
View timerify.decorator.ts
import { performance } from 'perf_hooks';
export function timerify<T = any>() {
return function(
target: any,
propertyKey: string,
descriptor: TypedPropertyDescriptor<any>,
) {
const oldDescriptor = descriptor.value;
if (!oldDescriptor) {
@anchan828
anchan828 / index.ts
Created Jun 26, 2018
Favro webhooks for nodejs
View index.ts
import * as bodyParser from "body-parser";
import * as crypto from "crypto";
import {default as express, Request} from "express";
const app = express();
app.use(bodyParser.json()).post("/", (req: Request, res) => {
const secretKey = "1234";
const str = req.body.payloadId + req.body.hook.url;
const sha1 = crypto.createHmac("sha1", secretKey);
View HierarchyWindowHelper.cs
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using UnityEditor;
using UnityEngine;
class HierarchyWindowHelper
{
private SerializedObject so;
@anchan828
anchan828 / iTunes.cs
Created Aug 22, 2014
エディタ再生時にiTunesを一時停止&エディタ再生をやめた時にiTunesを再生する
View iTunes.cs
using UnityEngine;
using UnityEditor;
using System.IO;
using System.Text;
[InitializeOnLoad]
public class iTunes
{
static iTunes ()
{
@anchan828
anchan828 / CompileError.cs
Last active Oct 24, 2018
コンパイルエラーが出たまま再生ボタンを押すと、ドラクエの呪いの効果音を再生する
View CompileError.cs
using UnityEngine;
using UnityEditor;
using System.Reflection;
[InitializeOnLoad]
public class CompileError
{
// 効果音。自由に変更する
// http://commons.nicovideo.jp/material/nc32797
const string musicPath = "Assets/Editor/nc32797.wav";
View brewfile
update
upgrade
tap caskroom/cask
install brew-cask
tap caskroom/versions
install git
install nkf
install nodebrew
View TempRun.md

Temp Run

使用するプロジェクト :

完成ゲーム「てんぷらん」 :

とりあえず完成しているゲームを見てみましょう。

環境を揃えましょう

View gist:9024678
private static void ClearConsoleLogs()
{
var type = Types.GetType("UnityEditorInternal.LogEntries", "UnityEditor");
var info = type.GetMethod("Clear", BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance);
info.Invoke(null, new object[0]);
}
View WWWWWWWWWWWWWW.cs
using UnityEngine;
using System.Collections;
#if UNITY_EDITOR
using UnityEditor;
[InitializeOnLoad]
// 大草原クラス
class WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
{
View Unity-Live-Template.DotSettings
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=27C6C585F2A2204D93E825FAE7479170/@KeyIndexDefined">True</s:Boolean>
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=27C6C585F2A2204D93E825FAE7479170/Shortcut/@EntryValue">AssetDeleteResult</s:String>
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=27C6C585F2A2204D93E825FAE7479170/Text/@EntryValue"> static AssetDeleteResult OnWillDeleteAsset (string $assetPath$, RemoveAssetOptions $option$)&#xD;
{&#xD;
$END$&#xD;
}</s:String>
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=27C6C585F2A2204D93E825FAE7479170/Reformat/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/PatternsAndTemplate