Commit b28d0151 authored by SherryChaos's avatar SherryChaos

playback speed config

parent a186af36
MDPro3 v1.1.2更新: MDPro3 v1.1.2更新:
1.修复了在决斗中需要输入文字时(如[抹杀之指名者]),会响应快捷键功能的错误。 1.现在能在设置中设置决斗时的加速倍率了。
2.修复由对方发动的[闪刀起动-交闪]的特效中的卡片不是检索的卡片的错误。 2.修复了在决斗中需要输入文字时(如[抹杀之指名者]),会响应快捷键功能的错误。
3.修复选择卡组界面的卡组数多到需要滚动浏览时,删除卡组会错位删除的错误。 3.修复由对方发动的[闪刀起动-交闪]的特效中的卡片不是检索的卡片的错误。
4.增加发送消息的间隔时间,减少CPU开销。 4.修复选择卡组界面的卡组数多到需要滚动浏览时,删除卡组会错位删除的错误。
5.增加发送消息的间隔时间,减少CPU开销。
MDPro3 v1.1.1更新: MDPro3 v1.1.1更新:
1.新投稿动画:琰魔龙 红莲魔·渊、龙骑士 D-终。 1.新投稿动画:琰魔龙 红莲魔·渊、龙骑士 D-终。
......
This diff is collapsed.
...@@ -7,8 +7,8 @@ AnimationClip: ...@@ -7,8 +7,8 @@ AnimationClip:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_Name: Closeup Loop m_Name: Closeup Loop
serializedVersion: 6 serializedVersion: 7
m_Legacy: 1 m_Legacy: 0
m_Compressed: 0 m_Compressed: 0
m_UseHighQualityCurve: 1 m_UseHighQualityCurve: 1
m_RotationCurves: [] m_RotationCurves: []
...@@ -51,7 +51,8 @@ AnimationClip: ...@@ -51,7 +51,8 @@ AnimationClip:
path: path:
m_ScaleCurves: [] m_ScaleCurves: []
m_FloatCurves: m_FloatCurves:
- curve: - serializedVersion: 2
curve:
serializedVersion: 2 serializedVersion: 2
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
...@@ -88,7 +89,9 @@ AnimationClip: ...@@ -88,7 +89,9 @@ AnimationClip:
path: path:
classID: 23 classID: 23
script: {fileID: 0} script: {fileID: 0}
- curve: flags: 16
- serializedVersion: 2
curve:
serializedVersion: 2 serializedVersion: 2
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
...@@ -125,14 +128,42 @@ AnimationClip: ...@@ -125,14 +128,42 @@ AnimationClip:
path: path:
classID: 23 classID: 23
script: {fileID: 0} script: {fileID: 0}
flags: 16
m_PPtrCurves: [] m_PPtrCurves: []
m_SampleRate: 60 m_SampleRate: 60
m_WrapMode: 2 m_WrapMode: 0
m_Bounds: m_Bounds:
m_Center: {x: 0, y: 0, z: 0} m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0} m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant: m_ClipBindingConstant:
genericBindings: [] genericBindings:
- serializedVersion: 2
path: 0
attribute: 1
script: {fileID: 0}
typeID: 4
customType: 0
isPPtrCurve: 0
isIntCurve: 0
isSerializeReferenceCurve: 0
- serializedVersion: 2
path: 0
attribute: 2238334251
script: {fileID: 0}
typeID: 23
customType: 22
isPPtrCurve: 0
isIntCurve: 0
isSerializeReferenceCurve: 0
- serializedVersion: 2
path: 0
attribute: 2286328038
script: {fileID: 0}
typeID: 23
customType: 22
isPPtrCurve: 0
isIntCurve: 0
isSerializeReferenceCurve: 0
pptrCurveMapping: [] pptrCurveMapping: []
m_AnimationClipSettings: m_AnimationClipSettings:
serializedVersion: 2 serializedVersion: 2
...@@ -155,7 +186,8 @@ AnimationClip: ...@@ -155,7 +186,8 @@ AnimationClip:
m_HeightFromFeet: 0 m_HeightFromFeet: 0
m_Mirror: 0 m_Mirror: 0
m_EditorCurves: m_EditorCurves:
- curve: - serializedVersion: 2
curve:
serializedVersion: 2 serializedVersion: 2
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
...@@ -183,7 +215,9 @@ AnimationClip: ...@@ -183,7 +215,9 @@ AnimationClip:
path: path:
classID: 4 classID: 4
script: {fileID: 0} script: {fileID: 0}
- curve: flags: 16
- serializedVersion: 2
curve:
serializedVersion: 2 serializedVersion: 2
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
...@@ -220,7 +254,9 @@ AnimationClip: ...@@ -220,7 +254,9 @@ AnimationClip:
path: path:
classID: 4 classID: 4
script: {fileID: 0} script: {fileID: 0}
- curve: flags: 16
- serializedVersion: 2
curve:
serializedVersion: 2 serializedVersion: 2
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
...@@ -257,7 +293,9 @@ AnimationClip: ...@@ -257,7 +293,9 @@ AnimationClip:
path: path:
classID: 4 classID: 4
script: {fileID: 0} script: {fileID: 0}
- curve: flags: 16
- serializedVersion: 2
curve:
serializedVersion: 2 serializedVersion: 2
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
...@@ -294,7 +332,9 @@ AnimationClip: ...@@ -294,7 +332,9 @@ AnimationClip:
path: path:
classID: 23 classID: 23
script: {fileID: 0} script: {fileID: 0}
- curve: flags: 16
- serializedVersion: 2
curve:
serializedVersion: 2 serializedVersion: 2
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
...@@ -331,7 +371,8 @@ AnimationClip: ...@@ -331,7 +371,8 @@ AnimationClip:
path: path:
classID: 23 classID: 23
script: {fileID: 0} script: {fileID: 0}
flags: 16
m_EulerEditorCurves: [] m_EulerEditorCurves: []
m_HasGenericRootTransform: 0 m_HasGenericRootTransform: 1
m_HasMotionFloatCurves: 0 m_HasMotionFloatCurves: 0
m_Events: [] m_Events: []
fileFormatVersion: 2 fileFormatVersion: 2
guid: 7cde87ae2453e0341a21ee3a5cf922bc guid: f82ba583fa1de4b42af69c5a0b92dd89
NativeFormatImporter: NativeFormatImporter:
externalObjects: {} externalObjects: {}
mainObjectFileID: 7400000 mainObjectFileID: 7400000
......
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1107 &-7652759335347392060
AnimatorStateMachine:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Base Layer
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: -1415005854784459293}
m_Position: {x: 310, y: 150, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 50, y: 20, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: -1415005854784459293}
--- !u!1102 &-1415005854784459293
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Closeup Loop
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: f82ba583fa1de4b42af69c5a0b92dd89, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Closeup
serializedVersion: 5
m_AnimatorParameters: []
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: -7652759335347392060}
m_Mask: {fileID: 0}
m_Motions: []
m_Behaviours: []
m_BlendingMode: 0
m_SyncedLayerIndex: -1
m_DefaultWeight: 0
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
fileFormatVersion: 2
guid: cb8b0904521730e479405762e99353cf
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 9100000
userData:
assetBundleName:
assetBundleVariant:
...@@ -1487,7 +1487,7 @@ MonoBehaviour: ...@@ -1487,7 +1487,7 @@ MonoBehaviour:
m_linkedTextComponent: {fileID: 0} m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0} parentLinkedComponent: {fileID: 0}
m_enableKerning: 1 m_enableKerning: 1
m_ActiveFontFeatures: 00000000 m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0 m_enableExtraPadding: 0
checkPaddingRequired: 0 checkPaddingRequired: 0
m_isRichText: 1 m_isRichText: 1
...@@ -2027,7 +2027,7 @@ MonoBehaviour: ...@@ -2027,7 +2027,7 @@ MonoBehaviour:
m_linkedTextComponent: {fileID: 0} m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0} parentLinkedComponent: {fileID: 0}
m_enableKerning: 1 m_enableKerning: 1
m_ActiveFontFeatures: 00000000 m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0 m_enableExtraPadding: 0
checkPaddingRequired: 0 checkPaddingRequired: 0
m_isRichText: 1 m_isRichText: 1
...@@ -3405,7 +3405,7 @@ MonoBehaviour: ...@@ -3405,7 +3405,7 @@ MonoBehaviour:
m_linkedTextComponent: {fileID: 0} m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0} parentLinkedComponent: {fileID: 0}
m_enableKerning: 1 m_enableKerning: 1
m_ActiveFontFeatures: 00000000 m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0 m_enableExtraPadding: 0
checkPaddingRequired: 0 checkPaddingRequired: 0
m_isRichText: 1 m_isRichText: 1
...@@ -5289,7 +5289,7 @@ MonoBehaviour: ...@@ -5289,7 +5289,7 @@ MonoBehaviour:
m_linkedTextComponent: {fileID: 0} m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0} parentLinkedComponent: {fileID: 0}
m_enableKerning: 1 m_enableKerning: 1
m_ActiveFontFeatures: 00000000 m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0 m_enableExtraPadding: 0
checkPaddingRequired: 0 checkPaddingRequired: 0
m_isRichText: 1 m_isRichText: 1
...@@ -5479,7 +5479,7 @@ MonoBehaviour: ...@@ -5479,7 +5479,7 @@ MonoBehaviour:
m_linkedTextComponent: {fileID: 0} m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0} parentLinkedComponent: {fileID: 0}
m_enableKerning: 1 m_enableKerning: 1
m_ActiveFontFeatures: 00000000 m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0 m_enableExtraPadding: 0
checkPaddingRequired: 0 checkPaddingRequired: 0
m_isRichText: 1 m_isRichText: 1
...@@ -7259,7 +7259,7 @@ MonoBehaviour: ...@@ -7259,7 +7259,7 @@ MonoBehaviour:
m_linkedTextComponent: {fileID: 0} m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0} parentLinkedComponent: {fileID: 0}
m_enableKerning: 1 m_enableKerning: 1
m_ActiveFontFeatures: 00000000 m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0 m_enableExtraPadding: 0
checkPaddingRequired: 0 checkPaddingRequired: 0
m_isRichText: 1 m_isRichText: 1
...@@ -7861,7 +7861,7 @@ MonoBehaviour: ...@@ -7861,7 +7861,7 @@ MonoBehaviour:
m_linkedTextComponent: {fileID: 0} m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0} parentLinkedComponent: {fileID: 0}
m_enableKerning: 1 m_enableKerning: 1
m_ActiveFontFeatures: 00000000 m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0 m_enableExtraPadding: 0
checkPaddingRequired: 0 checkPaddingRequired: 0
m_isRichText: 1 m_isRichText: 1
...@@ -8103,14 +8103,14 @@ GameObject: ...@@ -8103,14 +8103,14 @@ GameObject:
- component: {fileID: 7054723813857180373} - component: {fileID: 7054723813857180373}
- component: {fileID: 6649853422301183784} - component: {fileID: 6649853422301183784}
- component: {fileID: 605570153835571427} - component: {fileID: 605570153835571427}
- component: {fileID: 8128078600370031616} - component: {fileID: 7707483097201112684}
m_Layer: 0 m_Layer: 0
m_Name: CloseUp m_Name: CloseUp
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 0 m_IsActive: 1
--- !u!4 &465979870750213643 --- !u!4 &465979870750213643
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -8192,20 +8192,25 @@ MonoBehaviour: ...@@ -8192,20 +8192,25 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
label: Closeup label: Closeup
--- !u!111 &8128078600370031616 --- !u!95 &7707483097201112684
Animation: Animator:
serializedVersion: 7
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4702759297195680461} m_GameObject: {fileID: 4702759297195680461}
m_Enabled: 1 m_Enabled: 1
serializedVersion: 4 m_Avatar: {fileID: 0}
m_Animation: {fileID: 7400000, guid: 7cde87ae2453e0341a21ee3a5cf922bc, type: 2} m_Controller: {fileID: 9100000, guid: cb8b0904521730e479405762e99353cf, type: 2}
m_Animations: m_CullingMode: 0
- {fileID: 7400000, guid: 7cde87ae2453e0341a21ee3a5cf922bc, type: 2} m_UpdateMode: 2
m_WrapMode: 0 m_ApplyRootMotion: 0
m_PlayAutomatically: 1 m_LinearVelocityBlending: 0
m_StabilizeFeet: 0
m_AnimatePhysics: 0 m_AnimatePhysics: 0
m_UpdateMode: 0 m_WarningMessage:
m_CullingType: 0 m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorStateOnDisable: 0
m_WriteDefaultValuesOnDisable: 0
...@@ -50,23 +50,23 @@ namespace MDPro3 ...@@ -50,23 +50,23 @@ namespace MDPro3
} }
} }
internal static float GetFloat(string v, string defaul) public static float GetFloat(string v, float defaul)
{ {
var getted = 0; var getted = 0;
try try
{ {
getted = int.Parse(Get(v, defaul)); getted = int.Parse(Get(v, (defaul * 1000).ToString()));
} }
catch (Exception) catch (Exception)
{ {
} }
return getted / 100000f; return getted / 1000f;
} }
internal static void SetFloat(string v, float f) public static void SetFloat(string v, float f)
{ {
Set(v, ((int)(f * 100000f)).ToString()); Set(v, ((int)(f * 1000f)).ToString());
} }
public static bool Have(string original) public static bool Have(string original)
......
...@@ -66,6 +66,7 @@ namespace MDPro3 ...@@ -66,6 +66,7 @@ namespace MDPro3
public Material myProtector; public Material myProtector;
public Material opProtector; public Material opProtector;
GameObject phaseButton;
GameObject timer; GameObject timer;
ElementObjectManager timerManager; ElementObjectManager timerManager;
TimerHandler timerHandler; TimerHandler timerHandler;
...@@ -147,6 +148,7 @@ namespace MDPro3 ...@@ -147,6 +148,7 @@ namespace MDPro3
{ {
base.OnExit(); base.OnExit();
CloseConnection(); CloseConnection();
exitWithAcc = accing;
OnNor(); OnNor();
} }
...@@ -172,32 +174,48 @@ namespace MDPro3 ...@@ -172,32 +174,48 @@ namespace MDPro3
buttonPlay.SetActive(false); buttonPlay.SetActive(false);
} }
public bool accing;
bool exitWithAcc;
public void OnAcc() public void OnAcc()
{ {
float targetSpeed = 1.5f; accing = true;
float targetSpeed = 2f;
switch (condition)
{
case Condition.Duel:
targetSpeed = Config.GetFloat("DuelAcc", 2f);
break;
case Condition.Watch:
targetSpeed = Config.GetFloat("WatchAcc", 2f);
break;
case Condition.Replay:
targetSpeed = Config.GetFloat("ReplayAcc", 2f);
break;
}
#if UNITY_EDITOR #if UNITY_EDITOR
if(condition == Condition.Replay)
targetSpeed = 2f;
Program.I().timeScaleForEdit = targetSpeed; Program.I().timeScaleForEdit = targetSpeed;
#else #else
if (condition == Condition.Replay)
targetSpeed = 2f;
Program.I().timeScale = targetSpeed; Program.I().timeScale = targetSpeed;
#endif #endif
buttonAcc.SetActive(false); buttonAcc.SetActive(false);
buttonNor.SetActive(true); buttonNor.SetActive(true);
SetBgTimeScale(1f / targetSpeed); SetBgTimeScale(1f / targetSpeed);
} }
public void OnNor() public void OnNor()
{ {
accing = false;
float targetSpeed = 1f;
#if UNITY_EDITOR #if UNITY_EDITOR
Program.I().timeScaleForEdit = 1f; Program.I().timeScaleForEdit = targetSpeed;
#else #else
Program.I().timeScale = 1f; Program.I().timeScale = targetSpeed;
#endif #endif
buttonAcc.SetActive(true); buttonAcc.SetActive(true);
buttonNor.SetActive(false); buttonNor.SetActive(false);
SetBgTimeScale(1f); SetBgTimeScale(targetSpeed);
} }
public void OnTiming() public void OnTiming()
...@@ -1092,7 +1110,6 @@ namespace MDPro3 ...@@ -1092,7 +1110,6 @@ namespace MDPro3
#endregion #endregion
#region 阶段按钮 #region 阶段按钮
GameObject phaseButton;
if (field1.name.StartsWith("Mat_013")) if (field1.name.StartsWith("Mat_013"))
{ {
enumerator = ABLoader.LoadFromFileAsync("MasterDuel/BG/timer/phasebutton_013"); enumerator = ABLoader.LoadFromFileAsync("MasterDuel/BG/timer/phasebutton_013");
...@@ -1306,6 +1323,9 @@ namespace MDPro3 ...@@ -1306,6 +1323,9 @@ namespace MDPro3
messagePass = true; messagePass = true;
yield return null; yield return null;
if (exitWithAcc)
OnAcc();
DOTween.To(v => { }, 0, 0, UnityEngine.Random.Range(8, 16)).OnComplete(() => DOTween.To(v => { }, 0, 0, UnityEngine.Random.Range(8, 16)).OnComplete(() =>
{ {
mate0Random = true; mate0Random = true;
...@@ -7119,15 +7139,11 @@ namespace MDPro3 ...@@ -7119,15 +7139,11 @@ namespace MDPro3
{ {
Tools.SetAnimatorTimescale(field0.transform, timeScale); Tools.SetAnimatorTimescale(field0.transform, timeScale);
Tools.SetAnimatorTimescale(field1.transform, timeScale); Tools.SetAnimatorTimescale(field1.transform, timeScale);
Tools.SetAnimatorTimescale(phaseButton.transform, timeScale);
if (timer != null)
Tools.SetAnimatorTimescale(timer.transform, timeScale);
Tools.SetParticleSystemSimulationSpeed(field0.transform, timeScale); Tools.SetParticleSystemSimulationSpeed(field0.transform, timeScale);
Tools.SetParticleSystemSimulationSpeed(field1.transform, timeScale); Tools.SetParticleSystemSimulationSpeed(field1.transform, timeScale);
if (mate0 != null)
mate0.SetTimeScale(timeScale);
if (mate1 != null)
mate1.SetTimeScale(timeScale);
foreach (var card in cards)
if (card.model != null)
Tools.SetAnimatorTimescale(card.model.transform, timeScale);
} }
public void GraveBgEffect(GPS p, bool cardIn) public void GraveBgEffect(GPS p, bool cardIn)
......
...@@ -238,7 +238,7 @@ namespace MDPro3 ...@@ -238,7 +238,7 @@ namespace MDPro3
|| Gamepad.current != null && Gamepad.current.bButton.wasReleasedThisFrame || Gamepad.current != null && Gamepad.current.bButton.wasReleasedThisFrame
) )
{ {
if (Program.TimePassed() - exitPressedTime < 300) if (Program.TimePassed() - exitPressedTime < 300 * Time.timeScale)
OnReturn(); OnReturn();
} }
......
...@@ -12,6 +12,7 @@ using UnityEngine.AddressableAssets; ...@@ -12,6 +12,7 @@ using UnityEngine.AddressableAssets;
using UnityEngine.Networking; using UnityEngine.Networking;
using UnityEngine.Rendering.Universal; using UnityEngine.Rendering.Universal;
using UnityEngine.UI; using UnityEngine.UI;
using YgomGame.WCS.Portal;
using ShadowResolution = UnityEngine.Rendering.Universal.ShadowResolution; using ShadowResolution = UnityEngine.Rendering.Universal.ShadowResolution;
namespace MDPro3 namespace MDPro3
...@@ -46,8 +47,6 @@ namespace MDPro3 ...@@ -46,8 +47,6 @@ namespace MDPro3
public Text scaleValue; public Text scaleValue;
public Button confirm; public Button confirm;
public Text confirmValue; public Text confirmValue;
public Button autoRPS;
public Text autoRPSValue;
public Slider uiScale; public Slider uiScale;
public Text uiScaleValue; public Text uiScaleValue;
public Button background; public Button background;
...@@ -86,8 +85,12 @@ namespace MDPro3 ...@@ -86,8 +85,12 @@ namespace MDPro3
public Text duelPlayerMessageValue; public Text duelPlayerMessageValue;
public Button duelSystemMessage; public Button duelSystemMessage;
public Text duelSystemMessageValue; public Text duelSystemMessageValue;
public Slider duelAcc;
public Text duelAccValue;
public Button timing; public Button timing;
public Text timingValue; public Text timingValue;
public Button autoRPS;
public Text autoRPSValue;
[Header("Watch")] [Header("Watch")]
public Button watchAppearance; public Button watchAppearance;
...@@ -118,6 +121,8 @@ namespace MDPro3 ...@@ -118,6 +121,8 @@ namespace MDPro3
public Text watchPlayerMessageValue; public Text watchPlayerMessageValue;
public Button watchSystemMessage; public Button watchSystemMessage;
public Text watchSystemMessageValue; public Text watchSystemMessageValue;
public Slider watchAcc;
public Text watchAccValue;
[Header("Replay")] [Header("Replay")]
public Button replayAppearance; public Button replayAppearance;
...@@ -148,6 +153,8 @@ namespace MDPro3 ...@@ -148,6 +153,8 @@ namespace MDPro3
public Text replayPlayerMessageValue; public Text replayPlayerMessageValue;
public Button replaySystemMessage; public Button replaySystemMessage;
public Text replaySystemMessageValue; public Text replaySystemMessageValue;
public Slider replayAcc;
public Text replayAccValue;
[Header("Port")] [Header("Port")]
public Button import; public Button import;
...@@ -232,11 +239,15 @@ namespace MDPro3 ...@@ -232,11 +239,15 @@ namespace MDPro3
duelSystemMessage.onClick.AddListener(OnDuelSystemMessageClick); duelSystemMessage.onClick.AddListener(OnDuelSystemMessageClick);
watchSystemMessage.onClick.AddListener(OnWatchSystemMessageClick); watchSystemMessage.onClick.AddListener(OnWatchSystemMessageClick);
replaySystemMessage.onClick.AddListener(OnReplaySystemMessageClick); replaySystemMessage.onClick.AddListener(OnReplaySystemMessageClick);
duelAcc.onValueChanged.AddListener(OnDuelAccChange);
watchAcc.onValueChanged.AddListener (OnWatchAccChange);
replayAcc.onValueChanged.AddListener(OnReplayAccChange);
duelAutoInfo.onClick.AddListener(OnDuelAutoInfoClick); duelAutoInfo.onClick.AddListener(OnDuelAutoInfoClick);
watchAutoInfo.onClick.AddListener(OnWatchAutoInfoClick); watchAutoInfo.onClick.AddListener(OnWatchAutoInfoClick);
replayAutoInfo.onClick.AddListener(OnReplayAutoInfoClick); replayAutoInfo.onClick.AddListener(OnReplayAutoInfoClick);
timing.onClick.AddListener(OnTimingClick); timing.onClick.AddListener(OnTimingClick);
import.onClick.AddListener(OnImport); import.onClick.AddListener(OnImport);
exportDeck.onClick.AddListener(OnExportDecks); exportDeck.onClick.AddListener(OnExportDecks);
exportReplay.onClick.AddListener(OnExportReplays); exportReplay.onClick.AddListener(OnExportReplays);
exportPicture.onClick.AddListener(OnExportPictures); exportPicture.onClick.AddListener(OnExportPictures);
...@@ -245,34 +256,43 @@ namespace MDPro3 ...@@ -245,34 +256,43 @@ namespace MDPro3
supportExpansions.onClick.AddListener(OnSupportExpansions); supportExpansions.onClick.AddListener(OnSupportExpansions);
updatePrerelease.onClick.AddListener(OnUpdatePrerelease); updatePrerelease.onClick.AddListener(OnUpdatePrerelease);
bgmVol.value = int.Parse(Config.Get("BgmVol", "700")) / (float)1000; bgmVol.value = Config.GetFloat("BgmVol", 0.7f);
OnBgmVolChange(bgmVol.value); OnBgmVolChange(bgmVol.value);
seVol.value = int.Parse(Config.Get("SeVol", "700")) / (float)1000; seVol.value = Config.GetFloat("SeVol", 0.7f);
OnSeVolChange(seVol.value); OnSeVolChange(seVol.value);
voiceVol.value = int.Parse(Config.Get("VoiceVol", "700")) / (float)1000; voiceVol.value = Config.GetFloat("VoiceVol", 0.7f);
OnVoiceVolChange(voiceVol.value); OnVoiceVolChange(voiceVol.value);
fps.value = int.Parse(Config.Get("FPS", "60")); fps.value = Config.GetFloat("FPS", 60);
OnFpsChange(fps.value); OnFpsChange(fps.value);
var defau = "1000"; var defau = 1f;
#if UNITY_ANDROID #if UNITY_ANDROID
defau = "500"; defau = 0.5f;
#endif #endif
scale.value = int.Parse(Config.Get("Scale", defau)) / (float)1000; scale.value = Config.GetFloat("Scale", defau);
OnScaleChange(scale.value); OnScaleChange(scale.value);
defau = "1000";
defau = 1f;
#if UNITY_ANDROID #if UNITY_ANDROID
defau = "1500"; defau = 1.5f;
#endif #endif
uiScale.value = int.Parse(Config.Get("UIScale", defau)) / (float)1000; uiScale.value = Config.GetFloat("UIScale", defau);
quality.value = int.Parse(Config.Get("Quality", "3")); quality.value = Config.GetFloat("Quality", 3f);
OnQualityChange(quality.value); OnQualityChange(quality.value);
faa.value = int.Parse(Config.Get("FAA", "1")); faa.value = Config.GetFloat("FAA", 1);
OnFAAChange(faa.value); OnFAAChange(faa.value);
aaa.value = int.Parse(Config.Get("AAA", "0")); aaa.value = Config.GetFloat("AAA", 0);
OnAAAChange(aaa.value); OnAAAChange(aaa.value);
shadow.value = int.Parse(Config.Get("Shadow", "0")); shadow.value = Config.GetFloat("Shadow", 0);
OnShadowChange(shadow.value); OnShadowChange(shadow.value);
duelAcc.value = Config.GetFloat("DuelAcc", 2f);
OnDuelAccChange(duelAcc.value);
watchAcc.value = Config.GetFloat("WatchAcc", 2f);
OnWatchAccChange(watchAcc.value);
replayAcc.value = Config.GetFloat("ReplayAcc", 2f);
OnReplayAccChange(replayAcc.value);
InitializeShowFPS(); InitializeShowFPS();
InitializeScreenMode(); InitializeScreenMode();
InitializeResolution(); InitializeResolution();
...@@ -314,16 +334,16 @@ namespace MDPro3 ...@@ -314,16 +334,16 @@ namespace MDPro3
#region setting #region setting
public void Save() public void Save()
{ {
Config.Set("BgmVol", ((int)(bgmVol.value * 1000)).ToString()); Config.SetFloat("BgmVol", bgmVol.value);
Config.Set("SeVol", ((int)(seVol.value * 1000)).ToString()); Config.SetFloat("SeVol", seVol.value);
Config.Set("VoiceVol", ((int)(voiceVol.value * 1000)).ToString()); Config.SetFloat("VoiceVol", voiceVol.value);
Config.Set("FPS", fpsValue.text); Config.SetFloat("FPS", fps.value);
Config.Set("Scale", ((int)(scale.value * 1000)).ToString()); Config.SetFloat("Scale", scale.value);
Config.Set("UIScale", ((int)(uiScale.value * 1000)).ToString()); Config.SetFloat("UIScale", uiScale.value);
Config.Set("Quality", quality.value.ToString()); Config.SetFloat("Quality", quality.value);
Config.Set("FAA", faa.value.ToString()); Config.SetFloat("FAA", faa.value);
Config.Set("AAA", aaa.value.ToString()); Config.SetFloat("AAA", aaa.value);
Config.Set("Shadow", shadow.value.ToString()); Config.SetFloat("Shadow", shadow.value);
Config.Set("ShowFPS", SaveBool(showFPSValue.text)); Config.Set("ShowFPS", SaveBool(showFPSValue.text));
Config.Set("ScreenMode", SaveScreenMode(screenValue.text)); Config.Set("ScreenMode", SaveScreenMode(screenValue.text));
Config.Set("Resolution", resolutionValue.text); Config.Set("Resolution", resolutionValue.text);
...@@ -364,6 +384,9 @@ namespace MDPro3 ...@@ -364,6 +384,9 @@ namespace MDPro3
Config.Set("DuelSystemMessage", SaveBool(duelSystemMessageValue.text)); Config.Set("DuelSystemMessage", SaveBool(duelSystemMessageValue.text));
Config.Set("WatchSystemMessage", SaveBool(watchSystemMessageValue.text)); Config.Set("WatchSystemMessage", SaveBool(watchSystemMessageValue.text));
Config.Set("ReplaySystemMessage", SaveBool(replaySystemMessageValue.text)); Config.Set("ReplaySystemMessage", SaveBool(replaySystemMessageValue.text));
Config.SetFloat("DuelAcc", duelAcc.value);
Config.SetFloat("WatchAcc", watchAcc.value);
Config.SetFloat("ReplayAcc", replayAcc.value);
Config.Set("Timing", SaveBool(timingValue.text)); Config.Set("Timing", SaveBool(timingValue.text));
Config.Set("Expansions", SaveBool(supportExpansionsValue.text)); Config.Set("Expansions", SaveBool(supportExpansionsValue.text));
...@@ -1389,6 +1412,44 @@ namespace MDPro3 ...@@ -1389,6 +1412,44 @@ namespace MDPro3
replaySystemMessageValue.text = InterString.Get("开"); replaySystemMessageValue.text = InterString.Get("开");
} }
public static float duelAccSpeed = 2f;
public static float watchAccSpeed = 2f;
public static float replayAccSpeed = 2f;
public void OnDuelAccChange(float value)
{
string result = value.ToString();
duelAccValue.text = result.Length > 4 ? result.Substring(0, 4) : result;
Config.SetFloat("DuelAcc", value);
if (Program.I().ocgcore.isShowed)
if (Program.I().ocgcore.condition == OcgCore.Condition.Duel)
if (Program.I().ocgcore.accing)
Program.I().ocgcore.OnAcc();
}
public void OnWatchAccChange(float value)
{
string result = value.ToString();
watchAccValue.text = result.Length > 4 ? result.Substring(0, 4) : result;
Config.SetFloat("WatchAcc", value);
if (Program.I().ocgcore.isShowed)
if (Program.I().ocgcore.condition == OcgCore.Condition.Watch)
if (Program.I().ocgcore.accing)
Program.I().ocgcore.OnAcc();
}
public void OnReplayAccChange(float value)
{
string result = value.ToString();
replayAccValue.text = result.Length > 4 ? result.Substring(0, 4) : result;
Config.SetFloat("ReplayAcc", value);
if (Program.I().ocgcore.isShowed)
if (Program.I().ocgcore.condition == OcgCore.Condition.Replay)
if (Program.I().ocgcore.accing)
Program.I().ocgcore.OnAcc();
}
public void OnTimingClick() public void OnTimingClick()
{ {
if (timingValue.text == InterString.Get("开")) if (timingValue.text == InterString.Get("开"))
......
...@@ -90,42 +90,6 @@ namespace MDPro3 ...@@ -90,42 +90,6 @@ namespace MDPro3
director.timeUpdateMode = DirectorUpdateMode.UnscaledGameTime; director.timeUpdateMode = DirectorUpdateMode.UnscaledGameTime;
} }
public static bool InAnimation(GameObject target, string animationName)
{
bool returnValue = false;
foreach (var p in target.GetComponentsInChildren<Animator>(true))
{
if (p.GetCurrentAnimatorClipInfo(0)[0].clip.name.ToLower().Contains(animationName))
return true;
}
return returnValue;
}
public static bool BytesContainsBytes(byte[] bytes, byte[] search)
{
for (int i = 0; i < bytes.Length - search.Length; i++)
{
bool match = true;
for (int j = 0; j < search.Length; j++)
{
if (bytes[i + j] == search[j])
{
}
else
{
match = false;
break;
}
}
if (match)
return true;
}
return false;
}
public static int CompareTime(object x, object y) public static int CompareTime(object x, object y)
{ {
if (x == null && y == null) return 0; if (x == null && y == null) return 0;
...@@ -185,19 +149,6 @@ namespace MDPro3 ...@@ -185,19 +149,6 @@ namespace MDPro3
return result.ToArray(); return result.ToArray();
} }
public static void TryOpenInFileExplorer(string path)
{
try
{
string argument = $"/select, \"{path}\"";
Process.Start(new ProcessStartInfo("explorer.exe", argument));
}
catch (Exception ex)
{
MessageManager.Cast($"Failed to open file explorer: {ex.Message}");
}
}
public static KeyValuePair<TKey, TValue> GetNthElement<TKey, TValue>(Dictionary<TKey, TValue> dic, int n) public static KeyValuePair<TKey, TValue> GetNthElement<TKey, TValue>(Dictionary<TKey, TValue> dic, int n)
{ {
if (n < 0) if (n < 0)
......
...@@ -555,3 +555,4 @@ Shop->Shop ...@@ -555,3 +555,4 @@ Shop->Shop
正在读取数据->正在读取数据 正在读取数据->正在读取数据
ClassicRed->ClassicRed ClassicRed->ClassicRed
队友发起了投降。->队友发起了投降。 队友发起了投降。->队友发起了投降。
加速倍率->加速倍率
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment