티스토리 뷰

Programming/Unity3D

Unity3D - Tip

파란크리스마스 2013. 6. 17. 10:21
728x90

Android Back 버튼 이벤트 ( 출처 : 원숭이가 만드는 게임 )

if ( Input.GetKeyDown(KeyCode.Escape) )  {
    // 안드로이드 Back버튼 눌렀을때 처리
}

Unity3D에서의 Singleton 사용
( 출처 : Unity3D에서의 singleton 패턴, Unify Community - Singleton,  Global Managers With Generic Singletons )

Unity3D - Android 연동
(출처 : 유니티4! 짜증나는 이클립스 연동 한방에 끝내보자[안드로이드] 유니티 C# 클래스와 자바 클래스간의 연동 )

Android - android id 구하기
( 출처 : Samsung developers - Android - Technical Docs )

Android - 국가코드 가져오기
( 출처 : 단말 정보들 가져오기 )

동적으로 ButtonMessage에 target설정 / onClick 클릭 객체 가지고 오기
( 출처 : Topic: How to detect if mouse is clicking on NGUI area? )
void createItem() {
  obj = Instantiate(
    opengame,
    new Vector3(
      opengame.transform.position.x+(0.5f*(i-1)+k*1.5f),
      opengame.transform.position.y-j,
      opengame.transform.position.z
    ), 
    Quaternion.identity
  ) as GameObject;
  UIButtonMessage btnMessage = obj.GetComponent("UIButtonMessage") as UIButtonMessage; 
  btnMessage.target = btnMessageTarget;
}

void OnOpenStageClick() {
  Debug.Log("Clicked " + UICamera.hoveredObject);
  Cs_loadgameclick script_load = UICamera.hoveredObject.GetComponent("Cs_loadgameclick") as Cs_loadgameclick; 
  Debug.Log("targetstage = " + script_load.targetstage);
}

asfd

- end -


댓글
300x250
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/03   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
글 보관함