23 lines
547 B
C#
23 lines
547 B
C#
using UnityEngine;
|
|||
|
|
using System.Collections;
|
||
|
|
|
||
|
|
public class OrientationSensor : MonoBehaviour {
|
||
|
|
public Quaternion orientation = Quaternion.identity;
|
||
|
|
public Vector3 right = Vector3.right;
|
||
|
|
public Vector3 up = Vector3.right;
|
||
|
|
public Vector3 forward = Vector3.right;
|
||
|
|
|
||
|
|
// Use this for initialization
|
||
|
|
void Start () {
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
// Update is called once per frame
|
||
|
|
public void FixedUpdate () {
|
||
|
|
orientation = transform.rotation;
|
||
|
|
right = orientation * Vector3.right;
|
||
|
|
up = orientation * Vector3.up;
|
||
|
|
forward = orientation * Vector3.forward;
|
||
|
|
}
|
||
|
|
}
|