Skip to content

Instantly share code, notes, and snippets.

View anchan828's full-sized avatar

Keigo Ando anchan828

  • Unity Technologies
  • Japan
  • 14:05 (UTC +09:00)
  • X @kyusyukeigo
View GitHub Profile
@anchan828
anchan828 / README.md
Last active April 15, 2024 06:13
This is an improvement to allow @nestjs/typeorm@8.1.x to handle CustomRepository. I won't explain it specifically, but it will help in some way. https://github.com/nestjs/typeorm/pull/1233

You need to provide some classes and decorators yourself to maintain the same style as typeorm@2.x.

1. EntityRepository -> CustomRepository

@EntityRepository(UserEntity)
export class UserRepository extends Repository<UserEntity> {}

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 June 26, 2018 10:13
Favro webhooks for nodejs
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);
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using UnityEditor;
using UnityEngine;
class HierarchyWindowHelper
{
private SerializedObject so;
@anchan828
anchan828 / iTunes.cs
Created August 22, 2014 08:42
エディタ再生時にiTunesを一時停止&エディタ再生をやめた時にiTunesを再生する
using UnityEngine;
using UnityEditor;
using System.IO;
using System.Text;
[InitializeOnLoad]
public class iTunes
{
static iTunes ()
{
@anchan828
anchan828 / CompileError.cs
Last active October 24, 2018 11:31
コンパイルエラーが出たまま再生ボタンを押すと、ドラクエの呪いの効果音を再生する
using UnityEngine;
using UnityEditor;
using System.Reflection;
[InitializeOnLoad]
public class CompileError
{
// 効果音。自由に変更する
// http://commons.nicovideo.jp/material/nc32797
const string musicPath = "Assets/Editor/nc32797.wav";
update
upgrade
tap caskroom/cask
install brew-cask
tap caskroom/versions
install git
install nkf
install nodebrew

Temp Run

使用するプロジェクト :

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

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

環境を揃えましょう

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]);
}
using UnityEngine;
using System.Collections;
#if UNITY_EDITOR
using UnityEditor;
[InitializeOnLoad]
// 大草原クラス
class WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
{