본문 바로가기

Study/Unity3D

포물선 운동 공식 출처 : http://blog.naver.com/samplecode/80191865705 x 초 후 위치 다른 방식 포물선으로 원하는 위치 이동[출처] 포물선으로 원하는 위치 이동|작성자 샘플코드 http://answers.unity3d.com/questions/248788/calculating-ball-trajectory-in-full-3d-world.html 더보기
[ 퍼온 글 ] 코루틴 설명 출처: 만들면서 배우는 Unity3D Game Programming (한빛미디어) 출처 : http://icoder.tistory.com/entry/Unity3D-%EA%B0%95%EC%A2%8C-%EC%BD%94%EB%A3%A8%ED%8B%B4-1 1. 코루틴은 일반 프로그래밍 언어에서 쓰레드와 비슷한 개념입니다. 프로젝트를 생성하고 Project 패널에 MainScript 스크립트 파일을 하나 생성합니다. MainScript 스크립트 파일을 드래그하여 Main Camera 객체의 컴포넌트로 추가합니다. 첫 번째로 알아볼 코루틴 관련 메서드는 StartCoroutine() 메서드입니다. StartCoroutine() 메서드를 사용하면 코루틴을 시작할 수 있습니다. 매개변수에는 메서드 이름을 입력합니다... 더보기
Uniy_Mouse_Camera_Control using UnityEngine; using System.Collections; public class CS_Camera_Control : MonoBehaviour { //#define public float MINIMUM_DISTANCE = 2.0f; public float MAXUM_DISTANCE = 10.0f; public int MINIMUM_ANGLE_Y = -80; public int MAXIMUM_ANGLE_Y = 80; //Transform public Transform Camera_Axis = null; public Transform cam = null; //X float xAngl = 0.0f; public float xSpeed = 5.0f; //Y float yAngl = 0.0f.. 더보기
Unity3D 자주쓰는 함수 1. 이동-위치 이동transform.Translate( new Vector3D(x,y,z) );-힘에 의한 이동transform.rigidbody.AddForce( new Vector3D(x,y,z) ); //-------------------------------------------------- 2. 충돌//물리적 충돌void OnCollisionEnter(Collision col) {}void OnCollisionStay(Collision col) {}void OnCollisionExit(Collision col) {} //트리거에 의한 충돌void OnTriggerEnter(Collider col) {}void OnTriggerStay(Collision col) {}void OnTriggerEx.. 더보기
유니티 오브젝트 이미지 뒤집기(이미지 플립) http://hyunity3d.tistory.com/384 Scale 변경 방법Tileing 변경 방법 더보기
토튜의 유니티 강좌(Unity Tutorial) NGUI 몇가지 예제 http://www.youtube.com/playlist?list=PLI69hfdYKNQcv9caOXl4CVHRw8lsY1I19토튜의 유니티 강좌(Unity Tutorial) 더보기
NGUI 버튼 클릭 이벤트 UIbutton Message는 외부 스크립트를 찾아서 실행것이고 아래 내용은 버튼에서 직접 실행하는 것. 버튼으로 사용할 것에 콜라이더(Collider)가 붙어 있어야 작동함. void OnHover (bool isOver) – Sent out when the mouse hovers over the collider or moves away from it.Not sent on touch-based devices.마우스 오버일 경우에 작동, 터치에서는 안먹음void OnPress (bool isDown) – Sent when a mouse button (or touch event) gets pressed over the collider (with ‘true’) and when it gets released.. 더보기
NGUI 튜토리얼 사이트 NGUI 공식 도큐먼트http://www.tasharen.com/?page_id=197NGUI 튜토리얼 번역버젼 - Step1http://theeye.pe.kr/entry/ngui-tutorial-step-1-on-unity-3d위 블로그의 NGUI 튜토리얼 Step1 ~ Step9 (번역)http://theeye.pe.kr/search/NGUI버튼 이벤트 핸들링http://icoder.tistory.com/174아틀라스 만들어 활용하기http://icoder.tistory.com/173Bitmap Font 만들어 활용하기http://icoder.tistory.com/172Dynamic Font 사용하기http://blog.naver.com/progagmer/186757028(위 블로그의 ”NGUI 강좌.. 더보기
Unity3D 모바일 디바이스에서 파일생성 및 읽고 쓰기 작업하던 도중 모바일에선 경로가 파일경로가 바뀌고 읽어오지못하는 문제가 발생하였다.pc에선 잘되지만 모바일에서만 이상이있었음찾다 찾다 유니티 포럼에서 좋은거 긁어왔습니다. ㅋㅋ 아이폰도 됩니다~ 1 public void writeStringToFile( string str, string filename ) 2 { 3 #if !WEB_BUILD 4 string path = pathForDocumentsFile( filename ); 5 FileStream file = new FileStream (path, FileMode.Create, FileAccess.Write); 6 7 StreamWriter sw = new StreamWriter( file ); 8 sw.WriteLine( str ); 9 10 s.. 더보기
[ 퍼옴 ] 씬 로딩화면 Unity Pro only AsyncOperation async = Application.LoadLevelAsync( 씬넘버 ); while( !async.isDone ) { // async.progress 참조해서 로딩 게이지 출력 } Application.LoadLevelAsync로 비동기 씬 로딩을 할 수 있구요 - 로딩이 다 되었는지는 async.isDone - 얼마나 진행이 되었는지는 async.progress 참조1 : http://devkorea.co.kr/bbs/board.php?bo_table=m03_qna&wr_id=25581&sca=UNITY&sfl=wr_subject%7C%7Cwr_content&stx=%EB%A1%9C%EB%94%A9%ED%99%94%EB%A9%B4&sop=and&.. 더보기