Skip to content

Instantly share code, notes, and snippets.

@takoyakiroom
Created August 26, 2016 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takoyakiroom/e7a26c530268dfe1e0af06c2bbf4fb41 to your computer and use it in GitHub Desktop.
Save takoyakiroom/e7a26c530268dfe1e0af06c2bbf4fb41 to your computer and use it in GitHub Desktop.
マップ用カメラ
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