FixEditorOffset.cs 799 B

123456789101112131415161718192021222324252627
  1. // /******************************************************************************
  2. // * File: FixEditorOffset.cs
  3. // * Copyright (c) 2023 Qualcomm Technologies, Inc. and/or its subsidiaries. All rights reserved.
  4. // *
  5. // *
  6. // ******************************************************************************/
  7. using UnityEngine;
  8. namespace QCHT.Samples.Menu
  9. {
  10. public class FixEditorOffset : MonoBehaviour
  11. {
  12. [SerializeField] private float offsetValueFromCameraY = -1.36144f;
  13. private void Start()
  14. {
  15. #if UNITY_EDITOR
  16. {
  17. var go = GameObject.Find("QCHTCamera(Clone)");
  18. var pos = transform.position;
  19. go.transform.position = new Vector3(pos.x, offsetValueFromCameraY, pos.z);
  20. }
  21. #endif
  22. }
  23. }
  24. }