From 7bb5d80f6b8f2d66d096fe7ddfd6f2299d3c1321 Mon Sep 17 00:00:00 2001 From: Qiu_Mi Date: Wed, 29 Mar 2023 23:49:47 +0800 Subject: [PATCH] - Fix ItemManager error on editor start. - Fix Rigidbody moving lag problem. - Add config for skylight's shadow. --- CHANGELOG.md | 5 +++ ProjectConfig~/manifest.json | 2 +- .../AC_CursorStateBehaviourCollection.cs | 7 +++++ .../Base/AC_TransformControllerBase.cs | 31 ++++++++++--------- .../AC_DefaultEnvironmentController.cs | 2 ++ .../Base/Cursor/AC_StateManagerBase.cs | 5 +++ .../Base/System/AC_SystemCursorManagerBase.cs | 6 ++-- .../Interface/Cursor/IAC_StateManager.cs | 6 ++++ .../Scripts/Editor/AC_ItemManagerWindow.cs | 2 +- .../Controller/Transform/DefaultTCC.asset | 2 +- UMod/Resources/Editor/ModToolsSettings.asset | 4 +-- package.json | 2 +- 12 files changed, 51 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f7000610..438d1967 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## [3.5.0] +- Fix ItemManager error on editor start. +- Fix Rigidbody moving lag problem. +- Add config for skylight's shadow. + ## [3.4.0] - Add AC_ImagePlayer for external image or gif files. - Add support for Mod's Run&Build. diff --git a/ProjectConfig~/manifest.json b/ProjectConfig~/manifest.json index 7cdd8ae6..ee28d3c0 100644 --- a/ProjectConfig~/manifest.json +++ b/ProjectConfig~/manifest.json @@ -16,7 +16,7 @@ } ], "dependencies": { - "com.threeyes.alivecursor.sdk": "3.4.0", + "com.threeyes.alivecursor.sdk": "3.5.0", "com.unity.demoteam.hair": "https://github.com/Unity-Technologies/com.unity.demoteam.hair.git#0.10.0-exp.1", "com.beans.deform": "1.2.1", "com.coffee.ui-effect": "4.0.0-preview.9", diff --git a/Threeyes/SDK/Scripts/Component/Cursor/Behaviour/State/AC_CursorStateBehaviourCollection.cs b/Threeyes/SDK/Scripts/Component/Cursor/Behaviour/State/AC_CursorStateBehaviourCollection.cs index b6bf2f3b..34fd7754 100644 --- a/Threeyes/SDK/Scripts/Component/Cursor/Behaviour/State/AC_CursorStateBehaviourCollection.cs +++ b/Threeyes/SDK/Scripts/Component/Cursor/Behaviour/State/AC_CursorStateBehaviourCollection.cs @@ -15,6 +15,7 @@ public class AC_CursorStateBehaviourCollection : AC_BehaviourCollectionBase : AC_Config public Transform CursorTransform { get { return cursorTransform; } } protected Transform cursorTransform;//Cursor's transform - protected float deltaTime { get { return CursorRigidbody ? Time.fixedDeltaTime : Time.deltaTime; } } + protected float deltaTime { get { return/* CursorRigidbody ? Time.fixedDeltaTime : */Time.deltaTime; } } protected Vector3 SystemCursorPosition { get { return AC_ManagerHolder.SystemCursorManager.WorldPosition; } } #region Callback @@ -73,16 +73,17 @@ public virtual void UpdateFunc() if (!CurAliveCursor) return; - if (!cursorRigidbody) - UpdateMovement(); + //if (!cursorRigidbody) + UpdateMovement(); } public virtual void FixedUpdateFunc() { - if (!CurAliveCursor) - return; + //ToDelete:会导致跟随系统光标延迟的问题,统一改为移动Transform组件 + //if (!CurAliveCursor) + // return; - if (cursorRigidbody) - UpdateMovement(); + //if (cursorRigidbody) + // UpdateMovement(); } public abstract void UpdateMovement(); public virtual void Teleport(Vector3 position) @@ -98,17 +99,17 @@ public virtual void SetLocalScale(float size, Vector3 unitScale) protected virtual void UpdateCursorPosition(Vector3 value) { //根据物体有无Rigidbody,调用对应方法 - if (cursorRigidbody) - cursorRigidbody.MovePosition(value); - else if (cursorTransform) - cursorTransform.position = value; + //if (cursorRigidbody) + // cursorRigidbody.MovePosition(value); + //else if (cursorTransform) + cursorTransform.position = value; } protected virtual void UpdateCursorRotation(Quaternion value) { - if (cursorRigidbody) - cursorRigidbody.MoveRotation(value); - else - cursorTransform.rotation = value; + //if (cursorRigidbody) + // cursorRigidbody.MoveRotation(value); + //else + cursorTransform.rotation = value; } } diff --git a/Threeyes/SDK/Scripts/Component/Cursor/Controller/Environment/AC_DefaultEnvironmentController.cs b/Threeyes/SDK/Scripts/Component/Cursor/Controller/Environment/AC_DefaultEnvironmentController.cs index 72e706c1..bf2c9ef3 100644 --- a/Threeyes/SDK/Scripts/Component/Cursor/Controller/Environment/AC_DefaultEnvironmentController.cs +++ b/Threeyes/SDK/Scripts/Component/Cursor/Controller/Environment/AC_DefaultEnvironmentController.cs @@ -89,6 +89,7 @@ public override void SetLights(bool isUse) sunSourceLight.transform.eulerAngles = Config.sunLightRotation; sunSourceLight.intensity = Config.sunLightIntensity; sunSourceLight.color = Config.sunLightColor; + sunSourceLight.shadows = Config.lightShadowType; } } base.SetLights(isUse); @@ -216,6 +217,7 @@ public class ConfigInfo : AC_SerializableDataBase [EnableIf(nameof(isUseLights))] [AllowNesting] public Vector3 sunLightRotation = new Vector3(30, 30, 240); [EnableIf(nameof(isUseLights))] [AllowNesting] [Range(0, 8)] public float sunLightIntensity = 0.3f; [EnableIf(nameof(isUseLights))] [AllowNesting] public Color sunLightColor = Color.white; + [EnableIf(nameof(isUseLights))] public LightShadows lightShadowType = LightShadows.None; [Header("ReflectionProbe")] [PersistentValueChanged(nameof(OnPersistentValueChanged_IsUseReflection))] public bool isUseReflection = true; diff --git a/Threeyes/SDK/Scripts/Component/Manager/Base/Cursor/AC_StateManagerBase.cs b/Threeyes/SDK/Scripts/Component/Manager/Base/Cursor/AC_StateManagerBase.cs index a22da322..fc5df16e 100644 --- a/Threeyes/SDK/Scripts/Component/Manager/Base/Cursor/AC_StateManagerBase.cs +++ b/Threeyes/SDK/Scripts/Component/Manager/Base/Cursor/AC_StateManagerBase.cs @@ -21,6 +21,11 @@ public class AC_StateManagerBase : AC_ManagerWithControllerBase /// 检查指定体积的物体是否在相机视野内 diff --git a/Threeyes/SDK/Scripts/Component/Manager/Interface/Cursor/IAC_StateManager.cs b/Threeyes/SDK/Scripts/Component/Manager/Interface/Cursor/IAC_StateManager.cs index 81eb53d7..fdb33d27 100644 --- a/Threeyes/SDK/Scripts/Component/Manager/Interface/Cursor/IAC_StateManager.cs +++ b/Threeyes/SDK/Scripts/Component/Manager/Interface/Cursor/IAC_StateManager.cs @@ -9,6 +9,12 @@ public interface IAC_StateManager : IAC_Manager_ModInitHandler, IManagerWithCont AC_CursorState CurCursorState { get; } AC_CursorState LastCursorState { get; } + /// + /// Check if AC is vanished in specify state (Exit、Hide、StandBy) + /// + /// + /// + bool IsVanishState(AC_CursorState cursorState); /// /// Check if target ActionState Completed /// diff --git a/Threeyes/SDK/Scripts/Editor/AC_ItemManagerWindow.cs b/Threeyes/SDK/Scripts/Editor/AC_ItemManagerWindow.cs index e87c6eb3..31ab89b0 100644 --- a/Threeyes/SDK/Scripts/Editor/AC_ItemManagerWindow.cs +++ b/Threeyes/SDK/Scripts/Editor/AC_ItemManagerWindow.cs @@ -177,8 +177,8 @@ private void OnEnable() buttonEditScene.RegisterCallback(OnEditSceneButtonClick); textFieldExePath = rootVisualElement.Q("ExePathTextField"); - textFieldExePath.RegisterCallback>(OnExePathTextFieldChanged); textFieldExePath.value = SOManagerInst.ItemWindow_ExePath; + textFieldExePath.RegisterCallback>(OnExePathTextFieldChanged); buttonSelectExe = rootVisualElement.Q