diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index 9366a8f..5eccdb0 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -216,6 +216,52 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &755090841 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 755090842} + - component: {fileID: 755090843} + m_Layer: 0 + m_Name: CameraBoot + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &755090842 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 755090841} + serializedVersion: 2 + 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_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 963194228} + m_Father: {fileID: 1916791294} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &755090843 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 755090841} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d5fcaeb18225e04419f9a3d6c48546a5, type: 3} + m_Name: + m_EditorClassIdentifier: + mouseSpeed: 500 --- !u!1 &963194225 GameObject: m_ObjectHideFlags: 0 @@ -302,104 +348,12 @@ Transform: m_GameObject: {fileID: 963194225} serializedVersion: 2 m_LocalRotation: {x: 0.44279677, y: -0, z: -0, w: 0.89662206} - m_LocalPosition: {x: 0, y: 5, z: -5.57} + m_LocalPosition: {x: 0.67767763, y: 2.292, z: -2.217} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 0} + m_Father: {fileID: 755090842} m_LocalEulerAnglesHint: {x: 52.565, y: 0, z: 0} ---- !u!1 &1641063756 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1641063757} - - component: {fileID: 1641063759} - - component: {fileID: 1641063758} - m_Layer: 0 - m_Name: player - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1641063757 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1641063756} - serializedVersion: 2 - 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_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 1916791294} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!81 &1641063758 -AudioListener: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1641063756} - m_Enabled: 1 ---- !u!20 &1641063759 -Camera: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1641063756} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 1 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} - m_projectionMatrixMode: 1 - m_GateFitMode: 2 - m_FOVAxisMode: 0 - m_Iso: 200 - m_ShutterSpeed: 0.005 - m_Aperture: 16 - m_FocusDistance: 10 - m_FocalLength: 50 - m_BladeCount: 5 - m_Curvature: {x: 2, y: 11} - m_BarrelClipping: 0.25 - m_Anamorphism: 0 - m_SensorSize: {x: 36, y: 24} - m_LensShift: {x: 0, y: 0} - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: 0.3 - far clip plane: 1000 - field of view: 60 - orthographic: 0 - orthographic size: 5 - m_Depth: 0 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 3 - m_HDR: 1 - m_AllowMSAA: 1 - m_AllowDynamicResolution: 0 - m_ForceIntoRT: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 --- !u!1 &1916791289 GameObject: m_ObjectHideFlags: 0 @@ -414,6 +368,7 @@ GameObject: - component: {fileID: 1916791291} - component: {fileID: 1916791290} - component: {fileID: 1916791295} + - component: {fileID: 1916791298} m_Layer: 0 m_Name: Cube m_TagString: Untagged @@ -518,7 +473,7 @@ MeshFilter: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1916791289} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} --- !u!4 &1916791294 Transform: m_ObjectHideFlags: 0 @@ -532,7 +487,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: - - {fileID: 1641063757} + - {fileID: 755090842} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &1916791295 @@ -550,6 +505,19 @@ MonoBehaviour: speed: 5 rb: {fileID: 0} jumpForce: 5 +--- !u!114 &1916791298 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1916791289} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 54f70d5af29a406987058ba50db0a636, type: 3} + m_Name: + m_EditorClassIdentifier: + mouseSpeed: 20 --- !u!1 &2036601234 GameObject: m_ObjectHideFlags: 0 @@ -660,7 +628,6 @@ Transform: SceneRoots: m_ObjectHideFlags: 0 m_Roots: - - {fileID: 963194228} - {fileID: 705507995} - {fileID: 2036601238} - {fileID: 1916791294} diff --git a/Assets/scripts/CameraControllerX.cs b/Assets/scripts/CameraControllerX.cs new file mode 100644 index 0000000..d5acedc --- /dev/null +++ b/Assets/scripts/CameraControllerX.cs @@ -0,0 +1,18 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class CameraControllerX : MonoBehaviour +{ + [SerializeField] + private float mouseSpeed = 20f; + + void Update() + { + float mouseX = Input.GetAxis("Mouse X"); + + transform.Rotate(Vector3.up * (mouseX * mouseSpeed)); + + + } +} \ No newline at end of file diff --git a/Assets/scripts/CameraControllerX.cs.meta b/Assets/scripts/CameraControllerX.cs.meta new file mode 100644 index 0000000..cbc026f --- /dev/null +++ b/Assets/scripts/CameraControllerX.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 54f70d5af29a406987058ba50db0a636 +timeCreated: 1783053068 \ No newline at end of file diff --git a/Assets/scripts/CameraControllerY.cs b/Assets/scripts/CameraControllerY.cs new file mode 100644 index 0000000..aecba35 --- /dev/null +++ b/Assets/scripts/CameraControllerY.cs @@ -0,0 +1,24 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class CameraControllerY : MonoBehaviour +{ + [SerializeField] + private float mouseSpeed = 500f; + + private float pitch = 0f; + + // Update is called once per frame + void Update() + { + float mouseY = Input.GetAxis("Mouse Y"); + + pitch -= mouseY * mouseSpeed * Time.deltaTime; + + pitch = Mathf.Clamp(pitch, -90f, 30f); + + transform.localRotation = Quaternion.Euler(pitch, 0f, 0f); + + } +} diff --git a/Assets/scripts/CameraControllerY.cs.meta b/Assets/scripts/CameraControllerY.cs.meta new file mode 100644 index 0000000..8c8d4fa --- /dev/null +++ b/Assets/scripts/CameraControllerY.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d5fcaeb18225e04419f9a3d6c48546a5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/scripts/Moving.cs b/Assets/scripts/Moving.cs index 962953c..cf4fea7 100644 --- a/Assets/scripts/Moving.cs +++ b/Assets/scripts/Moving.cs @@ -1,52 +1,59 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class Moving : MonoBehaviour -{ - - - public float speed = 5f; - [SerializeField] - private Rigidbody rb; - - [SerializeField] - private float jumpForce = 5f; - - - void Start() - { - - } - - // Update is called once per frame - void Update() - { - Vector3 direction = Vector3.zero; - - if (Input.GetKey(KeyCode.W)) - direction += Vector3.forward; - - if (Input.GetKey(KeyCode.S)) - direction += Vector3.back; - - if (Input.GetKey(KeyCode.A)) - direction += Vector3.left; - - if (Input.GetKey(KeyCode.D)) - direction += Vector3.right; - - if (Input.GetKeyDown(KeyCode.Space)) - rb.AddForce(Vector3.up * jumpForce, ForceMode.Impulse); - - if (Input.GetKey(KeyCode.LeftControl)) - Debug.Log("left ctrl active"); - - - direction = direction.normalized; - - transform.position += direction * (speed * Time.deltaTime); - - - } -} +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class Moving : MonoBehaviour +{ + + + public float speed = 5f; + [SerializeField] + private Rigidbody rb; + + [SerializeField] + private float jumpForce = 5f; + + + void Awake(){ + rb = GetComponent(); + } + + void Start() + { + + } + + // Update is called once per frame + void Update() + { + Vector3 direction = Vector3.zero; + + if (Input.GetKey(KeyCode.W)) + direction += Vector3.forward; + + if (Input.GetKey(KeyCode.S)) + direction += Vector3.back; + + if (Input.GetKey(KeyCode.A)) + direction += Vector3.left; + + if (Input.GetKey(KeyCode.D)) + direction += Vector3.right; + + if (Input.GetKeyDown(KeyCode.Space)) + rb.AddForce(Vector3.up * jumpForce, ForceMode.Impulse); + + if (Input.GetKey(KeyCode.LeftControl)) + Debug.Log("left ctrl active"); + + + + + + direction = direction.normalized; + + transform.position += direction * (speed * Time.deltaTime); + + + } +} diff --git a/UserSettings/Layouts/default-2022.dwlt b/UserSettings/Layouts/default-2022.dwlt index b517595..ac40b90 100644 --- a/UserSettings/Layouts/default-2022.dwlt +++ b/UserSettings/Layouts/default-2022.dwlt @@ -19,7 +19,7 @@ MonoBehaviour: width: 2560 height: 1349 m_ShowMode: 4 - m_Title: "\u573A\u666F" + m_Title: Inspector m_RootView: {fileID: 2} m_MinSize: {x: 875, y: 321} m_MaxSize: {x: 10000, y: 10000} @@ -120,7 +120,7 @@ MonoBehaviour: m_MinSize: {x: 300, y: 100} m_MaxSize: {x: 24288, y: 16192} vertical: 0 - controlID: 99 + controlID: 35 draggingID: 0 --- !u!114 &6 MonoBehaviour: @@ -141,8 +141,8 @@ MonoBehaviour: y: 0 width: 359 height: 1299 - m_MinSize: {x: 200, y: 200} - m_MaxSize: {x: 4000, y: 4000} + m_MinSize: {x: 201, y: 221} + m_MaxSize: {x: 4001, y: 4021} m_ActualView: {fileID: 11} m_Panes: - {fileID: 11} @@ -192,7 +192,7 @@ MonoBehaviour: x: 0 y: 0 width: 1717 - height: 771 + height: 959 m_MinSize: {x: 202, y: 221} m_MaxSize: {x: 4002, y: 4021} m_ActualView: {fileID: 12} @@ -217,9 +217,9 @@ MonoBehaviour: m_Position: serializedVersion: 2 x: 0 - y: 771 + y: 959 width: 1717 - height: 528 + height: 340 m_MinSize: {x: 232, y: 271} m_MaxSize: {x: 10002, y: 10021} m_ActualView: {fileID: 14} @@ -269,7 +269,7 @@ MonoBehaviour: m_MinSize: {x: 200, y: 200} m_MaxSize: {x: 4000, y: 4000} m_TitleContent: - m_Text: "\u5C42\u7EA7" + m_Text: Hierarchy m_Image: {fileID: 7966133145522015247, guid: 0000000000000000d000000000000000, type: 0} m_Tooltip: m_Pos: @@ -291,9 +291,9 @@ MonoBehaviour: m_SceneHierarchy: m_TreeViewState: scrollPos: {x: 0, y: 0} - m_SelectedIDs: - m_LastClickedID: 0 - m_ExpandedIDs: cebfffff18fbffff + m_SelectedIDs: 7ef1ffff + m_LastClickedID: -3714 + m_ExpandedIDs: 7ef1ffff2efbffff225d0000 m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -332,7 +332,7 @@ MonoBehaviour: m_MinSize: {x: 200, y: 200} m_MaxSize: {x: 4000, y: 4000} m_TitleContent: - m_Text: "\u573A\u666F" + m_Text: Scene m_Image: {fileID: 2593428753322112591, guid: 0000000000000000d000000000000000, type: 0} m_Tooltip: m_Pos: @@ -340,7 +340,7 @@ MonoBehaviour: x: 359 y: 73 width: 1715 - height: 750 + height: 938 m_SerializedDataModeController: m_DataMode: 0 m_PreferredDataMode: 0 @@ -647,9 +647,9 @@ MonoBehaviour: m_PlayAudio: 0 m_AudioPlay: 0 m_Position: - m_Target: {x: -3.3544698, y: 0.9875194, z: 1.1888345} + m_Target: {x: -3.2000508, y: 0.7213859, z: -1.7106739} speed: 2 - m_Value: {x: -3.3544698, y: 0.9875194, z: 1.1888345} + m_Value: {x: -3.2000508, y: 0.7213859, z: -1.7106739} m_RenderMode: 0 m_CameraMode: drawMode: 0 @@ -699,9 +699,9 @@ MonoBehaviour: speed: 2 m_Value: {x: 0.20699704, y: -0.67354226, z: 0.20526297, w: 0.6792349} m_Size: - m_Target: 5.037201 + m_Target: 4.946138 speed: 2 - m_Value: 5.037201 + m_Value: 4.946138 m_Ortho: m_Target: 0 speed: 2 @@ -741,7 +741,7 @@ MonoBehaviour: m_MinSize: {x: 200, y: 200} m_MaxSize: {x: 4000, y: 4000} m_TitleContent: - m_Text: "\u6E38\u620F" + m_Text: Game m_Image: {fileID: -6423792434712278376, guid: 0000000000000000d000000000000000, type: 0} m_Tooltip: m_Pos: @@ -749,7 +749,7 @@ MonoBehaviour: x: 359 y: 73 width: 1715 - height: 750 + height: 938 m_SerializedDataModeController: m_DataMode: 0 m_PreferredDataMode: 0 @@ -768,7 +768,7 @@ MonoBehaviour: m_ShowGizmos: 0 m_TargetDisplay: 0 m_ClearColor: {r: 0, g: 0, b: 0, a: 0} - m_TargetSize: {x: 1715, y: 729} + m_TargetSize: {x: 1715, y: 917} m_TextureFilterMode: 0 m_TextureHideFlags: 61 m_RenderIMGUI: 1 @@ -785,8 +785,8 @@ MonoBehaviour: vZoomLockedByDefault: 0 m_HBaseRangeMin: -857.5 m_HBaseRangeMax: 857.5 - m_VBaseRangeMin: -364.5 - m_VBaseRangeMax: 364.5 + m_VBaseRangeMin: -458.5 + m_VBaseRangeMax: 458.5 m_HAllowExceedBaseRangeMin: 1 m_HAllowExceedBaseRangeMax: 1 m_VAllowExceedBaseRangeMin: 1 @@ -805,9 +805,9 @@ MonoBehaviour: x: 0 y: 21 width: 1715 - height: 729 + height: 917 m_Scale: {x: 1, y: 1} - m_Translation: {x: 857.5, y: 364.5} + m_Translation: {x: 857.5, y: 458.5} m_MarginLeft: 0 m_MarginRight: 0 m_MarginTop: 0 @@ -815,12 +815,12 @@ MonoBehaviour: m_LastShownAreaInsideMargins: serializedVersion: 2 x: -857.5 - y: -364.5 + y: -458.5 width: 1715 - height: 729 + height: 917 m_MinimalGUI: 1 m_defaultScale: 1 - m_LastWindowPixelSize: {x: 1715, y: 750} + m_LastWindowPixelSize: {x: 1715, y: 938} m_ClearInEditMode: 1 m_NoCameraWarning: 1 m_LowResolutionForAspectRatios: 01000000000000000000 @@ -842,15 +842,15 @@ MonoBehaviour: m_MinSize: {x: 230, y: 250} m_MaxSize: {x: 10000, y: 10000} m_TitleContent: - m_Text: "\u9879\u76EE" + m_Text: Project m_Image: {fileID: -5467254957812901981, guid: 0000000000000000d000000000000000, type: 0} m_Tooltip: m_Pos: serializedVersion: 2 x: 359 - y: 844 + y: 1032 width: 1715 - height: 507 + height: 319 m_SerializedDataModeController: m_DataMode: 0 m_PreferredDataMode: 0 @@ -882,14 +882,14 @@ MonoBehaviour: m_LastFolders: - Assets/scripts m_LastFoldersGridSize: -1 - m_LastProjectPath: C:\Users\xyf17\Merlin\Project\game-demo\game-demo + m_LastProjectPath: D:\Project\game-demo m_LockTracker: m_IsLocked: 0 m_FolderTreeState: scrollPos: {x: 0, y: 0} - m_SelectedIDs: 4c6a0000 - m_LastClickedID: 27212 - m_ExpandedIDs: 00000000105a000000ca9a3bffffff7f + m_SelectedIDs: 6a5d0000 + m_LastClickedID: 23914 + m_ExpandedIDs: 00000000625d000000ca9a3bffffff7f m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -917,7 +917,7 @@ MonoBehaviour: scrollPos: {x: 0, y: 0} m_SelectedIDs: m_LastClickedID: 0 - m_ExpandedIDs: + m_ExpandedIDs: 00000000625d0000 m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -988,15 +988,15 @@ MonoBehaviour: m_MinSize: {x: 100, y: 100} m_MaxSize: {x: 4000, y: 4000} m_TitleContent: - m_Text: "\u63A7\u5236\u53F0" + m_Text: Console m_Image: {fileID: -4327648978806127646, guid: 0000000000000000d000000000000000, type: 0} m_Tooltip: m_Pos: serializedVersion: 2 - x: 0 - y: 522 - width: 1162 - height: 289 + x: 359 + y: 844 + width: 1715 + height: 507 m_SerializedDataModeController: m_DataMode: 0 m_PreferredDataMode: 0 @@ -1022,7 +1022,7 @@ MonoBehaviour: m_MinSize: {x: 275, y: 50} m_MaxSize: {x: 4000, y: 4000} m_TitleContent: - m_Text: "\u68C0\u67E5\u5668" + m_Text: Inspector m_Image: {fileID: -2667387946076563598, guid: 0000000000000000d000000000000000, type: 0} m_Tooltip: m_Pos: diff --git a/readme.md b/readme.md index e005253..5293a3d 100644 --- a/readme.md +++ b/readme.md @@ -4,4 +4,4 @@ the game-demo project now officially started,more details will update in doc f be aware commit message is also can trace project schedule or click -*<[登录 | OpenProject](https://openproject.merlin.xin/projects/game-prepare)>* +*<[看板 | OpenProject](https://openproject.merlin.xin/projects/game-demo/boards/21)>*