SlideShare a Scribd company logo
클라이언트에서 나무 심기
넷텐션
클릭 처리
• 월드에 평면(plane)이 존재
• 평면에 마우스를 찍으면
• 마우스를 찍은 곳에 나무를 배치

– screen position to ray와 평면의 교차점에
// determine if clicked (release button)
bool pushing = Input.GetMouseButton(0);
bool clicked = Input.GetMouseButtonUp(0);
// pick object
var ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
GameObject pickedObject = null;
if (Physics.Raycast(ray, out hit))
{
pickedObject = hit.transform.root.gameObject;
var pos = hit.point;
}
나무 심기의 메시징 및 처리
1. click!
2. 나무 심고 싶다 (요청)
서버

클라이언트
4. 나무 심어졌다 통보

5. 나무 개체 생성

3. 나무 개체 생성
나무 없애기
• 나무 심기와 마찬가지
1. click!
2. 나무 없애고 싶다 (요청)
서버

클라이언트
4. 나무 없어졌다 통보

5. 나무 개체 제거

3. 나무 개체 제거

More Related Content

Viewers also liked

Social game programming footage 1 client to server connection
Social game programming footage 1 client to server connectionSocial game programming footage 1 client to server connection
Social game programming footage 1 client to server connection
Nettention
 
Social game programming footage 0 introduction
Social game programming footage 0 introductionSocial game programming footage 0 introduction
Social game programming footage 0 introduction
Nettention
 
