diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity index 2947835f..98f9628d 100644 --- a/Assets/Scenes/Main.unity +++ b/Assets/Scenes/Main.unity @@ -26,7 +26,7 @@ RenderSettings: m_AmbientIntensity: 1 m_AmbientMode: 0 m_SubtractiveShadowColor: {r: 0.13296545, g: 0.19145328, b: 0.33962262, a: 1} - m_SkyboxMaterial: {fileID: 2100004, guid: 6296e48663fd7ad46b1a2af507f871cf, type: 3} + m_SkyboxMaterial: {fileID: 2100000, guid: 0ffaa0b7117ba8c47a9d05ae701d4b4d, type: 2} m_HaloStrength: 0.5 m_FlareStrength: 1 m_FlareFadeSpeed: 3 @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_IndirectSpecularColor: {r: 0.2846214, g: 0.37120992, b: 0.498806, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -123,7 +123,7 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} ---- !u!1 &537733966 +--- !u!1 &547432235 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -131,13 +131,15 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 537733974} - - component: {fileID: 537733973} - - component: {fileID: 537733972} - - component: {fileID: 537733971} - - component: {fileID: 537733970} - - component: {fileID: 537733968} - - component: {fileID: 537733975} + - component: {fileID: 547432243} + - component: {fileID: 547432242} + - component: {fileID: 547432241} + - component: {fileID: 547432240} + - component: {fileID: 547432239} + - component: {fileID: 547432238} + - component: {fileID: 547432237} + - component: {fileID: 547432236} + - component: {fileID: 547432244} m_Layer: 0 m_Name: FlyCamera m_TagString: MainCamera @@ -145,13 +147,58 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!136 &537733968 +--- !u!114 &547432236 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 547432235} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0a0782d2b4482d547ad00c06c17202a4, type: 3} + m_Name: + m_EditorClassIdentifier: + moveSpeed: 5 + rotateSpeed: 1 + xRotationLimit: 60 + enableCollision: 1 + isMov: 1 + isRot: 1 +--- !u!54 &547432237 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 547432235} + serializedVersion: 4 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_CenterOfMass: {x: 0, y: 0, z: 0} + m_InertiaTensor: {x: 1, y: 1, z: 1} + m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ImplicitCom: 1 + m_ImplicitTensor: 1 + m_UseGravity: 0 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!136 &547432238 CapsuleCollider: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 537733966} + m_GameObject: {fileID: 547432235} m_Material: {fileID: 0} m_IncludeLayers: serializedVersion: 2 @@ -162,19 +209,19 @@ CapsuleCollider: m_LayerOverridePriority: 0 m_IsTrigger: 0 m_ProvidesContacts: 0 - m_Enabled: 0 + m_Enabled: 1 serializedVersion: 2 - m_Radius: 0.01 - m_Height: 0.01 + m_Radius: 1.0228593 + m_Height: 2.045719 m_Direction: 1 m_Center: {x: 0, y: 0, z: 0} ---- !u!114 &537733970 +--- !u!114 &547432239 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 537733966} + m_GameObject: {fileID: 547432235} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} @@ -212,29 +259,29 @@ MonoBehaviour: mipBias: 0 varianceClampScale: 0.9 contrastAdaptiveSharpening: 0 ---- !u!81 &537733971 +--- !u!81 &547432240 AudioListener: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 537733966} + m_GameObject: {fileID: 547432235} m_Enabled: 1 ---- !u!124 &537733972 +--- !u!124 &547432241 Behaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 537733966} + m_GameObject: {fileID: 547432235} m_Enabled: 1 ---- !u!20 &537733973 +--- !u!20 &547432242 Camera: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 537733966} + m_GameObject: {fileID: 547432235} m_Enabled: 1 serializedVersion: 2 m_ClearFlags: 1 @@ -259,12 +306,12 @@ Camera: y: 0 width: 1 height: 1 - near clip plane: 0.01 + near clip plane: 0.3 far clip plane: 1000 - field of view: 60 + field of view: 25 orthographic: 0 orthographic size: 5 - m_Depth: 0 + m_Depth: -1 m_CullingMask: serializedVersion: 2 m_Bits: 4294967295 @@ -279,40 +326,35 @@ Camera: m_OcclusionCulling: 1 m_StereoConvergence: 10 m_StereoSeparation: 0.022 ---- !u!4 &537733974 +--- !u!4 &547432243 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 537733966} + m_GameObject: {fileID: 547432235} serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068} - m_LocalPosition: {x: 4.89, y: 1.73, z: 0} + m_LocalRotation: {x: 0.059811153, y: 0.9234663, z: -0.16098467, w: 0.34309843} + m_LocalPosition: {x: -4.2800546, y: 3.0786743, z: 3.6917665} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0} ---- !u!114 &537733975 + m_LocalEulerAnglesHint: {x: 19.976, y: 11.67, z: 0} +--- !u!114 &547432244 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 537733966} + m_GameObject: {fileID: 547432235} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0a0782d2b4482d547ad00c06c17202a4, type: 3} + m_Script: {fileID: 11500000, guid: b2c08eae7cce6c9479adebcaad5706c3, type: 3} m_Name: m_EditorClassIdentifier: - moveSpeed: 5 - rotateSpeed: 1 - xRotationLimit: 60 - enableCollision: 1 - isMov: 1 - isRot: 1 ---- !u!1 &738580945 + animSpeed: 1 +--- !u!1 &1089184132 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -320,39 +362,8 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 738580946} - m_Layer: 0 - m_Name: "\u732A\u7684\u9879\u76EE" - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &738580946 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 738580945} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 3.9182436, y: 1.2063533, z: -0.59599787} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1513158594 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1513158595} - - component: {fileID: 1513158596} + - component: {fileID: 1089184134} + - component: {fileID: 1089184133} m_Layer: 0 m_Name: Launch m_TagString: Untagged @@ -360,13 +371,25 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &1513158595 +--- !u!114 &1089184133 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1089184132} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: df1da35b6adc57842b2ef6b620e87390, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &1089184134 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1513158594} + m_GameObject: {fileID: 1089184132} serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} @@ -375,22 +398,178 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1513158596 +--- !u!1 &1548041028 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1548041030} + - component: {fileID: 1548041029} + m_Layer: 0 + m_Name: Global Volume + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1548041029 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1513158594} + m_GameObject: {fileID: 1548041028} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: df1da35b6adc57842b2ef6b620e87390, type: 3} + m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3} m_Name: m_EditorClassIdentifier: + m_IsGlobal: 1 + priority: 0 + blendDistance: 0 + weight: 1 + sharedProfile: {fileID: 11400000, guid: cc15d5c774ad0e9439ba4753a231849c, type: 2} +--- !u!4 &1548041030 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1548041028} + 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: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1655025498 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1655025501} + - component: {fileID: 1655025500} + - component: {fileID: 1655025499} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1655025499 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1655025498} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Version: 3 + m_UsePipelineSettings: 1 + m_AdditionalLightsShadowResolutionTier: 2 + m_LightLayerMask: 1 + m_RenderingLayers: 1 + m_CustomShadowLayers: 0 + m_ShadowLayerMask: 1 + m_ShadowRenderingLayers: 1 + m_LightCookieSize: {x: 1, y: 1} + m_LightCookieOffset: {x: 0, y: 0} + m_SoftShadowQuality: 1 +--- !u!108 &1655025500 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1655025498} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &1655025501 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1655025498} + serializedVersion: 2 + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} --- !u!1660057539 &9223372036854775807 SceneRoots: m_ObjectHideFlags: 0 m_Roots: - - {fileID: 1513158595} - - {fileID: 537733974} - - {fileID: 738580946} + - {fileID: 1548041030} + - {fileID: 1655025501} + - {fileID: 547432243} + - {fileID: 1089184134} diff --git a/Assets/Scripts/Actions/AnimationAction.cs b/Assets/Scripts/Actions/AnimationAction.cs index 5a9691af..103cffbd 100644 --- a/Assets/Scripts/Actions/AnimationAction.cs +++ b/Assets/Scripts/Actions/AnimationAction.cs @@ -54,6 +54,7 @@ namespace QFramework { int curFrame = 0; int.TryParse(frame, out curFrame); + anim.clip = anim[animName].clip; anim[animName].time = curFrame / anim.clip.frameRate; anim[animName].speed = 0; anim.Play(animName); diff --git a/Assets/Scripts/Actions/MoveAction.cs b/Assets/Scripts/Actions/MoveAction.cs index 8226976c..5543055c 100644 --- a/Assets/Scripts/Actions/MoveAction.cs +++ b/Assets/Scripts/Actions/MoveAction.cs @@ -19,7 +19,7 @@ public class MoveAction : IAction Vector3 pos; float time; string path; - public static MoveAction Allocate(string path , Vector3 pos, float time, System.Action onDelayFinish = null) + public static MoveAction Allocate(string path, Vector3 pos, float time, System.Action onDelayFinish = null) { var retNode = mPool.Allocate(); retNode.ActionID = ActionKit.ID_GENERATOR++; @@ -53,6 +53,12 @@ public class MoveAction : IAction public void OnStart() { GameObject obj = Utility.FindObj(path); + if (obj == null) + { + Debug.LogError($"没有找到路径{path}"); + return; + } + obj.transform.DOMove(pos, time).onComplete = () => this.Finish(); ; } diff --git a/Assets/Scripts/TimeScaleController.cs b/Assets/Scripts/TimeScaleController.cs index 95a26458..5e8be5ce 100644 --- a/Assets/Scripts/TimeScaleController.cs +++ b/Assets/Scripts/TimeScaleController.cs @@ -1,15 +1,17 @@ +using QFramework; using System.Collections; using System.Collections.Generic; using UnityEngine; - public class TimeScaleController : MonoBehaviour { [Range(0, 10)] public float animSpeed = 1.0f; +#if UNITY_WEBGL + [System.Runtime.InteropServices.DllImport("__Internal")] + private static extern void CopyToClipboard(string text); +#endif - -#if UNITY_EDITOR private void Update() { Time.timeScale = animSpeed; @@ -29,6 +31,20 @@ public class TimeScaleController : MonoBehaviour { animSpeed = 0; } - } +#if UNITY_WEBGL + if (Input.GetKey(KeyCode.LeftAlt) || Input.GetKey(KeyCode.RightControl)) + { + if (Input.GetKeyDown(KeyCode.Q)) + { + Debug.Log("Ctrl + Q 被按下!"); + string str = string.Empty; + str = $"Posision:{gameObject.transform.position}\nRotate:{gameObject.transform.eulerAngles}"; + + CopyToClipboard(str); + + } + } #endif + } + } diff --git a/Assets/Scripts/UI/UIPointQuestion.cs b/Assets/Scripts/UI/UIPointQuestion.cs index f9cb7d81..cb8ba3e3 100644 --- a/Assets/Scripts/UI/UIPointQuestion.cs +++ b/Assets/Scripts/UI/UIPointQuestion.cs @@ -41,6 +41,10 @@ namespace QFramework.Example point.name = (i + 1).ToString(); pointMap.Add(obj, point); } + else + { + Debug.LogError($"没有找到路径{path}"); + } } } diff --git a/Assets/WebGLDownLoadWord/Plugins/WebGLDownloadFile.jslib b/Assets/WebGLDownLoadWord/Plugins/WebGLDownloadFile.jslib index 925f54ef..dcdfd155 100644 --- a/Assets/WebGLDownLoadWord/Plugins/WebGLDownloadFile.jslib +++ b/Assets/WebGLDownLoadWord/Plugins/WebGLDownloadFile.jslib @@ -11,5 +11,17 @@ mergeInto(LibraryManager.library, { HtmlDownloadWord(bytes,reportdata); - } + }, + CopyToClipboard: function(text) { + + var str = Pointer_stringify(text); + + + if (navigator.clipboard) { + navigator.clipboard.writeText(str).then(function() { + }).catch(function(error) { + }); + } else { + } + } });