Skip to content

Instantly share code, notes, and snippets.

@cslroot
Last active September 21, 2015 07:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cslroot/4eb475710a11f87f174e to your computer and use it in GitHub Desktop.
Save cslroot/4eb475710a11f87f174e to your computer and use it in GitHub Desktop.
UnityRayTrace0-1 diff
//---- 各ピクセルの色を,当たったかどうかで変更する -----
var ray = mainCamera.ScreenPointToRay(new Vector3(w, h, 0.0f)); // カメラからのレイの生成
RaycastHit hit;
if (Physics.Raycast(ray, out hit)) {
c = new Color(1.0f, 1.0f, 1.0f, 1.0f); // 当たった場合は白(当たらない場合は変更なし)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment