{"action":"created","comment":{"url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/pulls/comments/73101848","id":73101848,"diff_hunk":"@@ -0,0 +1,188 @@\n+﻿namespace VRTK\n+{\n+    using UnityEngine;\n+    using System.Collections;\n+\n+    public struct PlayerClimbEventArgs\n+    {\n+        public uint controllerIndex;\n+        public GameObject target;\n+    }\n+\n+    public delegate void PlayerClimbEventHandler(object sender, PlayerClimbEventArgs e);\n+\n+    public class VRTK_PlayerClimb : MonoBehaviour\n+    {\n+        public event PlayerClimbEventHandler PlayerClimbStarted;\n+        public event PlayerClimbEventHandler PlayerClimbEnded;\n+\n+        public bool usePlayerScale = true;\n+        public bool useGravity = true;\n+\n+        private Transform controllerTransform;\n+        private Vector3 startControllerPosition;\n+        private Vector3 startPosition;\n+\n+        private Vector3 lastGoodHeadsetPosition;\n+        private bool headsetColliding = false;\n+        private bool isClimbing = false;\n+\n+        VRTK_PlayerPhysics playerPhysics;\n+        private bool lastGravitySetting;\n+\n+        public virtual void OnPlayerClimbStarted(PlayerClimbEventArgs e)\n+        {\n+            if (PlayerClimbStarted != null)\n+                PlayerClimbStarted(this, e);\n+        }\n+\n+        public virtual void OnPlayerClimbEnded(PlayerClimbEventArgs e)\n+        {\n+            if (PlayerClimbEnded != null)\n+                PlayerClimbEnded(this, e);\n+        }\n+\n+        protected PlayerClimbEventArgs SetPlayerClimbEvent(uint controllerIndex, GameObject target)\n+        {\n+            PlayerClimbEventArgs e;\n+            e.controllerIndex = controllerIndex;\n+            e.target = target;\n+            return e;\n+        }\n+\n+        private void Start()\n+        {\n+            var controllerManager = GameObject.FindObjectOfType<SteamVR_ControllerManager>();\n+            InitControllerListeners(controllerManager.left);\n+            InitControllerListeners(controllerManager.right);\n+\n+            // Listen for teleport events \n+            VRTK_BasicTeleport teleportComponent = GetComponent<VRTK_BasicTeleport>();\n+            if (teleportComponent)\n+            {\n+                teleportComponent.Teleporting += new TeleportEventHandler(OnTeleport);\n+            } \n+\n+            // Required Components\n+\n+            // VRTK_PlayerPhysics\n+            playerPhysics = GetComponent<VRTK_PlayerPhysics>();\n+            if (!playerPhysics && useGravity)\n+            {\n+                playerPhysics = gameObject.AddComponent<VRTK_PlayerPhysics>();\n+            }\n+\n+            // VRTK_HeadsetCollisionFade\n+            Transform headCamera = GameObject.FindObjectOfType<SteamVR_GameView>().GetComponent<Transform>();\n+            VRTK_HeadsetCollisionFade collisionFade = headCamera.GetComponent<VRTK_HeadsetCollisionFade>();\n+            if (collisionFade == null)\n+            {\n+                collisionFade = headCamera.gameObject.AddComponent<VRTK_HeadsetCollisionFade>();\n+            }\n+            collisionFade.HeadsetCollisionDetect += new HeadsetCollisionEventHandler(OnHeadsetCollisionDetected);\n+            collisionFade.HeadsetCollisionEnded += new HeadsetCollisionEventHandler(OnHeadsetCollisionEnded);\n+        }\n+\n+        private Vector3 GetPosition(Transform objTransform)\n+        {\n+            if (usePlayerScale)\n+            {\n+                return Vector3.Scale(objTransform.localPosition, gameObject.transform.localScale);\n+            }\n+\n+            return objTransform.localPosition;\n+        }\n+\n+    \n+        private void OnGrabObject(object sender, ObjectInteractEventArgs e)\n+        {\n+            VRTK_InteractableObject interactObject = e.target.GetComponent<VRTK_InteractableObject>();\n+            if( interactObject && interactObject.AttachIsClimbObject() )\n+            {\n+                if (useGravity)\n+                {\n+                    playerPhysics.StopPhysicsFall();\n+                }\n+\n+                OnPlayerClimbStarted(SetPlayerClimbEvent(e.controllerIndex, e.target));\n+                isClimbing = true;\n+                controllerTransform = ((VRTK_InteractGrab)sender).gameObject.transform;","path":"Assets/SteamVR_Unity_Toolkit/Scripts/VRTK_PlayerClimb.cs","position":109,"original_position":109,"commit_id":"8940bb9e135ca03dbd8dc797f741918e5f458e42","original_commit_id":"8940bb9e135ca03dbd8dc797f741918e5f458e42","user":{"login":"mattboy64","id":7003769,"avatar_url":"https://avatars.githubusercontent.com/u/7003769?v=3","gravatar_id":"","url":"https://api.github.com/users/mattboy64","html_url":"https://github.com/mattboy64","followers_url":"https://api.github.com/users/mattboy64/followers","following_url":"https://api.github.com/users/mattboy64/following{/other_user}","gists_url":"https://api.github.com/users/mattboy64/gists{/gist_id}","starred_url":"https://api.github.com/users/mattboy64/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattboy64/subscriptions","organizations_url":"https://api.github.com/users/mattboy64/orgs","repos_url":"https://api.github.com/users/mattboy64/repos","events_url":"https://api.github.com/users/mattboy64/events{/privacy}","received_events_url":"https://api.github.com/users/mattboy64/received_events","type":"User","site_admin":false},"body":"Well, Unity's not yelling at me, so maybe not ;)\r\n","created_at":"2016-08-02T06:46:25Z","updated_at":"2016-08-02T06:46:25Z","html_url":"https://github.com/thestonefox/SteamVR_Unity_Toolkit/pull/330#discussion_r73101848","pull_request_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/pulls/330","_links":{"self":{"href":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/pulls/comments/73101848"},"html":{"href":"https://github.com/thestonefox/SteamVR_Unity_Toolkit/pull/330#discussion_r73101848"},"pull_request":{"href":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/pulls/330"}}},"pull_request":{"url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/pulls/330","id":79509517,"html_url":"https://github.com/thestonefox/SteamVR_Unity_Toolkit/pull/330","diff_url":"https://github.com/thestonefox/SteamVR_Unity_Toolkit/pull/330.diff","patch_url":"https://github.com/thestonefox/SteamVR_Unity_Toolkit/pull/330.patch","issue_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/issues/330","number":330,"state":"open","locked":false,"title":"feat(Climbing): add ability to use controllers to climb objects","user":{"login":"mattboy64","id":7003769,"avatar_url":"https://avatars.githubusercontent.com/u/7003769?v=3","gravatar_id":"","url":"https://api.github.com/users/mattboy64","html_url":"https://github.com/mattboy64","followers_url":"https://api.github.com/users/mattboy64/followers","following_url":"https://api.github.com/users/mattboy64/following{/other_user}","gists_url":"https://api.github.com/users/mattboy64/gists{/gist_id}","starred_url":"https://api.github.com/users/mattboy64/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattboy64/subscriptions","organizations_url":"https://api.github.com/users/mattboy64/orgs","repos_url":"https://api.github.com/users/mattboy64/repos","events_url":"https://api.github.com/users/mattboy64/events{/privacy}","received_events_url":"https://api.github.com/users/mattboy64/received_events","type":"User","site_admin":false},"body":null,"created_at":"2016-08-01T03:44:19Z","updated_at":"2016-08-02T06:46:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"994feee0d2c60bb6df068ce6327bcbb6c056f93c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/pulls/330/commits","review_comments_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/pulls/330/comments","review_comment_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/issues/330/comments","statuses_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/statuses/8940bb9e135ca03dbd8dc797f741918e5f458e42","head":{"label":"mattboy64:featureClimbing00","ref":"featureClimbing00","sha":"8940bb9e135ca03dbd8dc797f741918e5f458e42","user":{"login":"mattboy64","id":7003769,"avatar_url":"https://avatars.githubusercontent.com/u/7003769?v=3","gravatar_id":"","url":"https://api.github.com/users/mattboy64","html_url":"https://github.com/mattboy64","followers_url":"https://api.github.com/users/mattboy64/followers","following_url":"https://api.github.com/users/mattboy64/following{/other_user}","gists_url":"https://api.github.com/users/mattboy64/gists{/gist_id}","starred_url":"https://api.github.com/users/mattboy64/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattboy64/subscriptions","organizations_url":"https://api.github.com/users/mattboy64/orgs","repos_url":"https://api.github.com/users/mattboy64/repos","events_url":"https://api.github.com/users/mattboy64/events{/privacy}","received_events_url":"https://api.github.com/users/mattboy64/received_events","type":"User","site_admin":false},"repo":{"id":64607662,"name":"SteamVR_Unity_Toolkit","full_name":"mattboy64/SteamVR_Unity_Toolkit","owner":{"login":"mattboy64","id":7003769,"avatar_url":"https://avatars.githubusercontent.com/u/7003769?v=3","gravatar_id":"","url":"https://api.github.com/users/mattboy64","html_url":"https://github.com/mattboy64","followers_url":"https://api.github.com/users/mattboy64/followers","following_url":"https://api.github.com/users/mattboy64/following{/other_user}","gists_url":"https://api.github.com/users/mattboy64/gists{/gist_id}","starred_url":"https://api.github.com/users/mattboy64/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattboy64/subscriptions","organizations_url":"https://api.github.com/users/mattboy64/orgs","repos_url":"https://api.github.com/users/mattboy64/repos","events_url":"https://api.github.com/users/mattboy64/events{/privacy}","received_events_url":"https://api.github.com/users/mattboy64/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mattboy64/SteamVR_Unity_Toolkit","description":"A collection of useful scripts and prefabs for building SteamVR titles in Unity 5","fork":true,"url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit","forks_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/forks","keys_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/teams","hooks_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/hooks","issue_events_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/issues/events{/number}","events_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/events","assignees_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/assignees{/user}","branches_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/branches{/branch}","tags_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/tags","blobs_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/git/refs{/sha}","trees_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/statuses/{sha}","languages_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/languages","stargazers_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/stargazers","contributors_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/contributors","subscribers_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/subscribers","subscription_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/subscription","commits_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/commits{/sha}","git_commits_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/git/commits{/sha}","comments_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/comments{/number}","issue_comment_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/issues/comments{/number}","contents_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/contents/{+path}","compare_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/merges","archive_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/downloads","issues_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/issues{/number}","pulls_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/pulls{/number}","milestones_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/milestones{/number}","notifications_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/labels{/name}","releases_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/releases{/id}","deployments_url":"https://api.github.com/repos/mattboy64/SteamVR_Unity_Toolkit/deployments","created_at":"2016-07-31T18:00:20Z","updated_at":"2016-07-31T18:00:22Z","pushed_at":"2016-08-01T03:44:18Z","git_url":"git://github.com/mattboy64/SteamVR_Unity_Toolkit.git","ssh_url":"git@github.com:mattboy64/SteamVR_Unity_Toolkit.git","clone_url":"https://github.com/mattboy64/SteamVR_Unity_Toolkit.git","svn_url":"https://github.com/mattboy64/SteamVR_Unity_Toolkit","homepage":null,"size":70925,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"thestonefox:master","ref":"master","sha":"cbb9e6363b068fba8b50314d355aa2a0127594fd","user":{"login":"thestonefox","id":1029673,"avatar_url":"https://avatars.githubusercontent.com/u/1029673?v=3","gravatar_id":"","url":"https://api.github.com/users/thestonefox","html_url":"https://github.com/thestonefox","followers_url":"https://api.github.com/users/thestonefox/followers","following_url":"https://api.github.com/users/thestonefox/following{/other_user}","gists_url":"https://api.github.com/users/thestonefox/gists{/gist_id}","starred_url":"https://api.github.com/users/thestonefox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thestonefox/subscriptions","organizations_url":"https://api.github.com/users/thestonefox/orgs","repos_url":"https://api.github.com/users/thestonefox/repos","events_url":"https://api.github.com/users/thestonefox/events{/privacy}","received_events_url":"https://api.github.com/users/thestonefox/received_events","type":"User","site_admin":false},"repo":{"id":56940351,"name":"SteamVR_Unity_Toolkit","full_name":"thestonefox/SteamVR_Unity_Toolkit","owner":{"login":"thestonefox","id":1029673,"avatar_url":"https://avatars.githubusercontent.com/u/1029673?v=3","gravatar_id":"","url":"https://api.github.com/users/thestonefox","html_url":"https://github.com/thestonefox","followers_url":"https://api.github.com/users/thestonefox/followers","following_url":"https://api.github.com/users/thestonefox/following{/other_user}","gists_url":"https://api.github.com/users/thestonefox/gists{/gist_id}","starred_url":"https://api.github.com/users/thestonefox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thestonefox/subscriptions","organizations_url":"https://api.github.com/users/thestonefox/orgs","repos_url":"https://api.github.com/users/thestonefox/repos","events_url":"https://api.github.com/users/thestonefox/events{/privacy}","received_events_url":"https://api.github.com/users/thestonefox/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thestonefox/SteamVR_Unity_Toolkit","description":"A collection of useful scripts and prefabs for building SteamVR titles in Unity 5","fork":false,"url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit","forks_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/forks","keys_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/teams","hooks_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/hooks","issue_events_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/issues/events{/number}","events_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/events","assignees_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/assignees{/user}","branches_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/branches{/branch}","tags_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/tags","blobs_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/git/refs{/sha}","trees_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/statuses/{sha}","languages_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/languages","stargazers_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/stargazers","contributors_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/contributors","subscribers_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/subscribers","subscription_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/subscription","commits_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/commits{/sha}","git_commits_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/git/commits{/sha}","comments_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/comments{/number}","issue_comment_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/issues/comments{/number}","contents_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/contents/{+path}","compare_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/merges","archive_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/downloads","issues_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/issues{/number}","pulls_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/pulls{/number}","milestones_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/milestones{/number}","notifications_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/labels{/name}","releases_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/releases{/id}","deployments_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/deployments","created_at":"2016-04-23T20:55:19Z","updated_at":"2016-08-02T05:28:58Z","pushed_at":"2016-08-02T04:22:06Z","git_url":"git://github.com/thestonefox/SteamVR_Unity_Toolkit.git","ssh_url":"git@github.com:thestonefox/SteamVR_Unity_Toolkit.git","clone_url":"https://github.com/thestonefox/SteamVR_Unity_Toolkit.git","svn_url":"https://github.com/thestonefox/SteamVR_Unity_Toolkit","homepage":null,"size":73265,"stargazers_count":613,"watchers_count":613,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":116,"mirror_url":null,"open_issues_count":60,"forks":116,"open_issues":60,"watchers":613,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/pulls/330"},"html":{"href":"https://github.com/thestonefox/SteamVR_Unity_Toolkit/pull/330"},"issue":{"href":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/issues/330"},"comments":{"href":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/issues/330/comments"},"review_comments":{"href":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/pulls/330/comments"},"review_comment":{"href":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/pulls/330/commits"},"statuses":{"href":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/statuses/8940bb9e135ca03dbd8dc797f741918e5f458e42"}}}}
{"actor":{"display_login":"mattboy64"}}