Created
August 26, 2016 17:21
-
-
Save takoyakiroom/e7a26c530268dfe1e0af06c2bbf4fb41 to your computer and use it in GitHub Desktop.
マップ用カメラ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class LadarCamera : MonoBehaviour { | |
GameObject player; | |
// Use this for initialization | |
void Start () { | |
player = GameObject.Find("[CameraRig]/Camera (eye)"); | |
} | |
// Update is called once per frame | |
void Update () { | |
// レーダをくるくる回す | |
transform.rotation = Quaternion.Euler(new Vector3(90f, player.transform.eulerAngles.y, 0)); | |
// 自分をレーダの中心にする | |
transform.position = new Vector3(player.transform.position.x, 30f, player.transform.position.z); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment