Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

UNITY3D 같이 놀자!

엑투스 유니티 강좌
by

Seo YoungHwa

on 21 September 2012

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of UNITY3D 같이 놀자!

1. 질량 / 중력 추가 ( Rigidbodies) 유니티3D 같이 놀자! function Update () {
if(Input.GetButtonUp("Jump")){
Debug.Log("We Have Hit the Space Bar!");
}
} 2. 기본 충돌 감지 //Basic collision detection checking for two differently named objects
function OnCollisionEnter(theCollision : Collision){
if(theCollision.gameObject.name == "Floor"){
Debug.Log("Hit the floor");
}else if(theCollision.gameObject.name == "Wall"){
Debug.Log("Hit the wall");
}
} 3. 입력을 감지 4.Prefab의 활용 5.객체 해제하기
(Destroying Objects) 6. 객체생성하기
(Instantiate to Create Objects) 7.기본 타이머(Simple Timer) 8.이동(Basic Translate Movement) 9.힘운동(Basic Force Movement) 10.재질추가하기(Adding Materials) 11.오디오(Audio Basics) 12.조인트(Basic Joints) 13.축 입력 14.트리거 충돌 감지 15.텍스트 및 카운터 16.스크립트를 통해 구성 요소를 추가하기 17.화면전환(Scene switching) 18.충돌을 감지하여 명령어 실행 19.중력이 적용된 물체를 이동 20.카메라를 한 객체만 바라보게하기LookAt 21.GUIText 제어하기 22.WaitForSeconds함수를 이용한 시간차 박스 생성 23.파티클 시스템 24. For Loops 25.2D이미지를 이용한 마우스 제어 //Simple Destroy Command in Start Function

function Start () {
Destroy(gameObject.Find("Box"), 3);
} //Basic force to move a rigidbody object
var power : float = 500.0;

function Start () {
rigidbody.AddForce(Vector3(0,0,power));
} var thePrefab : GameObject;

function Start () {
var instance : GameObject = Instantiate(thePrefab, transform.position, transform.rotation);
} var myTimer : float = 5.0;

function Update () {
if(myTimer > 0){
myTimer -= Time.deltaTime;
}
if(myTimer <= 0){
Debug.Log("GAME OVER");
}
} var speed : float = 5.0;

function Update () {
transform.Translate(Vector3(0,0,speed) * Time.deltaTime);
} Using PlayOneShot:
//Play an instance using attached AudioSource component
var myClip : AudioClip;

function Start () {
audio.PlayOneShot(myClip);
} Using PlayClipAtPoint:

//Spawn a new object with AudioSource and Clip set, at a point in the 3D world
var myClip : AudioClip;

function Start () {
AudioSource.PlayClipAtPoint(myClip, transform.position);
} //Basic axis input
function Update () {
var horiz : float = Input.GetAxis("Horizontal");
transform.Translate(Vector3(horiz,0,0));
} function OnTriggerEnter (myTrigger : Collider) {
if(myTrigger.gameObject.name == "box"){
Debug.Log("Box went through!");
}
} var Counter : int = 0;

function Update () {
Counter++;
guiText.text = "Counter is: "+Counter;
} function OnCollisionEnter (myCollision : Collision) {
if(myCollision.gameObject.name == "Platform"){
if(!myCollision.gameObject.rigidbody){
myCollision.gameObject.AddComponent(Rigidbody);
}
}
} var myLevel : String;

function OnCollisionEnter (myCollision : Collision) {
if(myCollision.gameObject.name == "Floor"){
Application.LoadLevel(myLevel);
}
} function OnCollisionEnter (myCollision : Collision) {
if(myCollision.gameObject.name == "Floor"){
var myLight : Light = gameObject.Find("Light").GetComponent(Light);
myLight.enabled = true;
myLight.intensity = 5;
}
} function Update () {
//transform.Translate(Vector3(0,0,1) * Time.deltaTime);
var fwd = transform.forward * 100;
rigidbody.AddForce(fwd);
} var myTransform : Transform;

function Update () {

transform.LookAt(myTransform);

} var myCheck : boolean = true;

function Update () {

if(myCheck){
guiText.text = "Its on!";
}else{
guiText.text = "Its Off!";
}

if(Input.GetButtonUp("Jump") && myCheck){
myCheck = false;
}else if(Input.GetButtonUp("Jump") && myCheck == false){
myCheck = true;
}
} var box : GameObject;
var readynow : boolean = true;

function Update () {
if(readynow){
MakeBox();
}
}

function MakeBox(){
readynow=false;
Instantiate(box, transform.position, transform.rotation);
yield WaitForSeconds(2);
readynow=true;
} var stars : ParticleEmitter;

function OnCollisionEnter (col : Collision) {
Instantiate(stars, transform.position, transform.rotation);
Destroy(gameObject);
} var myPrefab : Rigidbody;
var distanceMultiplier : float = 2;

function Start(){

var i : int = 0;
var pos : Vector3 = transform.position;

for(i=0; i&lt;=3; i++){
Instantiate(myPrefab, Vector3(pos.x+i*distanceMultiplier, pos.y, pos.z), transform.rotation);
yield WaitForSeconds(0.5);
Debug.Log("made ball "+i);

}

} var normalTex : Texture2D;
var hoverTex : Texture2D;

function OnMouseEnter () {
guiTexture.texture = hoverTex;
}

function OnMouseExit(){
guiTexture.texture = normalTex;
}

function OnMouseDown(){
Debug.Log("clicked");
} 1부 2부 3부 4부 http://www.unity3dstudent.com/2010/07/beginner-b00-adding-mass-gravity/ 0부 0.프로젝트 시작하기 1. 씬 패널(Scene pannel) 2. 구조패널(Hierarchy panel) 3.게임뷰(Game view) 4. 프로젝트 패널(Project Panel) 5. 게임 객체(Game Objects) 6.컴포넌트(Components) 7.어셋 가져오기
(Importing Assets)
Full transcript