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.
19 lines
455 B
19 lines
455 B
using System.Collections; |
|
using System.Collections.Generic; |
|
using UnityEngine; |
|
using UnityEngine.UI; |
|
|
|
public class Compass : MonoBehaviour |
|
{ |
|
private float ZRotation = 0f; |
|
public float InitialRotationAngle = 0f; |
|
|
|
void Update() |
|
{ |
|
if (Camera.main) |
|
{ |
|
ZRotation = Camera.main.transform.eulerAngles.y + InitialRotationAngle; |
|
this.transform.eulerAngles = new Vector3(0, 0, ZRotation); |
|
} |
|
} |
|
}
|
|
|