Skip to content

Instantly share code, notes, and snippets.

View VfxgraphPlayEvent.cs
// _visualEffect.SendEvent("OnPlay");と同じ
_visualEffect.SendEvent(VisualEffectAsset.PlayEventName);
View VisualEffectAssetPart.cs
/// <summary>
/// <para>The default name of the play event.</para>
/// </summary>
public const string PlayEventName = "OnPlay";
/// <summary>
/// <para>The default name of the stop event.</para>
/// </summary>
public const string StopEventName = "OnStop";
View create_article.sh
#!/bin/bash
# コピーしたいテンプレート記事パス
template='templates/article_template.md'
# 日付
date=`date '+%Y%m%d'`
# 検索対象フォルダ
dir='drafts/'
@baobao
baobao / UnityMicRecording.cs
Last active Sep 11, 2020
Unityで録音し、メモリ上に保持した録音サウンドを再生するサンプルコード
View UnityMicRecording.cs
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// Unityで録音し、メモリ上に保持した録音サウンドを再生するサンプルコード
/// OnGUIでデバッグボタンを表示しています
/// </summary>
public class UnityMicRecording : MonoBehaviour
{
/// <summary>
View serial-microbit.js
// setup serial
serial.setBaudRate(BaudRate.BaudRate115200)
// 0:none, 1:Success, 2:Fail
basic.forever(function ()
{
let str = serial.readString()
if (str.indexOf("1") >= 0) {
basic.showIcon(IconNames.Heart)
basic.pause(1000)
@baobao
baobao / RenameTxt2Cs.csx
Created Aug 1, 2020
Rename Sample `.txt` to `.cs`
View RenameTxt2Cs.csx
#!/usr/bin/env dotnet-script
/**
* Rename Sample .txt to .cs
*/
if (Args == null || Args.Count < 0)
{
Console.WriteLine("Require arguments");
return;
}
@baobao
baobao / Janken.c
Created May 3, 2020
Cでじゃんけんゲーム
View Janken.c
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include<unistd.h>
// じゃんけんの手
char te[3][20] = {"グー", "チョキ", "パー"};
int main()
{
View PrefabModeTest.cs
using UnityEngine;
public class PrefabModeTest : MonoBehaviour
{
void Awake()
{
Debug.Log($"Awake : Prefabモードのワタシ {this}", this);
}
void OnEnable()
View DOTweenAwaiterExtensionWithCancel.cs
using System;
using System.Threading;
using System.Threading.Tasks;
using DG.Tweening;
using UnityEngine;
// DOTweenAwaiterExtensionサンプルコード(キャンセル有り)
public class DOTweenAwaiterExtensionWithCancel : MonoBehaviour
{
async void Start()
View DOTweenAwaiterExtensionSample.cs
using System;
using System.Threading;
using System.Threading.Tasks;
using DG.Tweening;
using UnityEngine;
// DOTweenAwaiterExtensionサンプルコード(キャンセル処理なし)
public class DOTweenAwaiterExtensionSample : MonoBehaviour
{
async void Start()