Verified Commit 6e920ec3 authored by Sebastian Höffner's avatar Sebastian Höffner
Browse files

Better camera handling.

parent 54a0e522
...@@ -218,7 +218,7 @@ RectTransform: ...@@ -218,7 +218,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 2093235069} m_Father: {fileID: 2093235069}
m_RootOrder: 4 m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0}
...@@ -270,7 +270,7 @@ MonoBehaviour: ...@@ -270,7 +270,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: ea500f64f3cff40bb88ecdae5362c204, type: 3} m_Script: {fileID: 11500000, guid: ea500f64f3cff40bb88ecdae5362c204, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
activeCamera: {fileID: 1692721593} thisCamera: {fileID: 0}
--- !u!1 &1462446305 --- !u!1 &1462446305
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -370,76 +370,6 @@ RectTransform: ...@@ -370,76 +370,6 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0} m_Pivot: {x: 0, y: 0}
--- !u!1 &1692721591
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1692721592}
- component: {fileID: 1692721594}
- component: {fileID: 1692721593}
m_Layer: 5
m_Name: ActiveCamera
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1692721592
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1692721591}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 2093235069}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 1280, y: 800}
m_Pivot: {x: 0, y: 1}
--- !u!114 &1692721593
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1692721591}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Texture: {fileID: 8400000, guid: 334d30cf14fdb40e49a17ec66419ba0e, type: 2}
m_UVRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
--- !u!222 &1692721594
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1692721591}
m_CullTransparentMesh: 0
--- !u!1 &1700068149 --- !u!1 &1700068149
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -471,7 +401,7 @@ RectTransform: ...@@ -471,7 +401,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 2093235069} m_Father: {fileID: 2093235069}
m_RootOrder: 2 m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0}
...@@ -523,7 +453,7 @@ MonoBehaviour: ...@@ -523,7 +453,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: ea500f64f3cff40bb88ecdae5362c204, type: 3} m_Script: {fileID: 11500000, guid: ea500f64f3cff40bb88ecdae5362c204, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
activeCamera: {fileID: 1692721593} thisCamera: {fileID: 0}
--- !u!1 &1884074643 --- !u!1 &1884074643
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -555,7 +485,7 @@ RectTransform: ...@@ -555,7 +485,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 2093235069} m_Father: {fileID: 2093235069}
m_RootOrder: 1 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0}
...@@ -607,7 +537,7 @@ MonoBehaviour: ...@@ -607,7 +537,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: ea500f64f3cff40bb88ecdae5362c204, type: 3} m_Script: {fileID: 11500000, guid: ea500f64f3cff40bb88ecdae5362c204, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
activeCamera: {fileID: 1692721593} thisCamera: {fileID: 0}
--- !u!1 &1938177648 --- !u!1 &1938177648
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -639,7 +569,7 @@ RectTransform: ...@@ -639,7 +569,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 2093235069} m_Father: {fileID: 2093235069}
m_RootOrder: 3 m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0}
...@@ -691,7 +621,7 @@ MonoBehaviour: ...@@ -691,7 +621,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: ea500f64f3cff40bb88ecdae5362c204, type: 3} m_Script: {fileID: 11500000, guid: ea500f64f3cff40bb88ecdae5362c204, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
activeCamera: {fileID: 1692721593} thisCamera: {fileID: 0}
--- !u!1 &2093235068 --- !u!1 &2093235068
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -720,7 +650,6 @@ RectTransform: ...@@ -720,7 +650,6 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: m_Children:
- {fileID: 1692721592}
- {fileID: 1884074644} - {fileID: 1884074644}
- {fileID: 1700068150} - {fileID: 1700068150}
- {fileID: 1938177649} - {fileID: 1938177649}
......
...@@ -4,12 +4,19 @@ using UnityEngine.UI; ...@@ -4,12 +4,19 @@ using UnityEngine.UI;
public class SelectCameraHandler : MonoBehaviour, IPointerClickHandler public class SelectCameraHandler : MonoBehaviour, IPointerClickHandler
{ {
public RawImage activeCamera; private Transform mainCamera;
public Transform thisCamera;
void Start()
{
mainCamera = GameObject.Find($"Main Camera").transform;
thisCamera = GameObject.Find($"Cameras/{name}").transform;
}
public void OnPointerClick(PointerEventData pointerEventData) public void OnPointerClick(PointerEventData pointerEventData)
{ {
Debug.Log($"[SelectCameraHandler] Selecting camera {name}"); Debug.Log($"[SelectCameraHandler] Selecting Camera {name.Split(' ')[1]}");
activeCamera.texture = this.GetComponent<RawImage>().texture; mainCamera.SetParent(thisCamera, false);
} }
} }
\ No newline at end of file
...@@ -42,8 +42,8 @@ PlayerSettings: ...@@ -42,8 +42,8 @@ PlayerSettings:
m_SplashScreenLogos: [] m_SplashScreenLogos: []
m_VirtualRealitySplashScreen: {fileID: 0} m_VirtualRealitySplashScreen: {fileID: 0}
m_HolographicTrackingLossScreen: {fileID: 0} m_HolographicTrackingLossScreen: {fileID: 0}
defaultScreenWidth: 1024 defaultScreenWidth: 1280
defaultScreenHeight: 768 defaultScreenHeight: 800
defaultScreenWidthWeb: 960 defaultScreenWidthWeb: 960
defaultScreenHeightWeb: 600 defaultScreenHeightWeb: 600
m_StereoRenderingPath: 0 m_StereoRenderingPath: 0
...@@ -80,7 +80,7 @@ PlayerSettings: ...@@ -80,7 +80,7 @@ PlayerSettings:
bakeCollisionMeshes: 0 bakeCollisionMeshes: 0
forceSingleInstance: 0 forceSingleInstance: 0
useFlipModelSwapchain: 1 useFlipModelSwapchain: 1
resizableWindow: 0 resizableWindow: 1
useMacAppStoreValidation: 0 useMacAppStoreValidation: 0
macAppStoreCategory: public.app-category.games macAppStoreCategory: public.app-category.games
gpuSkinning: 1 gpuSkinning: 1
...@@ -91,7 +91,7 @@ PlayerSettings: ...@@ -91,7 +91,7 @@ PlayerSettings:
xboxEnableFitness: 0 xboxEnableFitness: 0
visibleInBackground: 1 visibleInBackground: 1
allowFullscreenSwitch: 1 allowFullscreenSwitch: 1
fullscreenMode: 1 fullscreenMode: 3
xboxSpeechDB: 0 xboxSpeechDB: 0
xboxEnableHeadOrientation: 0 xboxEnableHeadOrientation: 0
xboxEnableGuest: 0 xboxEnableGuest: 0
...@@ -114,11 +114,11 @@ PlayerSettings: ...@@ -114,11 +114,11 @@ PlayerSettings:
vulkanNumSwapchainBuffers: 3 vulkanNumSwapchainBuffers: 3
vulkanEnableSetSRGBWrite: 0 vulkanEnableSetSRGBWrite: 0
m_SupportedAspectRatios: m_SupportedAspectRatios:
4:3: 1 4:3: 0
5:4: 1 5:4: 0
16:10: 1 16:10: 1
16:9: 1 16:9: 0
Others: 1 Others: 0
bundleVersion: 0.1 bundleVersion: 0.1
preloadedAssets: [] preloadedAssets: []
metroInputSource: 0 metroInputSource: 0
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment