diff --git a/Forest/Assets/Scenes/BuildTemplate.unity b/Forest/Assets/Editor/GameBuild/BuildTemplate.unity similarity index 99% rename from Forest/Assets/Scenes/BuildTemplate.unity rename to Forest/Assets/Editor/GameBuild/BuildTemplate.unity index 48d7fdd..c7ad0aa 100644 --- a/Forest/Assets/Scenes/BuildTemplate.unity +++ b/Forest/Assets/Editor/GameBuild/BuildTemplate.unity @@ -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 diff --git a/Forest/Assets/Scenes/BuildTemplate.unity.meta b/Forest/Assets/Editor/GameBuild/BuildTemplate.unity.meta similarity index 100% rename from Forest/Assets/Scenes/BuildTemplate.unity.meta rename to Forest/Assets/Editor/GameBuild/BuildTemplate.unity.meta diff --git a/Forest/Assets/Scenes/Build/Build_1.unity b/Forest/Assets/Scenes/Build/Build_1.unity index ae71a19..2c01859 100644 --- a/Forest/Assets/Scenes/Build/Build_1.unity +++ b/Forest/Assets/Scenes/Build/Build_1.unity @@ -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 diff --git a/Forest/Assets/Scenes/StartScene.unity b/Forest/Assets/Scenes/StartScene.unity index 0cbcd1c..fd31cf4 100644 --- a/Forest/Assets/Scenes/StartScene.unity +++ b/Forest/Assets/Scenes/StartScene.unity @@ -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 diff --git a/Forest/Assets/Scripts/Framework/Camera/CameraAdapter.cs b/Forest/Assets/Scripts/Framework/Camera/CameraAdapter.cs deleted file mode 100644 index 0463921..0000000 --- a/Forest/Assets/Scripts/Framework/Camera/CameraAdapter.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Framework.Constants; -using UnityEngine; - -public class CameraAdapter : MonoBehaviour -{ - private Camera _camera; - - private void Awake() - { - _camera = transform.GetComponent(); - var size = _camera.orthographicSize; - _camera.orthographicSize = size * NormalConstants.DesignResolutionWidth / - NormalConstants.DesignResolutionHeight * Screen.height / Screen.width; - } -} \ No newline at end of file diff --git a/Forest/Assets/Scripts/Framework/Camera/CameraAdapter.cs.meta b/Forest/Assets/Scripts/Framework/Camera/CameraAdapter.cs.meta deleted file mode 100644 index f3d3d8e..0000000 --- a/Forest/Assets/Scripts/Framework/Camera/CameraAdapter.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: fff49514adc6448d0a4cbea3ff37308b -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Forest/Assets/Scripts/Framework/Camera/CameraController.cs b/Forest/Assets/Scripts/Framework/Camera/CameraController.cs index b209dda..57934ee 100644 --- a/Forest/Assets/Scripts/Framework/Camera/CameraController.cs +++ b/Forest/Assets/Scripts/Framework/Camera/CameraController.cs @@ -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; diff --git a/Forest/Assets/Scripts/Framework/Camera/CameraManager.cs b/Forest/Assets/Scripts/Framework/Camera/CameraManager.cs index 140663e..f980ccb 100644 --- a/Forest/Assets/Scripts/Framework/Camera/CameraManager.cs +++ b/Forest/Assets/Scripts/Framework/Camera/CameraManager.cs @@ -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()