Social game programming footage 4 realtime collaborated farming at server (pl...
Social game programming footage 4 realtime collaborated farming at server (pl...Social game programming footage 4 realtime collaborated farming at server (pl...
Social game programming footage 4 realtime collaborated farming at server (pl...
Nettention
 
Game Server Middleware 'ProudNet'
Game Server Middleware 'ProudNet'Game Server Middleware 'ProudNet'
Game Server Middleware 'ProudNet'
Nettention
 
Social game programming footage 2 rmi messages
Social game programming footage 2 rmi messagesSocial game programming footage 2 rmi messages
Social game programming footage 2 rmi messages
Nettention
 
Social game programming footage 7 loading and storing via db cache system
Social game programming footage 7 loading and storing via db cache systemSocial game programming footage 7 loading and storing via db cache system
Social game programming footage 7 loading and storing via db cache system
Nettention
 
ProudNet IoT 제품소개서
ProudNet IoT 제품소개서ProudNet IoT 제품소개서
ProudNet IoT 제품소개서
License Nettention
 
웹서버와 프라우드넷 서버간 상호작용 가이드
웹서버와 프라우드넷 서버간 상호작용 가이드웹서버와 프라우드넷 서버간 상호작용 가이드
웹서버와 프라우드넷 서버간 상호작용 가이드
Hyunjik Bae
 
Unity에서 회전하는 cube 만드는 법
Unity에서 회전하는 cube 만드는 법Unity에서 회전하는 cube 만드는 법
Unity에서 회전하는 cube 만드는 법
Hyunjik Bae
 
라이브 서비스를 위한 게임 서버 구성
라이브 서비스를 위한 게임 서버 구성라이브 서비스를 위한 게임 서버 구성
라이브 서비스를 위한 게임 서버 구성
Hyunjik Bae
 
웹서버와 ProudNet 서버간 상호작용 가이드
웹서버와 ProudNet 서버간 상호작용 가이드웹서버와 ProudNet 서버간 상호작용 가이드
웹서버와 ProudNet 서버간 상호작용 가이드
Hyunjik Bae
 
Tema 1: Definición de términos
Tema 1: Definición de términosTema 1: Definición de términos
Tema 1: Definición de términos
feortiz13
 
Nimbus IITl @ 9910008812 noida sec 168
Nimbus IITl @ 9910008812 noida sec 168Nimbus IITl @ 9910008812 noida sec 168
Nimbus IITl @ 9910008812 noida sec 168
Isha Amastha
 
The case for magical thinking
The case for magical thinkingThe case for magical thinking
The case for magical thinking
David Kaiser, Ph.D., P.C.C.
 
The power of words to create
The power of words to createThe power of words to create
The power of words to create
David Kaiser, Ph.D., P.C.C.
 
Architectural Signage by Harbinger
Architectural Signage by HarbingerArchitectural Signage by Harbinger
Architectural Signage by Harbinger
Harbinger
 
Time to lead
Time to leadTime to lead
sport village 3C @9910008812 noida sec 78
sport village 3C @9910008812 noida sec 78sport village 3C @9910008812 noida sec 78
sport village 3C @9910008812 noida sec 78
Isha Amastha
 
Sakai10 online t&l_imaginarium
Sakai10 online t&l_imaginariumSakai10 online t&l_imaginarium
Sakai10 online t&l_imaginarium
University of Windsor
 
Ppt social media
Ppt social mediaPpt social media
Ppt social media
Karen Geier
 

Viewers also liked (20)

Social game programming footage 1 client to server connection
Social game programming footage 1 client to server connectionSocial game programming footage 1 client to server connection
Social game programming footage 1 client to server connection
 
Social game programming footage 0 introduction
Social game programming footage 0 introductionSocial game programming footage 0 introduction
Social game programming footage 0 introduction
 
Social game programming footage 4 realtime collaborated farming at server (pl...
Social game programming footage 4 realtime collaborated farming at server (pl...Social game programming footage 4 realtime collaborated farming at server (pl...
Social game programming footage 4 realtime collaborated farming at server (pl...
 
Game Server Middleware 'ProudNet'
Game Server Middleware 'ProudNet'Game Server Middleware 'ProudNet'
Game Server Middleware 'ProudNet'
 
Social game programming footage 2 rmi messages
Social game programming footage 2 rmi messagesSocial game programming footage 2 rmi messages
Social game programming footage 2 rmi messages
 
Social game programming footage 7 loading and storing via db cache system
Social game programming footage 7 loading and storing via db cache systemSocial game programming footage 7 loading and storing via db cache system
Social game programming footage 7 loading and storing via db cache system
 
ProudNet IoT 제품소개서
ProudNet IoT 제품소개서ProudNet IoT 제품소개서
ProudNet IoT 제품소개서
 
웹서버와 프라우드넷 서버간 상호작용 가이드
웹서버와 프라우드넷 서버간 상호작용 가이드웹서버와 프라우드넷 서버간 상호작용 가이드
웹서버와 프라우드넷 서버간 상호작용 가이드
 
Unity에서 회전하는 cube 만드는 법
Unity에서 회전하는 cube 만드는 법Unity에서 회전하는 cube 만드는 법
Unity에서 회전하는 cube 만드는 법
 
라이브 서비스를 위한 게임 서버 구성
라이브 서비스를 위한 게임 서버 구성라이브 서비스를 위한 게임 서버 구성
라이브 서비스를 위한 게임 서버 구성
 
웹서버와 ProudNet 서버간 상호작용 가이드
웹서버와 ProudNet 서버간 상호작용 가이드웹서버와 ProudNet 서버간 상호작용 가이드
웹서버와 ProudNet 서버간 상호작용 가이드
 
Tema 1: Definición de términos
Tema 1: Definición de términosTema 1: Definición de términos
Tema 1: Definición de términos
 
Nimbus IITl @ 9910008812 noida sec 168
Nimbus IITl @ 9910008812 noida sec 168Nimbus IITl @ 9910008812 noida sec 168
Nimbus IITl @ 9910008812 noida sec 168
 
The case for magical thinking
The case for magical thinkingThe case for magical thinking
The case for magical thinking
 
The power of words to create
The power of words to createThe power of words to create
The power of words to create
 
Architectural Signage by Harbinger
Architectural Signage by HarbingerArchitectural Signage by Harbinger
Architectural Signage by Harbinger
 
Time to lead
Time to leadTime to lead
Time to lead
 
sport village 3C @9910008812 noida sec 78
sport village 3C @9910008812 noida sec 78sport village 3C @9910008812 noida sec 78
sport village 3C @9910008812 noida sec 78
 
Sakai10 online t&l_imaginarium
Sakai10 online t&l_imaginariumSakai10 online t&l_imaginarium
Sakai10 online t&l_imaginarium
 
Ppt social media
Ppt social mediaPpt social media
Ppt social media
 

Social game programming footage 3 farming at client

  • 2. 클릭 처리 • 월드에 평면(plane)이 존재 • 평면에 마우스를 찍으면 • 마우스를 찍은 곳에 나무를 배치 – screen position to ray와 평면의 교차점에
  • 3. // determine if clicked (release button) bool pushing = Input.GetMouseButton(0); bool clicked = Input.GetMouseButtonUp(0); // pick object var ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; GameObject pickedObject = null; if (Physics.Raycast(ray, out hit)) { pickedObject = hit.transform.root.gameObject; var pos = hit.point; }
  • 4. 나무 심기의 메시징 및 처리 1. click! 2. 나무 심고 싶다 (요청) 서버 클라이언트 4. 나무 심어졌다 통보 5. 나무 개체 생성 3. 나무 개체 생성
  • 5. 나무 없애기 • 나무 심기와 마찬가지 1. click! 2. 나무 없애고 싶다 (요청) 서버 클라이언트 4. 나무 없어졌다 통보 5. 나무 개체 제거 3. 나무 개체 제거