diff --git a/Convention/[ES3]/Easy Save 3/Resources/ES3/ES3Defaults.asset b/Convention/[ES3]/Easy Save 3/Resources/ES3/ES3Defaults.asset index 7096928..e9368b5 100644 --- a/Convention/[ES3]/Easy Save 3/Resources/ES3/ES3Defaults.asset +++ b/Convention/[ES3]/Easy Save 3/Resources/ES3/ES3Defaults.asset @@ -37,6 +37,11 @@ MonoBehaviour: - Dreamteck.Splines - Dreamteck.Utilities - EasySave3 + - glTFast + - glTFast.Documentation.Examples + - glTFast.dots + - glTFast.Export + - glTFast.Newtonsoft - LeanCommon - LeanGUI - LeanTransition diff --git a/Convention/[Runtime]/Camera/FreeSceneCamera.cs b/Convention/[Runtime]/Camera/FreeSceneCamera.cs index ad5fc8f..c0ca162 100644 --- a/Convention/[Runtime]/Camera/FreeSceneCamera.cs +++ b/Convention/[Runtime]/Camera/FreeSceneCamera.cs @@ -1,6 +1,3 @@ -using System.Collections; -using System.Collections.Generic; -using Cinemachine; using Convention.WindowsUI.Variant; using UnityEngine; using UnityEngine.InputSystem; @@ -29,6 +26,16 @@ namespace Convention } } + public void SetMoveSpeed(float value) + { + moveSpeed = value; + } + + public void SetRotationSpeed(float value) + { + rotationSpeed = value; + } + private void Start() { m_IsFocus = false; diff --git a/Convention/[Runtime]/Config.cs b/Convention/[Runtime]/Config.cs index ed04468..05766c0 100644 --- a/Convention/[Runtime]/Config.cs +++ b/Convention/[Runtime]/Config.cs @@ -1064,33 +1064,62 @@ namespace Convention public class ActionStepCoroutineWrapper { - private List> steps = new(); + private class YieldInstructionWrapper + { + public YieldInstruction UnityYieldInstruction; + public CustomYieldInstruction CustomYieldInstruction; + + public YieldInstructionWrapper() + { + + } + + public YieldInstructionWrapper(YieldInstruction unityYieldInstruction) + { + this.UnityYieldInstruction = unityYieldInstruction; + } + + public YieldInstructionWrapper(CustomYieldInstruction customYieldInstruction) + { + this.CustomYieldInstruction = customYieldInstruction; + } + } + + private List> steps = new(); public ActionStepCoroutineWrapper Update(Action action) { - steps.Add(new(null, action)); + steps.Add(new(new(), action)); return this; } public ActionStepCoroutineWrapper Wait(float time, Action action) { - steps.Add(new(new WaitForSeconds(time), action)); + steps.Add(new(new(new WaitForSeconds(time)), action)); return this; } public ActionStepCoroutineWrapper FixedUpdate(Action action) { - steps.Add(new(new WaitForFixedUpdate(), action)); + steps.Add(new(new (new WaitForFixedUpdate()), action)); return this; } public ActionStepCoroutineWrapper Next(Action action) { - steps.Add(new(new WaitForEndOfFrame(), action)); + steps.Add(new(new(new WaitForEndOfFrame()), action)); return this; } - private static IEnumerator Execute(List> steps) + public ActionStepCoroutineWrapper Until(Func pr, Action action) + { + steps.Add(new(new(new WaitUntil(pr)), action)); + return this; + } + private static IEnumerator Execute(List> steps) { foreach (var (waiting, action) in steps) { action(); - yield return waiting; + if (waiting.UnityYieldInstruction != null) + yield return waiting.UnityYieldInstruction; + else + yield return waiting.CustomYieldInstruction; } } ~ActionStepCoroutineWrapper() @@ -1099,7 +1128,7 @@ namespace Convention } public void Invoke() { - StartCoroutine(Execute(new List>(steps))); + StartCoroutine(Execute(new List>(steps))); steps.Clear(); } } diff --git a/Convention/[Runtime]/File.cs b/Convention/[Runtime]/File.cs index cc3f868..a1066cd 100644 --- a/Convention/[Runtime]/File.cs +++ b/Convention/[Runtime]/File.cs @@ -283,6 +283,18 @@ namespace Convention callback(result.assetBundle); yield return null; } + public IEnumerator LoadAsAssetBundle([In]Action progress, [In] Action callback) + { + AssetBundleCreateRequest result = AssetBundle.LoadFromFileAsync(FullPath); + while (result.isDone == false) + { + progress(result.progress); + yield return null; + } + yield return result; + callback(result.assetBundle); + yield return null; + } public string LoadAsUnknown(string suffix) { diff --git a/Convention/[Visual]/UIComponent/GradientEffect.cs b/Convention/[Visual]/UIComponent/GradientEffect.cs index 7081287..bf0a5fa 100644 --- a/Convention/[Visual]/UIComponent/GradientEffect.cs +++ b/Convention/[Visual]/UIComponent/GradientEffect.cs @@ -34,7 +34,7 @@ namespace Convention { colorKeys = new GradientColorKey[] { - new GradientColorKey(Color.white, 1), + new GradientColorKey(Color.white, 0), new GradientColorKey(Color.white, 1) } }; diff --git a/Convention/[Visual]/UIComponent/Variant/FocusWindowIndictaor.cs b/Convention/[Visual]/UIComponent/Variant/FocusWindowIndictaor.cs index 3f48234..682b16d 100644 --- a/Convention/[Visual]/UIComponent/Variant/FocusWindowIndictaor.cs +++ b/Convention/[Visual]/UIComponent/Variant/FocusWindowIndictaor.cs @@ -8,27 +8,51 @@ namespace Convention.WindowsUI.Variant { [Setting, Range(0, 1), Percentage(0, 1)] public float Speed = 0.36f; [Resources, OnlyNotNullMode] public RectTransform RectBox; - [Resources, OnlyNotNullMode] public RectTransform RopParent; + [Resources, OnlyNotNullMode] public RectTransform TopParent; [Resources] public List Targets = new(); [Content] public int TargetIndex; - [Content, OnlyPlayMode] public RectTransform Target; + public RectTransform Target { get; private set; } + + private Stack Tasks = new(); public void SetTargetRectTransform(RectTransform target) { - Target = target; + if (target == null) + { + Target = null; + RectTransformInfo.UpdateAnimationPlane(TopParent, RectBox, Speed, 0, true); + } + else + { + ConventionUtility.ActionStepCoroutineWrapper task = ConventionUtility.CreateSteps(); + task.Next(() => + { + if (gameObject.activeInHierarchy == false) + RectTransformInfo.UpdateAnimationPlane(TopParent, RectBox, 1, 0, true); + }) + .Until(() => target.gameObject.activeInHierarchy == true && Tasks.Peek() == task, () => Target = target) + .Next(() => Tasks.TryPop(out var _)) + .Invoke(); + Tasks.Push(task); + } } public void SelectNextTarget() { - Debug.Log(TargetIndex); Target = Targets[TargetIndex = (TargetIndex + 1) % Targets.Count]; } + private void Start() + { + if (TopParent == null) + TopParent = transform.parent as RectTransform; + } + private void LateUpdate() { if (Target != null) RectTransformInfo.UpdateAnimationPlane(Target, RectBox, Speed, 0, true); else - RectTransformInfo.UpdateAnimationPlane(RopParent, RectBox, Speed, 0, true); + RectTransformInfo.UpdateAnimationPlane(TopParent, RectBox, Speed, 0, true); } } } diff --git a/Convention/[Visual]/UIComponent/Variant/HierarchyWindow/HierarchyWindow.cs b/Convention/[Visual]/UIComponent/Variant/HierarchyWindow/HierarchyWindow.cs index c3acd55..05e8389 100644 --- a/Convention/[Visual]/UIComponent/Variant/HierarchyWindow/HierarchyWindow.cs +++ b/Convention/[Visual]/UIComponent/Variant/HierarchyWindow/HierarchyWindow.cs @@ -125,6 +125,25 @@ namespace Convention.WindowsUI.Variant }); } } + + public void MakeFocusOn(HierarchyItem target) + { + static void BFS(HierarchyItem t) + { + var next = t.Entry.GetParent(); + if (next != null) + { + BFS(next.GetHierarchyItem()); + next.GetHierarchyItem().IsFold = false; + } + } + + BFS(target); + if (FocusWindowIndictaor.instance != null) + { + FocusWindowIndictaor.instance.SetTargetRectTransform(target.TextRectTransform); + } + } } } diff --git a/Convention/[Visual]/[Prefabs]/Root.prefab b/Convention/[Visual]/[Prefabs]/Root.prefab index 99b64da..96a5cc8 100644 --- a/Convention/[Visual]/[Prefabs]/Root.prefab +++ b/Convention/[Visual]/[Prefabs]/Root.prefab @@ -91,7 +91,7 @@ MonoBehaviour: m_EditorClassIdentifier: Speed: 0.32 RectBox: {fileID: 6272003121708756342} - RopParent: {fileID: 8773560469810817739} + TopParent: {fileID: 0} Targets: - {fileID: 0} - {fileID: 7709311530016948315} @@ -100,7 +100,6 @@ MonoBehaviour: - {fileID: 2403051311178796671} - {fileID: 5377214671440830306} TargetIndex: 0 - Target: {fileID: 0} --- !u!114 &7462675906960032546 MonoBehaviour: m_ObjectHideFlags: 0