Показать сообщение отдельно
Старый 09.02.2013, 14:07   #6
SGREED
ПроЭктировщик
 
Аватар для SGREED
 
Регистрация: 05.02.2013
Сообщений: 149
Написано одно полезное сообщение
Ответ: Управление wasd

камера вот такая, я нашел
using UnityEngine;
using System.Collections;

public class 
PlayerCamera MonoBehaviour {
         public 
Transform target;
         public 
float xSpeed 250.0f;
              
         private 
Transform _myTransform;
         private 
bool _camButtonDown false;
         private 
float _x;
         
         
void Awake (){
                 
_myTransform transform;
         }
         
     
void Start () {     
                 if( 
target == null ){
                         
Debug.LogWarning"camera: No target!" );
                 }else{
                         
_myTransform.LookAttarget );
                 }
     }
         
         
void Update (){
                 if( 
Input.GetMouseButtonDown)){
                         
_camButtonDown true;
                 }
                 if( 
Input.GetMouseButtonUp)){
                         
_camButtonDown false;
                 }
         }
                 
         
void LateUpdate () {
                 if(
_camButtonDown ){
                         if( 
target != null ){
                                 
_x += Input.GetAxis"Mouse X" ) * xSpeed 0.02f;
                                 
Quaternion targetRotation Quaternion.Euler0_x);      
                                 
target.rotation targetRotation;
                         }
                 }
         }
         
         
         

(Offline)
 
Ответить с цитированием