Skip to content

Instantly share code, notes, and snippets.

@takashicompany
takashicompany / PoolingContainer.cs
Created October 24, 2016 07:57
[Unity] GameObjectを生成・再利用するクラス
using UnityEngine;
using System.Collections.Generic;
/// <summary>
/// GameObjectを再利用するコンテイナー
/// </summary>
[System.Serializable]
public class PoolingContainer
{
[SerializeField]
namespace TakashiCompany.Unity.Extension
{
using UnityEngine;
/// <summary>
/// UnityEngine.Animation extension.
/// </summary>
public static class AnimationSampleExtension
{
public static void SampleWithTime(
private static string[] _numChars = new string[]
{
"⓪","①","②","③","④","⑤","⑥","⑦","⑧","⑨","⑩","⑪","⑫","⑬","⑭","⑮","⑯","⑰","⑱","⑲","⑳","㉑","㉒","㉓","㉔","㉕","㉖","㉗","㉘","㉙","㉚","㉛","㉜","㉝","㉞","㉟","㊱","㊲","㊳","㊴","㊵","㊶","㊷","㊸","㊹","㊺","㊻","㊼","㊽","㊾","㊿"
};
@takashicompany
takashicompany / OffscreenCaptureManager.cs
Created December 2, 2017 06:56
プレイヤーの画面とは別視点のリプレイを録画する
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// UnityEngineと名前空間を分ける
using ocv = OpenCVForUnity;
// 録画に使いたいカメラにつけるコンポーネント
[RequireComponent(typeof(Camera))]
public class OffscreenCaptureManager : MonoBehaviour
@takashicompany
takashicompany / subtree-template.sh
Last active October 8, 2018 08:44
git-subtree support shell.
#!/bin/bash
repo=<subtree-repo path>
remote=<subtree-repo remote name>
branch=<subtree branch>
path=<local subtree path>
if [ $# -eq 0 ]; then
echo "this is git-subtree-suppot tool.\noptions:\n init\n pull\n push"
exit 1
@takashicompany
takashicompany / movie_to_gif_animation.sh
Last active January 6, 2023 07:48
動画ファイルをキレイなgifにしてくれるコマンドライン
#!/bin/bash
CMDNAME=`basename $0`
while getopts i:s:f:e: OPT
do
case $OPT in
"i" ) is_import="TRUE" ; import="$OPTARG";;
"s" ) is_size="TRUE" ; size="$OPTARG" ;;
"f" ) is_fps="TRUE" ; fps="$OPTARG" ;;
@takashicompany
takashicompany / HHKB-JIS.kbd.json
Last active November 19, 2021 05:18
HHKB JIS
[
{
"name": "HHKB JIS"
},
[
{
"a": 6
},
"ESC",
{
#include QMK_KEYBOARD_H
#include <stdio.h>
// キーを押した回数を格納する変数
static uint16_t press_count = 0;
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
// キーが押されたら、カウンターをインクリメントする
if (record->event.pressed) {
press_count++;
}
#ifdef OLED_DRIVER_ENABLE
void oled_task_user(void) {
// 現在のレイヤーを表示する
oled_write_ln_P(PSTR("Layer"), false);
char layer_str[12];
snprintf(layer_str, sizeof(layer_str), "%d", get_highest_layer(layer_state));
oled_write_ln(layer_str, false);