summaryrefslogtreecommitdiff
path: root/ActiveRagdoll/Assets/TABG/Scripts/Debug/DebugSceneCamera.cs
diff options
context:
space:
mode:
Diffstat (limited to 'ActiveRagdoll/Assets/TABG/Scripts/Debug/DebugSceneCamera.cs')
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Debug/DebugSceneCamera.cs51
1 files changed, 51 insertions, 0 deletions
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Debug/DebugSceneCamera.cs b/ActiveRagdoll/Assets/TABG/Scripts/Debug/DebugSceneCamera.cs
new file mode 100644
index 0000000..992c1c7
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Debug/DebugSceneCamera.cs
@@ -0,0 +1,51 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEditor;
+using UnityEngine;
+
+public class DebugSceneCamera : MonoBehaviour
+{
+ public Transform target;
+
+ // Start is called before the first frame update
+ void Start()
+ {
+
+ }
+
+ // Update is called once per frame
+ void Update()
+ {
+ //var camera = SceneView.lastActiveSceneView.camera;
+ //if(camera != null)
+ //{
+ // Debug.Log("asdasd");
+
+ // Vector3 pos = target.position;
+
+ // camera.transform.position = pos + target.right * -10;
+ // camera.transform.forward = target.right;
+
+ //}
+
+ //Camera cameraMain = Camera.main;
+ //var sceneView = SceneView.lastActiveSceneView;
+ //if (sceneView != null)
+ //{
+ // sceneView.cameraSettings.nearClip = cameraMain.nearClipPlane;
+ // sceneView.cameraSettings.fieldOfView = cameraMain.fieldOfView;
+ // sceneView.pivot = cameraMain.transform.position +
+ // cameraMain.transform.forward * sceneView.cameraDistance;
+ // sceneView.rotation = cameraMain.transform.rotation;
+ //}
+
+ var sceneView = SceneView.lastActiveSceneView;
+ if (sceneView != null)
+ {
+ sceneView.pivot = target.position;
+ Quaternion rot = Quaternion.LookRotation(target.right);
+ sceneView.LookAtDirect(target.position, rot);
+ }
+
+ }
+}