//


// 

// 2013/06/07 N.Kobyasahi

//

using UnityEngine;

using System.Collections;



public class ThirdPersonCamera : MonoBehaviour

{

public float smooth = 3f;

public Transform standardPos; // the usual position for the camera, specified by a transform in the game

Transform frontPos; // Front Camera locater

Transform jumpPos; // Jump Camera locater

bool bQuickSwitch = false; //Change Camera Position Quickly

void Start()

{

//standardPos = GameObject.Find ("CamPos").transform;

if(GameObject.Find ("FrontPos"))

frontPos = GameObject.Find ("FrontPos").transform;


if(GameObject.Find ("JumpPos"))

jumpPos = GameObject.Find ("JumpPos").transform;


//繧ォ繝。繝ゥ繧偵せ繧ソ繝シ繝医☆繧

transform.position = standardPos.position;

transform.forward = standardPos.forward;

}


void FixedUpdate ()

{

if(Input.GetButton("Fire1")) // left Ctlr

{

// Change Front Camera

setCameraPositionFrontView();

}

else if(Input.GetButton("Fire2")) //Alt

{

// Change Jump Camera

setCameraPositionJumpView();

}

else

{

// return the camera to standard position and direction

setCameraPositionNormalView();

}

}


void setCameraPositionNormalView()

{

if(bQuickSwitch == false){

// the camera to standard position and direction

transform.position = Vector3.Lerp(transform.position, standardPos.position, Time.fixedDeltaTime * smooth);

transform.forward = Vector3.Lerp(transform.forward, standardPos.forward, Time.fixedDeltaTime * smooth);

}

else{

// the camera to standard position and direction / Quick Change

transform.position = standardPos.position;

transform.forward = standardPos.forward;

bQuickSwitch = false;

}

}


void setCameraPositionFrontView()

{

// Change Front Camera

bQuickSwitch = true;

transform.position = frontPos.position;

transform.forward = frontPos.forward;

}


void setCameraPositionJumpView()

{

// Change Jump Camera

bQuickSwitch = false;

transform.position = Vector3.Lerp(transform.position, jumpPos.position, Time.fixedDeltaTime * smooth);

transform.forward = Vector3.Lerp(transform.forward, jumpPos.forward, Time.fixedDeltaTime * smooth);

}

}




'Computer Language > 유니티' 카테고리의 다른 글

잼과 이동관련  (0) 2014.11.26
Hexa  (0) 2014.11.25
사인과 코사인 응용 방안  (0) 2014.11.12
Dialog() 다이아로그  (0) 2014.11.10
더미와 다이어로그  (0) 2014.11.10

서버

1. 소켓 생성

2. Connect()

3. worker Thread

4. Main Thread

채팅 송신부 while Scanf_c

5. beginThreadEx(workerThread)

 

클라    로그인

          게임

          채팅

'Computer Language > 데이터 통신' 카테고리의 다른 글

아이템 설계  (0) 2014.12.24
LPSTR, LPCSTR, LPTSTR, LPCTSTR  (0) 2014.12.05

사인 코사인 속도 덜어질때, 점프 , 바운스 띄용띄용, 타격감, 허리업.

코사인 속독 올라갈때

'Computer Language > 유니티' 카테고리의 다른 글

Hexa  (0) 2014.11.25
3인칭 시점  (0) 2014.11.13
Dialog() 다이아로그  (0) 2014.11.10
더미와 다이어로그  (0) 2014.11.10
캐릭터,리그 ,애니메이터  (0) 2014.07.21

+ Recent posts