Skip to content

Instantly share code, notes, and snippets.

@naojitaniguchi
naojitaniguchi / ButtonPushNextScene.cs
Created November 26, 2022 02:50
Load scene by clicking UI button in Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class ButtonPushNextScene : MonoBehaviour
{
public string nextScene;
// Start is called before the first frame update
void Start()
@naojitaniguchi
naojitaniguchi / moog_scale.tidal
Created May 25, 2019 23:51
Making Scale with speed command by tidal cycles
d1 $ sound "moog:1" |> speed "1"
--2 E flat
d2 $ sound "moog:1" |> speed (1 + (1/12) * 2)
--3 E
d3 $ sound "moog:1" |> speed (1 + (1/12) * 3)
--4 F
d3 $ sound "moog:1" |> speed (1 + (1/12) * 4)
--6 G
d4 $ sound "moog:1" |> speed (1 + (1/12) * 6)
--7 G#
@naojitaniguchi
naojitaniguchi / MoveByVelocity.cs
Created May 1, 2019 22:33
Script for move 2D character by setting velocity of Rigidbody2D
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Rigidbody2D))]
public class MoveByVelocity : MonoBehaviour
{
[Header("Input keys")]
public Enums.KeyGroups typeOfControl = Enums.KeyGroups.ArrowKeys;
@naojitaniguchi
naojitaniguchi / AnimChange.cs
Created May 1, 2019 10:45
Change Animation trigger script for 2D character in Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AnimChange : MonoBehaviour
{
Animator animator;
bool moving = false;
// Start is called before the first frame update
@naojitaniguchi
naojitaniguchi / catimage.bsh
Created July 31, 2018 14:12
making tile image by ffmpeg
ffmpeg -start_number 0 -i res_%03d.png -filter_complex tile=1x11:margin=10:padding=4 output_0.png
ffmpeg -start_number 11 -i res_%03d.png -filter_complex tile=1x11:margin=10:padding=4 output_1.png
ffmpeg -start_number 22 -i res_%03d.png -filter_complex tile=1x11:margin=10:padding=4 output_2.png
ffmpeg -start_number 33 -i res_%03d.png -filter_complex tile=1x11:margin=10:padding=4 output_3.png
ffmpeg -start_number 44 -i res_%03d.png -filter_complex tile=1x11:margin=10:padding=4 output_4.png
ffmpeg -start_number 55 -i res_%03d.png -filter_complex tile=1x11:margin=10:padding=4 output_5.png
ffmpeg -i output_%0d.png -filter_complex tile=6x1:margin=10:padding=4 output.png
@naojitaniguchi
naojitaniguchi / gist:b293fd901071330cedb22fecff291fa1
Created November 4, 2017 01:42
Marge 2 movies into side by side movie by ffmpeg
ffmpeg -i "Left.MOV" -vf "[in] scale=iw:ih, pad=2*iw:ih [left];movie=Right.MOV, scale=iw:ih [right]; [left][right] overlay=main_w/2:0 [out]" "SideBySide.MOV"
@naojitaniguchi
naojitaniguchi / KeyInput.cs
Created September 22, 2017 23:10
2D Character control sample for Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class KeyInput : MonoBehaviour {
public float speed;
// Use this for initialization
void Start () {
using UnityEngine;
using System.Collections;
public class SwitchObj : MonoBehaviour {
public GameObject hart_0;
public GameObject hart_1;
public GameObject hart_2;
public GameObject hart_3;
public GameObject hart_4;
public GameObject hart_5;
@naojitaniguchi
naojitaniguchi / UniOSCSendMessageSample.cs
Created November 29, 2016 00:28
Message sending sample for UniOSC
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System;
using OSCsharp.Data;
namespace UniOSC{
@naojitaniguchi
naojitaniguchi / UniOSCGetMessageSample.cs
Created November 28, 2016 22:56
Get OSC message sample script for UniOSC
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using System.Collections;
using System.Collections.Generic;
using System;
using OSCsharp.Data;
namespace UniOSC{