RKCameraSetting.cs 897 B

123456789101112131415161718192021222324252627282930313233343536
  1. using Rokid.UXR.Utility;
  2. using UnityEngine;
  3. namespace Rokid.UXR.Module
  4. {
  5. public class RKCameraSetting : MonoBehaviour
  6. {
  7. [Tooltip("设置日志等级")]
  8. public RKLog.LogLevel logLevel = RKLog.LogLevel.Info;
  9. private RKLog.LogLevel preLogLevel = RKLog.LogLevel.Info;
  10. [Tooltip("是否在编辑器模式激活相机控制")]
  11. public bool activeCameraCtrlInEditor = true;
  12. private void Start()
  13. {
  14. if (Utils.IsUnityEditor())
  15. {
  16. if (activeCameraCtrlInEditor)
  17. gameObject.AddComponent<SimpleCameraController>();
  18. }
  19. RKLog.SetLogLevel(logLevel);
  20. }
  21. void Update()
  22. {
  23. if (logLevel != preLogLevel)
  24. {
  25. RKLog.SetLogLevel(logLevel);
  26. preLogLevel = logLevel;
  27. }
  28. }
  29. }
  30. }