This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System; | |
using System.Text; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class LSystemGenerator : MonoBehaviour | |
{ | |
[Serializable] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vector3 velocity{ | |
get{ | |
return GetComponent<Rigidbody>().velocity; | |
} | |
set{ | |
GetComponent<Rigidbody>().velocity = value; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (digitalRead(BUTTON1) == 0) { | |
printf("%s\n", "BUTTON1"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#-*- coding: utf-8 -*- | |
import subprocess | |
import wiringpi2 | |
from time import sleep | |
# IO | |
OUTPUT = 1 | |
INPUT = 0 | |
HIGH = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from time import sleep | |
import os | |
import RPi.GPIO as GPIO | |
GPIO.setmode(GPIO.BCM) | |
GPIO.setwarnings(False) | |
GPIO.setup(13, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) | |
GPIO.setup(19, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#-*- coding: utf-8 -*- | |
import subprocess | |
import wiringpi2 | |
from time import sleep | |
# IO | |
OUTPUT = 1 | |
INPUT = 0 | |
HIGH = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#-*- coding: utf-8 -*- | |
import wiringpi2 | |
from time import sleep | |
import subprocess | |
# IO | |
OUTPUT = 1 | |
INPUT = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <unistd.h> | |
#include <wiringPi.h> | |
#define BUTTON1 2 | |
#define BUTTON2 3 | |
#define BUTTON3 4 | |
int main(void) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class Fractal : MonoBehaviour { | |
public int maxDepth = 4; | |
private int depth; | |
Matrix4x4 mat; | |
Vector3[] vertex,afterVertex; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ジェネリックにしたいメソッド | |
Object FindObjectOf(Type type) { | |
return FindObjectOfType(type); | |
} | |
// 型パワメータの名前をTとするのは慣習 | |
T FindObjectOf<T>() where T: Component { | |
// 型パラメータに制限を課すことができる | |
return (T)FindObjectOfType(typeof(T)); | |
} |