zoukankan      html  css  js  c++  java
  • 第三人视角,摄像机跟随代码

    using UnityEngine;
    using System.Collections;
    
    public class CameraFollow : MonoBehaviour {
    
    	public Transform target;
    	// The distance in the x-z plane to the target
    	public float distance = 10.0f;
    	// the height we want the camera to be above the target
    	public float height = 5.0f;
    	
    	void LateUpdate () {
    		// Early out if we don't have a target
    		if (!target)
    			return;
    		
    		// Set the position of the camera on the x-z plane to:
    		// distance meters behind the target
    		transform.position = target.position;
    		transform.position -=  Vector3.forward * distance;
    		transform.position = new Vector3(transform.position.x,transform.position.y + height,
    		                                 transform.position.z);
    		
    		// Always look at the target
    	//	transform.LookAt (target);
    	}
    }
    


  • 相关阅读:
    谷歌机器学习
    Pycharm使用conda安装的环境
    HAN模型理解2
    HAN模型理解1
    RCNN
    深度CNN
    多通道CNN
    TextCNN
    词向量2
    词向量1.md
  • 原文地址:https://www.cnblogs.com/bzyzhang/p/5399622.html
Copyright © 2011-2022 走看看