You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
486 B
20 lines
486 B
3 years ago
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
|
||
|
public class DirectionRuler : MonoBehaviour {
|
||
|
public GameObject ruler;
|
||
|
private float direction_;
|
||
|
public Transform camera_;
|
||
|
// Use this for initialization
|
||
|
void Start () {
|
||
|
|
||
|
}
|
||
|
|
||
|
// Update is called once per frame
|
||
|
void Update () {
|
||
|
direction_ = (2115f - 395f) / 360f * camera_.localEulerAngles.y + 395f;
|
||
|
ruler.transform.localPosition = new Vector3(direction_, 8f,0f);
|
||
|
}
|
||
|
}
|