{"action":"closed","number":31,"pull_request":{"url":"https://api.github.com/repos/pangweiwei/slua/pulls/31","id":35195504,"html_url":"https://github.com/pangweiwei/slua/pull/31","diff_url":"https://github.com/pangweiwei/slua/pull/31.diff","patch_url":"https://github.com/pangweiwei/slua/pull/31.patch","issue_url":"https://api.github.com/repos/pangweiwei/slua/issues/31","number":31,"state":"closed","locked":false,"title":"Add `As` method","user":{"login":"yongkangchen","id":704762,"avatar_url":"https://avatars.githubusercontent.com/u/704762?v=3","gravatar_id":"","url":"https://api.github.com/users/yongkangchen","html_url":"https://github.com/yongkangchen","followers_url":"https://api.github.com/users/yongkangchen/followers","following_url":"https://api.github.com/users/yongkangchen/following{/other_user}","gists_url":"https://api.github.com/users/yongkangchen/gists{/gist_id}","starred_url":"https://api.github.com/users/yongkangchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yongkangchen/subscriptions","organizations_url":"https://api.github.com/users/yongkangchen/orgs","repos_url":"https://api.github.com/users/yongkangchen/repos","events_url":"https://api.github.com/users/yongkangchen/events{/privacy}","received_events_url":"https://api.github.com/users/yongkangchen/received_events","type":"User","site_admin":false},"body":"So we can use a object as it's parent type. For example:\r\n`obj` is a instance of class `FishEye`, and we did not need to export this class or use the object by reflection. We only want to use the `obj` as `UnityEngine.Behaviour` so we can call `obj.enabled = true`.\r\n\r\n```\r\nlocal obj = Slua.As(camera_boom:GetComponent(\"FishEye\"), UnityEngine.Behaviour)\r\nobj.enabled = true\r\n```","created_at":"2015-05-12T06:01:12Z","updated_at":"2015-05-13T03:04:22Z","closed_at":"2015-05-13T03:04:22Z","merged_at":"2015-05-13T03:04:22Z","merge_commit_sha":"4f17798df9d893ae7481762e8ac72b888cc658ee","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pangweiwei/slua/pulls/31/commits","review_comments_url":"https://api.github.com/repos/pangweiwei/slua/pulls/31/comments","review_comment_url":"https://api.github.com/repos/pangweiwei/slua/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pangweiwei/slua/issues/31/comments","statuses_url":"https://api.github.com/repos/pangweiwei/slua/statuses/314143d3e1031a1de0d2a48aedba16448fb9ddc8","head":{"label":"yongkangchen:patch-4","ref":"patch-4","sha":"314143d3e1031a1de0d2a48aedba16448fb9ddc8","user":{"login":"yongkangchen","id":704762,"avatar_url":"https://avatars.githubusercontent.com/u/704762?v=3","gravatar_id":"","url":"https://api.github.com/users/yongkangchen","html_url":"https://github.com/yongkangchen","followers_url":"https://api.github.com/users/yongkangchen/followers","following_url":"https://api.github.com/users/yongkangchen/following{/other_user}","gists_url":"https://api.github.com/users/yongkangchen/gists{/gist_id}","starred_url":"https://api.github.com/users/yongkangchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yongkangchen/subscriptions","organizations_url":"https://api.github.com/users/yongkangchen/orgs","repos_url":"https://api.github.com/users/yongkangchen/repos","events_url":"https://api.github.com/users/yongkangchen/events{/privacy}","received_events_url":"https://api.github.com/users/yongkangchen/received_events","type":"User","site_admin":false},"repo":{"id":29244783,"name":"slua","full_name":"yongkangchen/slua","owner":{"login":"yongkangchen","id":704762,"avatar_url":"https://avatars.githubusercontent.com/u/704762?v=3","gravatar_id":"","url":"https://api.github.com/users/yongkangchen","html_url":"https://github.com/yongkangchen","followers_url":"https://api.github.com/users/yongkangchen/followers","following_url":"https://api.github.com/users/yongkangchen/following{/other_user}","gists_url":"https://api.github.com/users/yongkangchen/gists{/gist_id}","starred_url":"https://api.github.com/users/yongkangchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yongkangchen/subscriptions","organizations_url":"https://api.github.com/users/yongkangchen/orgs","repos_url":"https://api.github.com/users/yongkangchen/repos","events_url":"https://api.github.com/users/yongkangchen/events{/privacy}","received_events_url":"https://api.github.com/users/yongkangchen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yongkangchen/slua","description":"Unity lua binding via static code generating.","fork":true,"url":"https://api.github.com/repos/yongkangchen/slua","forks_url":"https://api.github.com/repos/yongkangchen/slua/forks","keys_url":"https://api.github.com/repos/yongkangchen/slua/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yongkangchen/slua/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yongkangchen/slua/teams","hooks_url":"https://api.github.com/repos/yongkangchen/slua/hooks","issue_events_url":"https://api.github.com/repos/yongkangchen/slua/issues/events{/number}","events_url":"https://api.github.com/repos/yongkangchen/slua/events","assignees_url":"https://api.github.com/repos/yongkangchen/slua/assignees{/user}","branches_url":"https://api.github.com/repos/yongkangchen/slua/branches{/branch}","tags_url":"https://api.github.com/repos/yongkangchen/slua/tags","blobs_url":"https://api.github.com/repos/yongkangchen/slua/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yongkangchen/slua/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yongkangchen/slua/git/refs{/sha}","trees_url":"https://api.github.com/repos/yongkangchen/slua/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yongkangchen/slua/statuses/{sha}","languages_url":"https://api.github.com/repos/yongkangchen/slua/languages","stargazers_url":"https://api.github.com/repos/yongkangchen/slua/stargazers","contributors_url":"https://api.github.com/repos/yongkangchen/slua/contributors","subscribers_url":"https://api.github.com/repos/yongkangchen/slua/subscribers","subscription_url":"https://api.github.com/repos/yongkangchen/slua/subscription","commits_url":"https://api.github.com/repos/yongkangchen/slua/commits{/sha}","git_commits_url":"https://api.github.com/repos/yongkangchen/slua/git/commits{/sha}","comments_url":"https://api.github.com/repos/yongkangchen/slua/comments{/number}","issue_comment_url":"https://api.github.com/repos/yongkangchen/slua/issues/comments{/number}","contents_url":"https://api.github.com/repos/yongkangchen/slua/contents/{+path}","compare_url":"https://api.github.com/repos/yongkangchen/slua/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yongkangchen/slua/merges","archive_url":"https://api.github.com/repos/yongkangchen/slua/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yongkangchen/slua/downloads","issues_url":"https://api.github.com/repos/yongkangchen/slua/issues{/number}","pulls_url":"https://api.github.com/repos/yongkangchen/slua/pulls{/number}","milestones_url":"https://api.github.com/repos/yongkangchen/slua/milestones{/number}","notifications_url":"https://api.github.com/repos/yongkangchen/slua/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yongkangchen/slua/labels{/name}","releases_url":"https://api.github.com/repos/yongkangchen/slua/releases{/id}","created_at":"2015-01-14T13:13:19Z","updated_at":"2015-04-29T09:26:03Z","pushed_at":"2015-05-12T05:55:13Z","git_url":"git://github.com/yongkangchen/slua.git","ssh_url":"git@github.com:yongkangchen/slua.git","clone_url":"https://github.com/yongkangchen/slua.git","svn_url":"https://github.com/yongkangchen/slua","homepage":null,"size":9844,"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":"pangweiwei:master","ref":"master","sha":"0838dc09081a756773be009fa0156ed93c7f67aa","user":{"login":"pangweiwei","id":6227270,"avatar_url":"https://avatars.githubusercontent.com/u/6227270?v=3","gravatar_id":"","url":"https://api.github.com/users/pangweiwei","html_url":"https://github.com/pangweiwei","followers_url":"https://api.github.com/users/pangweiwei/followers","following_url":"https://api.github.com/users/pangweiwei/following{/other_user}","gists_url":"https://api.github.com/users/pangweiwei/gists{/gist_id}","starred_url":"https://api.github.com/users/pangweiwei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pangweiwei/subscriptions","organizations_url":"https://api.github.com/users/pangweiwei/orgs","repos_url":"https://api.github.com/users/pangweiwei/repos","events_url":"https://api.github.com/users/pangweiwei/events{/privacy}","received_events_url":"https://api.github.com/users/pangweiwei/received_events","type":"User","site_admin":false},"repo":{"id":29187878,"name":"slua","full_name":"pangweiwei/slua","owner":{"login":"pangweiwei","id":6227270,"avatar_url":"https://avatars.githubusercontent.com/u/6227270?v=3","gravatar_id":"","url":"https://api.github.com/users/pangweiwei","html_url":"https://github.com/pangweiwei","followers_url":"https://api.github.com/users/pangweiwei/followers","following_url":"https://api.github.com/users/pangweiwei/following{/other_user}","gists_url":"https://api.github.com/users/pangweiwei/gists{/gist_id}","starred_url":"https://api.github.com/users/pangweiwei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pangweiwei/subscriptions","organizations_url":"https://api.github.com/users/pangweiwei/orgs","repos_url":"https://api.github.com/users/pangweiwei/repos","events_url":"https://api.github.com/users/pangweiwei/events{/privacy}","received_events_url":"https://api.github.com/users/pangweiwei/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pangweiwei/slua","description":"Fastest Unity lua binding via static code generating.","fork":false,"url":"https://api.github.com/repos/pangweiwei/slua","forks_url":"https://api.github.com/repos/pangweiwei/slua/forks","keys_url":"https://api.github.com/repos/pangweiwei/slua/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pangweiwei/slua/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pangweiwei/slua/teams","hooks_url":"https://api.github.com/repos/pangweiwei/slua/hooks","issue_events_url":"https://api.github.com/repos/pangweiwei/slua/issues/events{/number}","events_url":"https://api.github.com/repos/pangweiwei/slua/events","assignees_url":"https://api.github.com/repos/pangweiwei/slua/assignees{/user}","branches_url":"https://api.github.com/repos/pangweiwei/slua/branches{/branch}","tags_url":"https://api.github.com/repos/pangweiwei/slua/tags","blobs_url":"https://api.github.com/repos/pangweiwei/slua/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pangweiwei/slua/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pangweiwei/slua/git/refs{/sha}","trees_url":"https://api.github.com/repos/pangweiwei/slua/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pangweiwei/slua/statuses/{sha}","languages_url":"https://api.github.com/repos/pangweiwei/slua/languages","stargazers_url":"https://api.github.com/repos/pangweiwei/slua/stargazers","contributors_url":"https://api.github.com/repos/pangweiwei/slua/contributors","subscribers_url":"https://api.github.com/repos/pangweiwei/slua/subscribers","subscription_url":"https://api.github.com/repos/pangweiwei/slua/subscription","commits_url":"https://api.github.com/repos/pangweiwei/slua/commits{/sha}","git_commits_url":"https://api.github.com/repos/pangweiwei/slua/git/commits{/sha}","comments_url":"https://api.github.com/repos/pangweiwei/slua/comments{/number}","issue_comment_url":"https://api.github.com/repos/pangweiwei/slua/issues/comments{/number}","contents_url":"https://api.github.com/repos/pangweiwei/slua/contents/{+path}","compare_url":"https://api.github.com/repos/pangweiwei/slua/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pangweiwei/slua/merges","archive_url":"https://api.github.com/repos/pangweiwei/slua/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pangweiwei/slua/downloads","issues_url":"https://api.github.com/repos/pangweiwei/slua/issues{/number}","pulls_url":"https://api.github.com/repos/pangweiwei/slua/pulls{/number}","milestones_url":"https://api.github.com/repos/pangweiwei/slua/milestones{/number}","notifications_url":"https://api.github.com/repos/pangweiwei/slua/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pangweiwei/slua/labels{/name}","releases_url":"https://api.github.com/repos/pangweiwei/slua/releases{/id}","created_at":"2015-01-13T11:59:00Z","updated_at":"2015-05-11T06:14:56Z","pushed_at":"2015-05-13T03:04:22Z","git_url":"git://github.com/pangweiwei/slua.git","ssh_url":"git@github.com:pangweiwei/slua.git","clone_url":"https://github.com/pangweiwei/slua.git","svn_url":"https://github.com/pangweiwei/slua","homepage":"","size":11838,"stargazers_count":163,"watchers_count":163,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":81,"mirror_url":null,"open_issues_count":1,"forks":81,"open_issues":1,"watchers":163,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pangweiwei/slua/pulls/31"},"html":{"href":"https://github.com/pangweiwei/slua/pull/31"},"issue":{"href":"https://api.github.com/repos/pangweiwei/slua/issues/31"},"comments":{"href":"https://api.github.com/repos/pangweiwei/slua/issues/31/comments"},"review_comments":{"href":"https://api.github.com/repos/pangweiwei/slua/pulls/31/comments"},"review_comment":{"href":"https://api.github.com/repos/pangweiwei/slua/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pangweiwei/slua/pulls/31/commits"},"statuses":{"href":"https://api.github.com/repos/pangweiwei/slua/statuses/314143d3e1031a1de0d2a48aedba16448fb9ddc8"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"pangweiwei","id":6227270,"avatar_url":"https://avatars.githubusercontent.com/u/6227270?v=3","gravatar_id":"","url":"https://api.github.com/users/pangweiwei","html_url":"https://github.com/pangweiwei","followers_url":"https://api.github.com/users/pangweiwei/followers","following_url":"https://api.github.com/users/pangweiwei/following{/other_user}","gists_url":"https://api.github.com/users/pangweiwei/gists{/gist_id}","starred_url":"https://api.github.com/users/pangweiwei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pangweiwei/subscriptions","organizations_url":"https://api.github.com/users/pangweiwei/orgs","repos_url":"https://api.github.com/users/pangweiwei/repos","events_url":"https://api.github.com/users/pangweiwei/events{/privacy}","received_events_url":"https://api.github.com/users/pangweiwei/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":2,"additions":17,"deletions":3,"changed_files":2}}