Skip to content

Instantly share code, notes, and snippets.

using UnityEngine;
using System;
using System.Collections;
using VRTK;
public class IK : MonoBehaviour
{
Animator avatar; // アバター
public Transform lookAt = null; // 見る対象
@takoyakiroom
takoyakiroom / CtrlTest1.cs
Created August 10, 2017 16:54
ヘッドセット・コントローラ参照
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using VRTK;
public class CtrlTest : MonoBehaviour {
void Awake()
{
VRTK_SDKManager.instance.AddBehaviourToToggleOnLoadedSetupChange(this);
@takoyakiroom
takoyakiroom / CtrlTest2.cs
Created August 10, 2017 16:54
オブジェクトをハイライト
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using VRTK;
using VRTK.Highlighters;
public class CtrlTest : MonoBehaviour
{
void Start()
@takoyakiroom
takoyakiroom / Pen.cs
Created February 10, 2018 05:44
ペン
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using VRTK;
public class Pen : MonoBehaviour {
public float LineDistance = 0.1f; // Trackを置き直す距離
public GameObject track; // 軌跡
VRTK_InteractableObject io; // コントローラ用
@takoyakiroom
takoyakiroom / Eraser.cs
Created February 10, 2018 05:45
消しゴム
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Eraser : MonoBehaviour {
void OnTriggerEnter(Collider other)
{
if(other.tag == "Pen")
{
Destroy(other.gameObject);
@takoyakiroom
takoyakiroom / BodyCollider.cs
Last active September 12, 2020 12:34
BodyCollider
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: Collider dangling from the player's head
//
//=============================================================================
using UnityEngine;
using System.Collections;
namespace Valve.VR.InteractionSystem
@takoyakiroom
takoyakiroom / Walkable.cs
Last active September 12, 2020 12:36
Walkable
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Walkable : MonoBehaviour
{
public Transform head;
public Transform bodyCollider;
// Start is called before the first frame update
@takoyakiroom
takoyakiroom / Walkable.cs
Created September 12, 2020 14:40
Walkable
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Valve.VR;
public class Walkable : MonoBehaviour
{
public SteamVR_Action_Vector2 walkAction;
void Start()
@takoyakiroom
takoyakiroom / Walkable.cs
Last active September 12, 2020 15:00
Walkable
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Valve.VR;
using Valve.VR.InteractionSystem;
public class Walkable : MonoBehaviour
{
public Transform bodyCollider;
public SteamVR_Action_Vector2 walkAction;
@takoyakiroom
takoyakiroom / ColliderChanger.cs
Last active September 15, 2020 07:16
ColliderChanger
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Valve.VR.InteractionSystem
{
public class ColliderChanger : MonoBehaviour
{
private void OnHandHoverBegin(Hand hand)
{