Skip to content

Instantly share code, notes, and snippets.

@takoyakiroom
takoyakiroom / Car.cs
Last active August 20, 2016 17:02
たこルカRC
using UnityEngine;
using System.Collections;
public class Car : MonoBehaviour
{
private float power = 0;
private float LR = 0;
private float direction = 0;
// Use this for initialization
@takoyakiroom
takoyakiroom / Coin.cs
Created August 24, 2016 09:07
ドローン
using UnityEngine;
using System.Collections;
public class Coin : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
@takoyakiroom
takoyakiroom / CPUUsage.cpp
Created August 25, 2016 15:25
CPU使用率取得DLL
//--------------------------------------------------------
#include <windows.h>
#include <windowsx.h>
#include <pdh.h>
#pragma comment (lib, "Pdh.lib") // Pdh.lib使うよ
//-------------------------------------------------------- Exportする
#ifdef __cplusplus
extern "C" {
@takoyakiroom
takoyakiroom / CPUUsage.cs
Created August 25, 2016 15:29
CPU使用率DLL使う側(Unity)
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System.Runtime.InteropServices;
public class CPUUsage : MonoBehaviour {
[DllImport("CPUUsage")]
private static extern void StartCPUUsage(uint usage);
[DllImport("CPUUsage")]
private static extern long GetCPUUsage();
@takoyakiroom
takoyakiroom / LadarCamera.cs
Created August 26, 2016 17:21
マップ用カメラ
using UnityEngine;
using System.Collections;
public class LadarCamera : MonoBehaviour {
GameObject player;
// Use this for initialization
void Start () {
player = GameObject.Find("[CameraRig]/Camera (eye)");
}
@takoyakiroom
takoyakiroom / Bomb.cs
Created August 30, 2016 14:07
爆弾
using UnityEngine;
using System.Collections;
public class Bomb : MonoBehaviour {
public GameObject Explision;
public GameObject FireWall;
public GameObject Debris;
const float EXPLOSION_TIME = 5; // 爆発までの時間
Vector3 max_scale;
@takoyakiroom
takoyakiroom / CtrlListener.cs
Created September 5, 2016 15:37
コントローラリスナ
using UnityEngine;
using System.Collections;
using VRTK;
public class CtrlListener : MonoBehaviour {
void Start()
{
// 爆弾置くボタン
GetComponent<VRTK_ControllerEvents>().TriggerReleased += new ControllerInteractionEventHandler(DoTriggerReleased);
@takoyakiroom
takoyakiroom / Maze.cs
Created September 6, 2016 12:57
迷路
using UnityEngine;
using System.Collections;
public class Maze : MonoBehaviour
{
public GameObject Unbrk; // 壊れない奴
public GameObject Brk; // 壊れるやつ
public GameObject Grnd; // 地面
public GameObject Bomb; // 爆弾
Vector3 block; // 1ブロックのサイズ用
@takoyakiroom
takoyakiroom / FireWall.cs
Created September 21, 2016 16:23
爆風
using UnityEngine;
using System.Collections;
public class FireWall : MonoBehaviour {
public GameObject Effect; // 爆風エフェクト
int power; // 火力
Vector3 scale; // サイズ
Vector3 pos; // 位置
int counter = 0; // 爆風を長くする用のカウンタ
@takoyakiroom
takoyakiroom / ControllerTooltips.cs
Created October 1, 2016 05:31
ツールチップ
using UnityEngine;
using System.Collections;
public class ControllerTooltips : MonoBehaviour{
const float SHOW_DIST = 0.3f; // Tipsを表示する距離
const float HIDE_TIME = 3.0f; // Tips消す時間
GameObject eye;
GameObject trg;
GameObject pad;