【相机】删除多余脚本

Android_release
zhangaotian 2024-08-12 15:32:02 +08:00
parent 4561233718
commit 9e4d56a0c6
8 changed files with 36 additions and 58 deletions

View File

@ -250,7 +250,7 @@ GameObject:
- component: {fileID: 158575877}
- component: {fileID: 158575880}
- component: {fileID: 158575879}
- component: {fileID: 158575878}
- component: {fileID: 158575882}
m_Layer: 0
m_Name: BuildCamera
m_TagString: MainCamera
@ -309,18 +309,6 @@ Camera:
m_OcclusionCulling: 1
m_StereoConvergence: 10
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
MonoBehaviour:
m_ObjectHideFlags: 0
@ -388,6 +376,18 @@ Transform:
m_Children: []
m_Father: {fileID: 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
PrefabInstance:
m_ObjectHideFlags: 0

View File

@ -571,7 +571,7 @@ GameObject:
- component: {fileID: 158575877}
- component: {fileID: 158575880}
- component: {fileID: 158575879}
- component: {fileID: 158575878}
- component: {fileID: 158575882}
m_Layer: 0
m_Name: BuildCamera
m_TagString: MainCamera
@ -630,18 +630,6 @@ Camera:
m_OcclusionCulling: 1
m_StereoConvergence: 10
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
MonoBehaviour:
m_ObjectHideFlags: 0
@ -709,6 +697,18 @@ Transform:
m_Children: []
m_Father: {fileID: 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
GameObject:
m_ObjectHideFlags: 0

View File

@ -261,7 +261,7 @@ MonoBehaviour:
m_GameObject: {fileID: 123179485}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fff49514adc6448d0a4cbea3ff37308b, type: 3}
m_Script: {fileID: 11500000, guid: 7bd04ead9893ac94ca65cb68eeee61bf, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &158007422
@ -415,7 +415,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 7bd04ead9893ac94ca65cb68eeee61bf, type: 3}
m_Name:
m_EditorClassIdentifier:
rayLength: 15
--- !u!1 &200410053
GameObject:
m_ObjectHideFlags: 0

View File

@ -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;
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: fff49514adc6448d0a4cbea3ff37308b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,12 +1,12 @@
using Framework.Constants;
using UnityEngine;
using UnityEngine.InputSystem;
//using UnityEngine.InputSystem;
public class CameraController : MonoBehaviour
{
#if UNITY_EDITOR
public float rayLength = 15f;
/*public float rayLength = 15f;
private RaycastHit hitInfo;
private Vector3 hitPoint;
private Ray ray;
@ -27,7 +27,7 @@ public class CameraController : MonoBehaviour
float halfSize = 0.2f;
Gizmos.color = Color.red;
Gizmos.DrawWireCube(hitPoint, new Vector3(halfSize * 2, halfSize * 2, halfSize * 2));
}
}*/
#endif
private Camera _camera;

View File

@ -1,3 +1,4 @@
using Framework.Constants;
using Framework.UI;
using UnityEngine;
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 aspectRatio = Screen.width / (float)Screen.height;
MainCamera.orthographicSize = vaild / aspectRatio / 2;
var size = camera.orthographicSize;
camera.orthographicSize = size * NormalConstants.DesignResolutionWidth /
NormalConstants.DesignResolutionHeight * Screen.height / Screen.width;
}
public void Release()