【相机】删除多余脚本
parent
4561233718
commit
9e4d56a0c6
|
@ -250,7 +250,7 @@ GameObject:
|
||||||
- component: {fileID: 158575877}
|
- component: {fileID: 158575877}
|
||||||
- component: {fileID: 158575880}
|
- component: {fileID: 158575880}
|
||||||
- component: {fileID: 158575879}
|
- component: {fileID: 158575879}
|
||||||
- component: {fileID: 158575878}
|
- component: {fileID: 158575882}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: BuildCamera
|
m_Name: BuildCamera
|
||||||
m_TagString: MainCamera
|
m_TagString: MainCamera
|
||||||
|
@ -309,18 +309,6 @@ Camera:
|
||||||
m_OcclusionCulling: 1
|
m_OcclusionCulling: 1
|
||||||
m_StereoConvergence: 10
|
m_StereoConvergence: 10
|
||||||
m_StereoSeparation: 0.022
|
m_StereoSeparation: 0.022
|
||||||
--- !u!114 &158575878
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 158575876}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: fff49514adc6448d0a4cbea3ff37308b, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
--- !u!114 &158575879
|
--- !u!114 &158575879
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -388,6 +376,18 @@ Transform:
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &158575882
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 158575876}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 7bd04ead9893ac94ca65cb68eeee61bf, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
--- !u!1001 &334302849
|
--- !u!1001 &334302849
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
|
@ -571,7 +571,7 @@ GameObject:
|
||||||
- component: {fileID: 158575877}
|
- component: {fileID: 158575877}
|
||||||
- component: {fileID: 158575880}
|
- component: {fileID: 158575880}
|
||||||
- component: {fileID: 158575879}
|
- component: {fileID: 158575879}
|
||||||
- component: {fileID: 158575878}
|
- component: {fileID: 158575882}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: BuildCamera
|
m_Name: BuildCamera
|
||||||
m_TagString: MainCamera
|
m_TagString: MainCamera
|
||||||
|
@ -630,18 +630,6 @@ Camera:
|
||||||
m_OcclusionCulling: 1
|
m_OcclusionCulling: 1
|
||||||
m_StereoConvergence: 10
|
m_StereoConvergence: 10
|
||||||
m_StereoSeparation: 0.022
|
m_StereoSeparation: 0.022
|
||||||
--- !u!114 &158575878
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 158575876}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: fff49514adc6448d0a4cbea3ff37308b, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
--- !u!114 &158575879
|
--- !u!114 &158575879
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -709,6 +697,18 @@ Transform:
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &158575882
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 158575876}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 7bd04ead9893ac94ca65cb68eeee61bf, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
--- !u!1 &190140260
|
--- !u!1 &190140260
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
@ -261,7 +261,7 @@ MonoBehaviour:
|
||||||
m_GameObject: {fileID: 123179485}
|
m_GameObject: {fileID: 123179485}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: fff49514adc6448d0a4cbea3ff37308b, type: 3}
|
m_Script: {fileID: 11500000, guid: 7bd04ead9893ac94ca65cb68eeee61bf, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
--- !u!1 &158007422
|
--- !u!1 &158007422
|
||||||
|
@ -415,7 +415,6 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: 7bd04ead9893ac94ca65cb68eeee61bf, type: 3}
|
m_Script: {fileID: 11500000, guid: 7bd04ead9893ac94ca65cb68eeee61bf, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
rayLength: 15
|
|
||||||
--- !u!1 &200410053
|
--- !u!1 &200410053
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
using Framework.Constants;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class CameraAdapter : MonoBehaviour
|
|
||||||
{
|
|
||||||
private Camera _camera;
|
|
||||||
|
|
||||||
private void Awake()
|
|
||||||
{
|
|
||||||
_camera = transform.GetComponent<Camera>();
|
|
||||||
var size = _camera.orthographicSize;
|
|
||||||
_camera.orthographicSize = size * NormalConstants.DesignResolutionWidth /
|
|
||||||
NormalConstants.DesignResolutionHeight * Screen.height / Screen.width;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: fff49514adc6448d0a4cbea3ff37308b
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
|
@ -1,12 +1,12 @@
|
||||||
using Framework.Constants;
|
using Framework.Constants;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.InputSystem;
|
//using UnityEngine.InputSystem;
|
||||||
|
|
||||||
public class CameraController : MonoBehaviour
|
public class CameraController : MonoBehaviour
|
||||||
|
|
||||||
{
|
{
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
public float rayLength = 15f;
|
/*public float rayLength = 15f;
|
||||||
private RaycastHit hitInfo;
|
private RaycastHit hitInfo;
|
||||||
private Vector3 hitPoint;
|
private Vector3 hitPoint;
|
||||||
private Ray ray;
|
private Ray ray;
|
||||||
|
@ -27,7 +27,7 @@ public class CameraController : MonoBehaviour
|
||||||
float halfSize = 0.2f;
|
float halfSize = 0.2f;
|
||||||
Gizmos.color = Color.red;
|
Gizmos.color = Color.red;
|
||||||
Gizmos.DrawWireCube(hitPoint, new Vector3(halfSize * 2, halfSize * 2, halfSize * 2));
|
Gizmos.DrawWireCube(hitPoint, new Vector3(halfSize * 2, halfSize * 2, halfSize * 2));
|
||||||
}
|
}*/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private Camera _camera;
|
private Camera _camera;
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
using Framework.Constants;
|
||||||
using Framework.UI;
|
using Framework.UI;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using PhxhSDK;
|
using PhxhSDK;
|
||||||
|
@ -40,11 +41,15 @@ namespace Framework.Manager
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Adaptation()
|
private void Adaptation(Camera camera)
|
||||||
{
|
{
|
||||||
var vaild = MainCamera.orthographicSize * 2 * (TargetResolutionWidth / TargetResolutionHeight);
|
var vaild = MainCamera.orthographicSize * 2 * (TargetResolutionWidth / TargetResolutionHeight);
|
||||||
var aspectRatio = Screen.width / (float)Screen.height;
|
var aspectRatio = Screen.width / (float)Screen.height;
|
||||||
MainCamera.orthographicSize = vaild / aspectRatio / 2;
|
MainCamera.orthographicSize = vaild / aspectRatio / 2;
|
||||||
|
|
||||||
|
var size = camera.orthographicSize;
|
||||||
|
camera.orthographicSize = size * NormalConstants.DesignResolutionWidth /
|
||||||
|
NormalConstants.DesignResolutionHeight * Screen.height / Screen.width;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Release()
|
public void Release()
|
||||||
|
|
Loading…
Reference in New Issue