{"action":"created","comment":{"url":"https://api.github.com/repos/Capstrong/Godlands/pulls/comments/24558000","id":24558000,"diff_hunk":"@@ -0,0 +1,89 @@\n+﻿using UnityEngine;\n+using System.Collections;\n+\n+[RequireComponent( typeof( PlayerActorStats ) )]\n+public class CuttingA : ActorComponent\n+{\n+\n+\t[SerializeField] LayerMask _cutableLayer = 0;\n+\t[SerializeField] KeyCode _cuttingButton;\n+\t[SerializeField] float _cuttingDistance = 0f;\n+\t[SerializeField] GameObject _visualEffect = null;\n+\t[SerializeField] Vector3 _visualOffset;\n+\n+\tPlayerActorStats actorStats = null;\n+\n+\t// Use this for initialization\n+\tvoid Start ()\n+\t{\n+\t\tactorStats = GetComponent<PlayerActorStats>();\n+\t}\n+\t\n+\t// Update is called once per frame\n+\tvoid Update ()\n+\t{\n+\t\tif ( Input.GetKeyDown( _cuttingButton ) )\n+\t\t{\n+\t\t\tVector3 camForward = Camera.main.transform.forward;\n+\t\t\tcamForward.Set( camForward.x, 0, camForward.z );\n+\n+\t\t\tactor.model.transform.forward = camForward;\n+\n+\t\t\tVector3 rotatedOffset = actor.model.transform.rotation * _visualOffset;\n+\n+\t\t\tInstantiate( _visualEffect, transform.position + rotatedOffset, actor.model.transform.rotation );\n+\n+\t\t\tRaycastHit hitInfo;\n+\t\t\tPhysics.Raycast( new Ray( transform.position, actor.model.transform.forward ), out hitInfo, _cuttingDistance, _cutableLayer );\n+\n+\t\t\tif ( hitInfo.collider )\n+\t\t\t{\n+\t\t\t\tGameObject cutableObj = hitInfo.collider.gameObject;\n+\n+\t\t\t\tCutableA cutableComponent = cutableObj.GetComponent<CutableA>();\n+\n+\t\t\t\tif ( cutableComponent )\n+\t\t\t\t{\n+\t\t\t\t\tCut( cutableComponent );\n+\t\t\t\t}\n+\t\t\t\telse\n+\t\t\t\t{\n+\t\t\t\t\tCutableB cutableComponentB = cutableObj.GetComponent<CutableB>();\n+\n+\t\t\t\t\tif ( cutableComponentB )\n+\t\t\t\t\t{\n+\t\t\t\t\t\tCut( cutableComponentB );\n+\t\t\t\t\t}\n+\t\t\t\t\telse\n+\t\t\t\t\t{\n+\t\t\t\t\t\tCutableC cutableComponentC = cutableObj.GetComponent<CutableC>();\n+\n+\t\t\t\t\t\tif ( cutableComponentC )\n+\t\t\t\t\t\t{\n+\t\t\t\t\t\t\tCut( cutableComponentC );\n+\t\t\t\t\t\t}\n+\t\t\t\t\t\telse\n+\t\t\t\t\t\t{\n+\t\t\t\t\t\t\tDebug.LogError( \"Attach Cutable component to \" + cutableObj.name + \" at \" + cutableObj.transform.position );\n+\t\t\t\t\t\t}\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\t\t\t}","path":"Assets/Scripts/CuttingPrototypes/CuttingA.cs","position":71,"original_position":71,"commit_id":"fb37d4ed2d5f8fe6f65c7562b27dcfd573bfb268","original_commit_id":"fb37d4ed2d5f8fe6f65c7562b27dcfd573bfb268","user":{"login":"cjacobwade","id":4643180,"avatar_url":"https://avatars.githubusercontent.com/u/4643180?v=3","gravatar_id":"","url":"https://api.github.com/users/cjacobwade","html_url":"https://github.com/cjacobwade","followers_url":"https://api.github.com/users/cjacobwade/followers","following_url":"https://api.github.com/users/cjacobwade/following{/other_user}","gists_url":"https://api.github.com/users/cjacobwade/gists{/gist_id}","starred_url":"https://api.github.com/users/cjacobwade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjacobwade/subscriptions","organizations_url":"https://api.github.com/users/cjacobwade/orgs","repos_url":"https://api.github.com/users/cjacobwade/repos","events_url":"https://api.github.com/users/cjacobwade/events{/privacy}","received_events_url":"https://api.github.com/users/cjacobwade/received_events","type":"User","site_admin":false},"body":"I know this code is going to get changed, but a better way to organize this would be to have the CutablesA,B,C inherit from a base Cubtable and just call cut directly w/ polymorphism.","created_at":"2015-02-12T04:32:40Z","updated_at":"2015-02-12T04:32:40Z","html_url":"https://github.com/Capstrong/Godlands/pull/38#discussion_r24558000","pull_request_url":"https://api.github.com/repos/Capstrong/Godlands/pulls/38","_links":{"self":{"href":"https://api.github.com/repos/Capstrong/Godlands/pulls/comments/24558000"},"html":{"href":"https://github.com/Capstrong/Godlands/pull/38#discussion_r24558000"},"pull_request":{"href":"https://api.github.com/repos/Capstrong/Godlands/pulls/38"}}},"pull_request":{"url":"https://api.github.com/repos/Capstrong/Godlands/pulls/38","id":29151577,"html_url":"https://github.com/Capstrong/Godlands/pull/38","diff_url":"https://github.com/Capstrong/Godlands/pull/38.diff","patch_url":"https://github.com/Capstrong/Godlands/pull/38.patch","issue_url":"https://api.github.com/repos/Capstrong/Godlands/issues/38","number":38,"state":"open","locked":false,"title":"Cutting","user":{"login":"brickman1444","id":598011,"avatar_url":"https://avatars.githubusercontent.com/u/598011?v=3","gravatar_id":"","url":"https://api.github.com/users/brickman1444","html_url":"https://github.com/brickman1444","followers_url":"https://api.github.com/users/brickman1444/followers","following_url":"https://api.github.com/users/brickman1444/following{/other_user}","gists_url":"https://api.github.com/users/brickman1444/gists{/gist_id}","starred_url":"https://api.github.com/users/brickman1444/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brickman1444/subscriptions","organizations_url":"https://api.github.com/users/brickman1444/orgs","repos_url":"https://api.github.com/users/brickman1444/repos","events_url":"https://api.github.com/users/brickman1444/events{/privacy}","received_events_url":"https://api.github.com/users/brickman1444/received_events","type":"User","site_admin":false},"body":"Three cutting prototypes in a separate scene.\r\nNot very well done code organization. I know it.","created_at":"2015-02-12T04:08:16Z","updated_at":"2015-02-12T04:32:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d8c244f2f020c2be87754e60b56dc655994fef45","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Capstrong/Godlands/pulls/38/commits","review_comments_url":"https://api.github.com/repos/Capstrong/Godlands/pulls/38/comments","review_comment_url":"https://api.github.com/repos/Capstrong/Godlands/pulls/comments/{number}","comments_url":"https://api.github.com/repos/Capstrong/Godlands/issues/38/comments","statuses_url":"https://api.github.com/repos/Capstrong/Godlands/statuses/fb37d4ed2d5f8fe6f65c7562b27dcfd573bfb268","head":{"label":"Capstrong:cutting","ref":"cutting","sha":"fb37d4ed2d5f8fe6f65c7562b27dcfd573bfb268","user":{"login":"Capstrong","id":10466570,"avatar_url":"https://avatars.githubusercontent.com/u/10466570?v=3","gravatar_id":"","url":"https://api.github.com/users/Capstrong","html_url":"https://github.com/Capstrong","followers_url":"https://api.github.com/users/Capstrong/followers","following_url":"https://api.github.com/users/Capstrong/following{/other_user}","gists_url":"https://api.github.com/users/Capstrong/gists{/gist_id}","starred_url":"https://api.github.com/users/Capstrong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Capstrong/subscriptions","organizations_url":"https://api.github.com/users/Capstrong/orgs","repos_url":"https://api.github.com/users/Capstrong/repos","events_url":"https://api.github.com/users/Capstrong/events{/privacy}","received_events_url":"https://api.github.com/users/Capstrong/received_events","type":"Organization","site_admin":false},"repo":{"id":29553492,"name":"Godlands","full_name":"Capstrong/Godlands","owner":{"login":"Capstrong","id":10466570,"avatar_url":"https://avatars.githubusercontent.com/u/10466570?v=3","gravatar_id":"","url":"https://api.github.com/users/Capstrong","html_url":"https://github.com/Capstrong","followers_url":"https://api.github.com/users/Capstrong/followers","following_url":"https://api.github.com/users/Capstrong/following{/other_user}","gists_url":"https://api.github.com/users/Capstrong/gists{/gist_id}","starred_url":"https://api.github.com/users/Capstrong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Capstrong/subscriptions","organizations_url":"https://api.github.com/users/Capstrong/orgs","repos_url":"https://api.github.com/users/Capstrong/repos","events_url":"https://api.github.com/users/Capstrong/events{/privacy}","received_events_url":"https://api.github.com/users/Capstrong/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Capstrong/Godlands","description":"Actual game for the Capstrong DePaul capstone team","fork":false,"url":"https://api.github.com/repos/Capstrong/Godlands","forks_url":"https://api.github.com/repos/Capstrong/Godlands/forks","keys_url":"https://api.github.com/repos/Capstrong/Godlands/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Capstrong/Godlands/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Capstrong/Godlands/teams","hooks_url":"https://api.github.com/repos/Capstrong/Godlands/hooks","issue_events_url":"https://api.github.com/repos/Capstrong/Godlands/issues/events{/number}","events_url":"https://api.github.com/repos/Capstrong/Godlands/events","assignees_url":"https://api.github.com/repos/Capstrong/Godlands/assignees{/user}","branches_url":"https://api.github.com/repos/Capstrong/Godlands/branches{/branch}","tags_url":"https://api.github.com/repos/Capstrong/Godlands/tags","blobs_url":"https://api.github.com/repos/Capstrong/Godlands/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Capstrong/Godlands/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Capstrong/Godlands/git/refs{/sha}","trees_url":"https://api.github.com/repos/Capstrong/Godlands/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Capstrong/Godlands/statuses/{sha}","languages_url":"https://api.github.com/repos/Capstrong/Godlands/languages","stargazers_url":"https://api.github.com/repos/Capstrong/Godlands/stargazers","contributors_url":"https://api.github.com/repos/Capstrong/Godlands/contributors","subscribers_url":"https://api.github.com/repos/Capstrong/Godlands/subscribers","subscription_url":"https://api.github.com/repos/Capstrong/Godlands/subscription","commits_url":"https://api.github.com/repos/Capstrong/Godlands/commits{/sha}","git_commits_url":"https://api.github.com/repos/Capstrong/Godlands/git/commits{/sha}","comments_url":"https://api.github.com/repos/Capstrong/Godlands/comments{/number}","issue_comment_url":"https://api.github.com/repos/Capstrong/Godlands/issues/comments/{number}","contents_url":"https://api.github.com/repos/Capstrong/Godlands/contents/{+path}","compare_url":"https://api.github.com/repos/Capstrong/Godlands/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Capstrong/Godlands/merges","archive_url":"https://api.github.com/repos/Capstrong/Godlands/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Capstrong/Godlands/downloads","issues_url":"https://api.github.com/repos/Capstrong/Godlands/issues{/number}","pulls_url":"https://api.github.com/repos/Capstrong/Godlands/pulls{/number}","milestones_url":"https://api.github.com/repos/Capstrong/Godlands/milestones{/number}","notifications_url":"https://api.github.com/repos/Capstrong/Godlands/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Capstrong/Godlands/labels{/name}","releases_url":"https://api.github.com/repos/Capstrong/Godlands/releases{/id}","created_at":"2015-01-20T21:37:50Z","updated_at":"2015-02-12T04:21:40Z","pushed_at":"2015-02-12T04:21:38Z","git_url":"git://github.com/Capstrong/Godlands.git","ssh_url":"git@github.com:Capstrong/Godlands.git","clone_url":"https://github.com/Capstrong/Godlands.git","svn_url":"https://github.com/Capstrong/Godlands","homepage":null,"size":164248,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":11,"forks":0,"open_issues":11,"watchers":0,"default_branch":"master"}},"base":{"label":"Capstrong:master","ref":"master","sha":"e1cec8f64292c515dbd613e66a608ae3dd4ad967","user":{"login":"Capstrong","id":10466570,"avatar_url":"https://avatars.githubusercontent.com/u/10466570?v=3","gravatar_id":"","url":"https://api.github.com/users/Capstrong","html_url":"https://github.com/Capstrong","followers_url":"https://api.github.com/users/Capstrong/followers","following_url":"https://api.github.com/users/Capstrong/following{/other_user}","gists_url":"https://api.github.com/users/Capstrong/gists{/gist_id}","starred_url":"https://api.github.com/users/Capstrong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Capstrong/subscriptions","organizations_url":"https://api.github.com/users/Capstrong/orgs","repos_url":"https://api.github.com/users/Capstrong/repos","events_url":"https://api.github.com/users/Capstrong/events{/privacy}","received_events_url":"https://api.github.com/users/Capstrong/received_events","type":"Organization","site_admin":false},"repo":{"id":29553492,"name":"Godlands","full_name":"Capstrong/Godlands","owner":{"login":"Capstrong","id":10466570,"avatar_url":"https://avatars.githubusercontent.com/u/10466570?v=3","gravatar_id":"","url":"https://api.github.com/users/Capstrong","html_url":"https://github.com/Capstrong","followers_url":"https://api.github.com/users/Capstrong/followers","following_url":"https://api.github.com/users/Capstrong/following{/other_user}","gists_url":"https://api.github.com/users/Capstrong/gists{/gist_id}","starred_url":"https://api.github.com/users/Capstrong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Capstrong/subscriptions","organizations_url":"https://api.github.com/users/Capstrong/orgs","repos_url":"https://api.github.com/users/Capstrong/repos","events_url":"https://api.github.com/users/Capstrong/events{/privacy}","received_events_url":"https://api.github.com/users/Capstrong/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Capstrong/Godlands","description":"Actual game for the Capstrong DePaul capstone team","fork":false,"url":"https://api.github.com/repos/Capstrong/Godlands","forks_url":"https://api.github.com/repos/Capstrong/Godlands/forks","keys_url":"https://api.github.com/repos/Capstrong/Godlands/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Capstrong/Godlands/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Capstrong/Godlands/teams","hooks_url":"https://api.github.com/repos/Capstrong/Godlands/hooks","issue_events_url":"https://api.github.com/repos/Capstrong/Godlands/issues/events{/number}","events_url":"https://api.github.com/repos/Capstrong/Godlands/events","assignees_url":"https://api.github.com/repos/Capstrong/Godlands/assignees{/user}","branches_url":"https://api.github.com/repos/Capstrong/Godlands/branches{/branch}","tags_url":"https://api.github.com/repos/Capstrong/Godlands/tags","blobs_url":"https://api.github.com/repos/Capstrong/Godlands/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Capstrong/Godlands/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Capstrong/Godlands/git/refs{/sha}","trees_url":"https://api.github.com/repos/Capstrong/Godlands/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Capstrong/Godlands/statuses/{sha}","languages_url":"https://api.github.com/repos/Capstrong/Godlands/languages","stargazers_url":"https://api.github.com/repos/Capstrong/Godlands/stargazers","contributors_url":"https://api.github.com/repos/Capstrong/Godlands/contributors","subscribers_url":"https://api.github.com/repos/Capstrong/Godlands/subscribers","subscription_url":"https://api.github.com/repos/Capstrong/Godlands/subscription","commits_url":"https://api.github.com/repos/Capstrong/Godlands/commits{/sha}","git_commits_url":"https://api.github.com/repos/Capstrong/Godlands/git/commits{/sha}","comments_url":"https://api.github.com/repos/Capstrong/Godlands/comments{/number}","issue_comment_url":"https://api.github.com/repos/Capstrong/Godlands/issues/comments/{number}","contents_url":"https://api.github.com/repos/Capstrong/Godlands/contents/{+path}","compare_url":"https://api.github.com/repos/Capstrong/Godlands/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Capstrong/Godlands/merges","archive_url":"https://api.github.com/repos/Capstrong/Godlands/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Capstrong/Godlands/downloads","issues_url":"https://api.github.com/repos/Capstrong/Godlands/issues{/number}","pulls_url":"https://api.github.com/repos/Capstrong/Godlands/pulls{/number}","milestones_url":"https://api.github.com/repos/Capstrong/Godlands/milestones{/number}","notifications_url":"https://api.github.com/repos/Capstrong/Godlands/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Capstrong/Godlands/labels{/name}","releases_url":"https://api.github.com/repos/Capstrong/Godlands/releases{/id}","created_at":"2015-01-20T21:37:50Z","updated_at":"2015-02-12T04:21:40Z","pushed_at":"2015-02-12T04:21:38Z","git_url":"git://github.com/Capstrong/Godlands.git","ssh_url":"git@github.com:Capstrong/Godlands.git","clone_url":"https://github.com/Capstrong/Godlands.git","svn_url":"https://github.com/Capstrong/Godlands","homepage":null,"size":164248,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":11,"forks":0,"open_issues":11,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Capstrong/Godlands/pulls/38"},"html":{"href":"https://github.com/Capstrong/Godlands/pull/38"},"issue":{"href":"https://api.github.com/repos/Capstrong/Godlands/issues/38"},"comments":{"href":"https://api.github.com/repos/Capstrong/Godlands/issues/38/comments"},"review_comments":{"href":"https://api.github.com/repos/Capstrong/Godlands/pulls/38/comments"},"review_comment":{"href":"https://api.github.com/repos/Capstrong/Godlands/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/Capstrong/Godlands/pulls/38/commits"},"statuses":{"href":"https://api.github.com/repos/Capstrong/Godlands/statuses/fb37d4ed2d5f8fe6f65c7562b27dcfd573bfb268"}}}}