AddOnCamera.cs 618 B

1234567891011121314151617181920212223
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class AddOnCamera : MonoBehaviour
  5. {
  6. public Transform LeftController, RightController;
  7. public Quaternion LeftControllerRotation, RightControllerRotation;
  8. private void OnPreRender()
  9. {
  10. //Debug.Log("OnPreRender:=========" + LeftControllerRotation+" "+ RightControllerRotation);
  11. if (LeftController)
  12. {
  13. LeftController.rotation = LeftControllerRotation;
  14. }
  15. if (RightController)
  16. {
  17. RightController.rotation = RightControllerRotation;
  18. }
  19. }
  20. }