diff options
-rw-r--r-- | ActiveRagdoll/Assets/Scenes/SampleScene.unity | 161 | ||||
-rw-r--r-- | ActiveRagdoll/Assets/Scripts/LockTransform.cs | 47 | ||||
-rw-r--r-- | ActiveRagdoll/Assets/Scripts/LockTransform.cs.meta | 11 | ||||
-rw-r--r-- | ActiveRagdoll/Assets/Scripts/SyncTransform.cs | 47 | ||||
-rw-r--r-- | ActiveRagdoll/Assets/Scripts/SyncTransform.cs.meta | 11 | ||||
-rw-r--r-- | ActiveRagdoll/Packages/manifest.json | 16 | ||||
-rw-r--r-- | ActiveRagdoll/Packages/packages-lock.json | 95 | ||||
-rw-r--r-- | ActiveRagdoll/ProjectSettings/ProjectVersion.txt | 4 | ||||
-rw-r--r-- | Docs/TAB.txt | 24 | ||||
-rw-r--r-- | Docs/资料.xlsx | bin | 1052105 -> 4223151 bytes |
10 files changed, 355 insertions, 61 deletions
diff --git a/ActiveRagdoll/Assets/Scenes/SampleScene.unity b/ActiveRagdoll/Assets/Scenes/SampleScene.unity index af2bc0d..0892aa6 100644 --- a/ActiveRagdoll/Assets/Scenes/SampleScene.unity +++ b/ActiveRagdoll/Assets/Scenes/SampleScene.unity @@ -971,6 +971,161 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] +--- !u!1 &450916999 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 450917003} + - component: {fileID: 450917002} + - component: {fileID: 450917001} + - component: {fileID: 450917000} + m_Layer: 0 + m_Name: Camera + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &450917000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 450916999} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e2e446b390e6c9c488e4568cf01fec3e, type: 3} + m_Name: + m_EditorClassIdentifier: + syncMode: -1 + target: {fileID: 461602766} +--- !u!114 &450917001 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 450916999} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RenderShadows: 1 + m_RequiresDepthTextureOption: 2 + m_RequiresOpaqueTextureOption: 2 + m_CameraType: 0 + m_Cameras: [] + m_RendererIndex: -1 + m_VolumeLayerMask: + serializedVersion: 2 + m_Bits: 1 + m_VolumeTrigger: {fileID: 0} + m_VolumeFrameworkUpdateModeOption: 2 + m_RenderPostProcessing: 0 + m_Antialiasing: 0 + m_AntialiasingQuality: 2 + m_StopNaN: 0 + m_Dithering: 0 + m_ClearDepth: 1 + m_AllowXRRendering: 1 + m_RequiresDepthTexture: 0 + m_RequiresColorTexture: 0 + m_Version: 2 +--- !u!20 &450917002 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 450916999} + 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_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + 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!4 &450917003 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 450916999} + m_LocalRotation: {x: 0, y: -0.6874578, z: 0, w: 0.7262244} + m_LocalPosition: {x: 0, y: 3.5263894, z: -0.22777902} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 0, y: -90, z: 0} +--- !u!1 &461602765 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 461602766} + m_Layer: 0 + m_Name: EyeMountpoint + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &461602766 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 461602765} + m_LocalRotation: {x: 0, y: 1, z: 0, w: 0} + m_LocalPosition: {x: 0, y: -0.621, z: -0.758} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1139865536} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0} --- !u!21 &515439941 Material: serializedVersion: 8 @@ -1896,6 +2051,12 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] +--- !u!4 &1139865536 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 1961036507667987063, guid: 1fa23488806214e40808a8f29b1b82cd, + type: 3} + m_PrefabInstance: {fileID: 1961036507847845552} + m_PrefabAsset: {fileID: 0} --- !u!21 &1147954294 Material: serializedVersion: 8 diff --git a/ActiveRagdoll/Assets/Scripts/LockTransform.cs b/ActiveRagdoll/Assets/Scripts/LockTransform.cs new file mode 100644 index 0000000..fa2216f --- /dev/null +++ b/ActiveRagdoll/Assets/Scripts/LockTransform.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class LockTransform : MonoBehaviour +{ + + [Flags] + public enum ESyncTransfom + { + Position, + Rotation, + Scale, + } + + public ESyncTransfom syncMode; + + public Transform target; + + private Vector3 _position; + private Quaternion _rotation; + private Vector3 _scale; + + private void Awake() + { + } + + void Update() + { + if (syncMode.HasFlag(ESyncTransfom.Position)) + { + transform.position = target.position; + } + + if (syncMode.HasFlag(ESyncTransfom.Rotation)) + { + transform.rotation = target.rotation; + } + + if (syncMode.HasFlag(ESyncTransfom.Scale)) + { + transform.localScale = target.localScale; + } + } + +} diff --git a/ActiveRagdoll/Assets/Scripts/LockTransform.cs.meta b/ActiveRagdoll/Assets/Scripts/LockTransform.cs.meta new file mode 100644 index 0000000..11fd2a7 --- /dev/null +++ b/ActiveRagdoll/Assets/Scripts/LockTransform.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fbe6afe58dbacd242a07cbdbadaf59df +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ActiveRagdoll/Assets/Scripts/SyncTransform.cs b/ActiveRagdoll/Assets/Scripts/SyncTransform.cs new file mode 100644 index 0000000..8ebf2e0 --- /dev/null +++ b/ActiveRagdoll/Assets/Scripts/SyncTransform.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +[ExecuteInEditMode] +public class SyncTransform : MonoBehaviour +{ + [Flags] + public enum ESyncTransfom + { + Position, + Rotation, + Scale, + RotationY, + } + + public ESyncTransfom syncMode; + + public Transform target; + + void Update() + { + if(syncMode.HasFlag(ESyncTransfom.Position)) + { + transform.position = Vector3.Lerp(transform.position, target.position, 0.2f); + } + + if(syncMode.HasFlag(ESyncTransfom.Rotation)) + { + transform.rotation = target.rotation; + } + + if(syncMode.HasFlag(ESyncTransfom.Scale)) + { + transform.localScale = target.localScale; + } + + if(syncMode.HasFlag(ESyncTransfom.RotationY)) + { + Quaternion rot = target.rotation; + Vector3 angle = rot.ToEuler(); + transform.rotation = Quaternion.Euler(0, -90, 0)*Quaternion.Euler(0, angle.y, 0); + } + } + +} diff --git a/ActiveRagdoll/Assets/Scripts/SyncTransform.cs.meta b/ActiveRagdoll/Assets/Scripts/SyncTransform.cs.meta new file mode 100644 index 0000000..571817b --- /dev/null +++ b/ActiveRagdoll/Assets/Scripts/SyncTransform.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e2e446b390e6c9c488e4568cf01fec3e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ActiveRagdoll/Packages/manifest.json b/ActiveRagdoll/Packages/manifest.json index d5625d4..a237002 100644 --- a/ActiveRagdoll/Packages/manifest.json +++ b/ActiveRagdoll/Packages/manifest.json @@ -1,16 +1,16 @@ { "dependencies": { - "com.unity.collab-proxy": "1.15.18", - "com.unity.feature.2d": "1.0.0", - "com.unity.ide.rider": "3.0.15", - "com.unity.ide.visualstudio": "2.0.16", + "com.unity.collab-proxy": "2.0.7", + "com.unity.feature.2d": "2.0.0", + "com.unity.ide.rider": "3.0.24", + "com.unity.ide.visualstudio": "2.0.18", "com.unity.ide.vscode": "1.2.5", - "com.unity.render-pipelines.universal": "12.1.7", - "com.unity.test-framework": "1.1.31", + "com.unity.render-pipelines.universal": "12.1.12", + "com.unity.test-framework": "1.1.33", "com.unity.textmeshpro": "3.0.6", - "com.unity.timeline": "1.6.4", + "com.unity.timeline": "1.6.5", "com.unity.ugui": "1.0.0", - "com.unity.visualscripting": "1.7.8", + "com.unity.visualscripting": "1.9.0", "com.unity.modules.ai": "1.0.0", "com.unity.modules.androidjni": "1.0.0", "com.unity.modules.animation": "1.0.0", diff --git a/ActiveRagdoll/Packages/packages-lock.json b/ActiveRagdoll/Packages/packages-lock.json index f5810df..e1e3dab 100644 --- a/ActiveRagdoll/Packages/packages-lock.json +++ b/ActiveRagdoll/Packages/packages-lock.json @@ -1,19 +1,31 @@ { "dependencies": { "com.unity.2d.animation": { - "version": "7.0.6", + "version": "7.0.11", "depth": 1, "source": "registry", "dependencies": { - "com.unity.2d.common": "6.0.3", + "com.unity.2d.common": "6.0.6", "com.unity.2d.sprite": "1.0.0", "com.unity.modules.animation": "1.0.0", "com.unity.modules.uielements": "1.0.0" }, "url": "https://packages.unity.com" }, + "com.unity.2d.aseprite": { + "version": "1.0.0", + "depth": 1, + "source": "registry", + "dependencies": { + "com.unity.2d.sprite": "1.0.0", + "com.unity.2d.common": "6.0.6", + "com.unity.mathematics": "1.2.6", + "com.unity.modules.animation": "1.0.0" + }, + "url": "https://packages.unity.com" + }, "com.unity.2d.common": { - "version": "6.0.3", + "version": "6.0.6", "depth": 2, "source": "registry", "dependencies": { @@ -32,19 +44,19 @@ "url": "https://packages.unity.com" }, "com.unity.2d.pixel-perfect": { - "version": "5.0.1", + "version": "5.0.3", "depth": 1, "source": "registry", "dependencies": {}, "url": "https://packages.unity.com" }, "com.unity.2d.psdimporter": { - "version": "6.0.4", + "version": "6.0.7", "depth": 1, "source": "registry", "dependencies": { - "com.unity.2d.animation": "7.0.6", - "com.unity.2d.common": "6.0.3", + "com.unity.2d.animation": "7.0.9", + "com.unity.2d.common": "6.0.6", "com.unity.2d.sprite": "1.0.0" }, "url": "https://packages.unity.com" @@ -56,12 +68,12 @@ "dependencies": {} }, "com.unity.2d.spriteshape": { - "version": "7.0.4", + "version": "7.0.7", "depth": 1, "source": "registry", "dependencies": { "com.unity.mathematics": "1.1.0", - "com.unity.2d.common": "6.0.3", + "com.unity.2d.common": "6.0.6", "com.unity.2d.path": "5.0.2", "com.unity.modules.physics2d": "1.0.0" }, @@ -74,7 +86,7 @@ "dependencies": {} }, "com.unity.2d.tilemap.extras": { - "version": "2.2.3", + "version": "2.2.6", "depth": 1, "source": "registry", "dependencies": { @@ -86,7 +98,7 @@ "url": "https://packages.unity.com" }, "com.unity.burst": { - "version": "1.6.6", + "version": "1.8.4", "depth": 1, "source": "registry", "dependencies": { @@ -95,12 +107,10 @@ "url": "https://packages.unity.com" }, "com.unity.collab-proxy": { - "version": "1.15.18", + "version": "2.0.7", "depth": 0, "source": "registry", - "dependencies": { - "com.unity.services.core": "1.0.1" - }, + "dependencies": {}, "url": "https://packages.unity.com" }, "com.unity.ext.nunit": { @@ -111,21 +121,22 @@ "url": "https://packages.unity.com" }, "com.unity.feature.2d": { - "version": "1.0.0", + "version": "2.0.0", "depth": 0, "source": "builtin", "dependencies": { - "com.unity.2d.animation": "7.0.6", - "com.unity.2d.pixel-perfect": "5.0.1", - "com.unity.2d.psdimporter": "6.0.4", + "com.unity.2d.animation": "7.0.11", + "com.unity.2d.pixel-perfect": "5.0.3", + "com.unity.2d.psdimporter": "6.0.7", "com.unity.2d.sprite": "1.0.0", - "com.unity.2d.spriteshape": "7.0.4", + "com.unity.2d.spriteshape": "7.0.7", "com.unity.2d.tilemap": "1.0.0", - "com.unity.2d.tilemap.extras": "2.2.3" + "com.unity.2d.tilemap.extras": "2.2.6", + "com.unity.2d.aseprite": "1.0.0" } }, "com.unity.ide.rider": { - "version": "3.0.15", + "version": "3.0.24", "depth": 0, "source": "registry", "dependencies": { @@ -134,7 +145,7 @@ "url": "https://packages.unity.com" }, "com.unity.ide.visualstudio": { - "version": "2.0.16", + "version": "2.0.18", "depth": 0, "source": "registry", "dependencies": { @@ -156,15 +167,8 @@ "dependencies": {}, "url": "https://packages.unity.com" }, - "com.unity.nuget.newtonsoft-json": { - "version": "3.0.2", - "depth": 2, - "source": "registry", - "dependencies": {}, - "url": "https://packages.unity.com" - }, "com.unity.render-pipelines.core": { - "version": "12.1.7", + "version": "12.1.12", "depth": 1, "source": "builtin", "dependencies": { @@ -174,14 +178,14 @@ } }, "com.unity.render-pipelines.universal": { - "version": "12.1.7", + "version": "12.1.12", "depth": 0, "source": "builtin", "dependencies": { "com.unity.mathematics": "1.2.1", - "com.unity.burst": "1.5.0", - "com.unity.render-pipelines.core": "12.1.7", - "com.unity.shadergraph": "12.1.7" + "com.unity.burst": "1.8.4", + "com.unity.render-pipelines.core": "12.1.12", + "com.unity.shadergraph": "12.1.12" } }, "com.unity.searcher": { @@ -191,28 +195,17 @@ "dependencies": {}, "url": "https://packages.unity.com" }, - "com.unity.services.core": { - "version": "1.4.0", - "depth": 1, - "source": "registry", - "dependencies": { - "com.unity.modules.unitywebrequest": "1.0.0", - "com.unity.nuget.newtonsoft-json": "3.0.2", - "com.unity.modules.androidjni": "1.0.0" - }, - "url": "https://packages.unity.com" - }, "com.unity.shadergraph": { - "version": "12.1.7", + "version": "12.1.12", "depth": 1, "source": "builtin", "dependencies": { - "com.unity.render-pipelines.core": "12.1.7", + "com.unity.render-pipelines.core": "12.1.12", "com.unity.searcher": "4.9.1" } }, "com.unity.test-framework": { - "version": "1.1.31", + "version": "1.1.33", "depth": 0, "source": "registry", "dependencies": { @@ -232,7 +225,7 @@ "url": "https://packages.unity.com" }, "com.unity.timeline": { - "version": "1.6.4", + "version": "1.6.5", "depth": 0, "source": "registry", "dependencies": { @@ -253,7 +246,7 @@ } }, "com.unity.visualscripting": { - "version": "1.7.8", + "version": "1.9.0", "depth": 0, "source": "registry", "dependencies": { diff --git a/ActiveRagdoll/ProjectSettings/ProjectVersion.txt b/ActiveRagdoll/ProjectSettings/ProjectVersion.txt index 4cb0460..cd32c29 100644 --- a/ActiveRagdoll/ProjectSettings/ProjectVersion.txt +++ b/ActiveRagdoll/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 2021.3.6f1 -m_EditorVersionWithRevision: 2021.3.6f1 (7da38d85baf6) +m_EditorVersion: 2021.3.30f1 +m_EditorVersionWithRevision: 2021.3.30f1 (b4360d7cdac4) diff --git a/Docs/TAB.txt b/Docs/TAB.txt new file mode 100644 index 0000000..82aad26 --- /dev/null +++ b/Docs/TAB.txt @@ -0,0 +1,24 @@ +Player +// 公共静态数据 +<RigidbodyHolder> 保存了所有的关节Rigidboy和Collider +<AnimationHandler> 保存<int动画状态编号, string动画状态名>映射,包括Jump, Crouch等 +<CharacterGearHandler> 装备挂点 + +// 公共动态数据 +<Gravity> 根据当前角色的状态,实时计算出一个当前的实时gravity +<StepHandler> 更新脚步切换状态,返回哪个脚在前,哪个在后,配合AnimationObject.cs +<MovementDataHandler> 移动时用到的实时物理检测数据 +<StandingDataHandler> 保存Standing.cs需要的实时物理检测数据 + +// 输入输出 +<InputHandler> 当前的键盘输入,决定了角色当前的逻辑状态,用在SetAnimationByInput,直接影响角色的动作 +<SetAnimationByInput> 根据键盘输入切换当前动作 + +// 动作 +<Balance> 平衡,给脚施加力,辅助平衡 +<Standing> 站立 +<MovementHandler> 移动、跳跃 +<Holding> 手持武器 + + +
\ No newline at end of file diff --git a/Docs/资料.xlsx b/Docs/资料.xlsx Binary files differindex 72f29f7..68da3d2 100644 --- a/Docs/资料.xlsx +++ b/Docs/资料.xlsx |