mirror of
https://github.com/0x7c13/Pal3.Unity.git
synced 2026-11-27 18:08:09 +08:00
Code refactoring + bug fixes
This commit is contained in:
1 parent
be5aebde3b
commit
263d9fcd8c
19 files changed
+257
-4664
No files matched your search
@@ -4,7 +4,7 @@ TrueTypeFontImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 4
|
||||
fontSize: 16
|
||||
forceTextureCase: -2
|
||||
forceTextureCase: 3
|
||||
characterSpacing: 0
|
||||
characterPadding: 1
|
||||
includeFontData: 1
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 129c820b154da074e821d870a3627120
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -1,21 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dcba7b37316258447a7e7b8a9faefba8
|
||||
TrueTypeFontImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 4
|
||||
fontSize: 16
|
||||
forceTextureCase: -2
|
||||
characterSpacing: 0
|
||||
characterPadding: 1
|
||||
includeFontData: 1
|
||||
fontNames:
|
||||
- Slidexiaxing
|
||||
fallbackFontReferences: []
|
||||
customCharacters:
|
||||
fontRenderingMode: 0
|
||||
ascentCalculationMode: 1
|
||||
useLegacyBoundsCalculation: 0
|
||||
shouldRoundAdvanceValue: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -18,9 +18,12 @@ namespace Core.DataLoader
|
||||
/// <param name="filePath">Audio file path</param>
|
||||
/// <param name="audioType">Audio type</param>
|
||||
/// <param name="streamAudio">Create streaming AudioClip</param>
|
||||
/// <param name="callback">AudioClip callback invoker</param>
|
||||
/// <param name="onLoaded">AudioClip callback invoker when loaded</param>
|
||||
/// <returns>IEnumerator</returns>
|
||||
public static IEnumerator LoadAudioClipAsync(string filePath, AudioType audioType, bool streamAudio, Action<AudioClip> callback)
|
||||
public static IEnumerator LoadAudioClipAsync(string filePath,
|
||||
AudioType audioType,
|
||||
bool streamAudio,
|
||||
Action<AudioClip> onLoaded)
|
||||
{
|
||||
if (filePath.StartsWith("/")) filePath = filePath[1..];
|
||||
|
||||
@@ -42,7 +45,7 @@ namespace Core.DataLoader
|
||||
((DownloadHandlerAudioClip) request.downloadHandler).streamAudio = streamAudio;
|
||||
|
||||
AudioClip audioClip = DownloadHandlerAudioClip.GetContent(request);
|
||||
callback?.Invoke(audioClip);
|
||||
onLoaded?.Invoke(audioClip);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
@@ -180,14 +180,14 @@ namespace Pal3.Actor
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator AnimateScaleAsync(float toScale, float duration, WaitUntilCanceled waiter = null)
|
||||
private IEnumerator AnimateScaleAsync(float toScale, float duration, Action onFinished = null)
|
||||
{
|
||||
yield return AnimationHelper.EnumerateValueAsync(transform.localScale.x,
|
||||
toScale, duration, AnimationCurveType.Linear, value =>
|
||||
{
|
||||
transform.localScale = new Vector3(value, value, value);
|
||||
});
|
||||
waiter?.CancelWait();
|
||||
onFinished?.Invoke();
|
||||
}
|
||||
|
||||
public void Execute(ActorSetFacingCommand command)
|
||||
@@ -259,9 +259,8 @@ namespace Pal3.Actor
|
||||
{
|
||||
if (command.ActorId != _actor.Info.Id) return;
|
||||
var waiter = new WaitUntilCanceled();
|
||||
CommandDispatcher<ICommand>.Instance.Dispatch(
|
||||
new ScriptRunnerAddWaiterRequest(waiter));
|
||||
StartCoroutine(AnimateScaleAsync(command.Scale, 2f, waiter));
|
||||
CommandDispatcher<ICommand>.Instance.Dispatch(new ScriptRunnerAddWaiterRequest(waiter));
|
||||
StartCoroutine(AnimateScaleAsync(command.Scale, 2f, () => waiter.CancelWait()));
|
||||
}
|
||||
|
||||
public void Execute(ActorSetYPositionCommand command)
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
|
||||
namespace Pal3.Actor
|
||||
{
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Command;
|
||||
using Command.InternalCommands;
|
||||
using Command.SceCommands;
|
||||
using Core.GameBox;
|
||||
using GamePlay;
|
||||
using Script.Waiter;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -75,10 +75,10 @@ namespace Pal3.Actor
|
||||
? _actor.GetMovementAction(MovementMode.Walk)
|
||||
: _actor.GetMovementAction(MovementMode.Run));
|
||||
|
||||
StartCoroutine(FlyAsync(targetPosition, duration, waiter));
|
||||
StartCoroutine(FlyToAsync(targetPosition, duration, () => waiter.CancelWait()));
|
||||
}
|
||||
|
||||
private IEnumerator FlyAsync(Vector3 targetPosition, float duration, WaitUntilCanceled waiter = null)
|
||||
private IEnumerator FlyToAsync(Vector3 targetPosition, float duration, Action onFinished = null)
|
||||
{
|
||||
Vector3 oldPosition = transform.position;
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace Pal3.Actor
|
||||
|
||||
transform.position = targetPosition;
|
||||
_actionController.PerformAction(_actor.GetIdleAction());
|
||||
waiter?.CancelWait();
|
||||
onFinished?.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -264,43 +264,51 @@ namespace Pal3.Camera
|
||||
return Mathf.Rad2Deg * 2 * Mathf.Atan(Mathf.Tan((horizontalFov * Mathf.Deg2Rad) / 2f) / aspect);
|
||||
}
|
||||
|
||||
private IEnumerator ShakeAsync(float duration, float amplitude, WaitUntilCanceled waiter = null)
|
||||
private IEnumerator ShakeAsync(float duration, float amplitude, Action onFinished = null)
|
||||
{
|
||||
_cameraAnimationInProgress = true;
|
||||
|
||||
yield return AnimationHelper.ShakeTransformAsync(_camera.transform,
|
||||
duration,
|
||||
amplitude,
|
||||
false,
|
||||
true,
|
||||
false);
|
||||
|
||||
_cameraAnimationInProgress = false;
|
||||
waiter?.CancelWait();
|
||||
onFinished?.Invoke();
|
||||
}
|
||||
|
||||
private IEnumerator MoveAsync(Vector3 position,
|
||||
float duration,
|
||||
AnimationCurveType curveType,
|
||||
WaitUntilCanceled waiter = null,
|
||||
Action onFinished = null,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
_cameraAnimationInProgress = true;
|
||||
Transform cameraTransform = _camera.transform;
|
||||
Vector3 oldPosition = cameraTransform.position;
|
||||
yield return AnimationHelper.MoveTransformAsync(cameraTransform, position, duration, curveType, cancellationToken);
|
||||
|
||||
yield return AnimationHelper.MoveTransformAsync(cameraTransform,
|
||||
position,
|
||||
duration,
|
||||
curveType,
|
||||
cancellationToken);
|
||||
|
||||
if (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
_lastLookAtPoint += position - oldPosition;
|
||||
_cameraOffset = _camera.transform.position - _lastLookAtPoint;
|
||||
}
|
||||
_cameraAnimationInProgress = false;
|
||||
waiter?.CancelWait();
|
||||
onFinished?.Invoke();
|
||||
}
|
||||
|
||||
private IEnumerator OrbitAsync(Quaternion toRotation,
|
||||
float duration,
|
||||
AnimationCurveType curveType,
|
||||
float distanceDelta,
|
||||
WaitUntilCanceled waiter = null,
|
||||
Action onFinished = null,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
_cameraAnimationInProgress = true;
|
||||
@@ -318,13 +326,13 @@ namespace Pal3.Camera
|
||||
_cameraOffset = _camera.transform.position - lookAtPoint;
|
||||
}
|
||||
_cameraAnimationInProgress = false;
|
||||
waiter?.CancelWait();
|
||||
onFinished?.Invoke();
|
||||
}
|
||||
|
||||
private IEnumerator RotateAsync(Quaternion toRotation,
|
||||
float duration,
|
||||
AnimationCurveType curveType,
|
||||
WaitUntilCanceled waiter = null,
|
||||
Action onFinished = null,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
_cameraAnimationInProgress = true;
|
||||
@@ -334,13 +342,13 @@ namespace Pal3.Camera
|
||||
curveType,
|
||||
cancellationToken);
|
||||
_cameraAnimationInProgress = false;
|
||||
waiter?.CancelWait();
|
||||
onFinished?.Invoke();
|
||||
}
|
||||
|
||||
public IEnumerator PushAsync(float distance,
|
||||
float duration,
|
||||
AnimationCurveType curveType,
|
||||
WaitUntilCanceled waiter = null,
|
||||
Action onFinished = null,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
_cameraAnimationInProgress = true;
|
||||
@@ -361,13 +369,13 @@ namespace Pal3.Camera
|
||||
_cameraOffset = cameraTransform.position - _lastLookAtPoint;
|
||||
}
|
||||
_cameraAnimationInProgress = false;
|
||||
waiter?.CancelWait();
|
||||
onFinished?.Invoke();
|
||||
}
|
||||
|
||||
public IEnumerator FadeAsync(bool fadeIn,
|
||||
float duration,
|
||||
Color color,
|
||||
WaitUntilCanceled waiter = null,
|
||||
Action onFinished = null,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
_curtainImage.color = color;
|
||||
@@ -386,7 +394,7 @@ namespace Pal3.Camera
|
||||
_curtainImage.color = new Color(color.r, color.g, color.b, to);
|
||||
}
|
||||
|
||||
waiter?.CancelWait();
|
||||
onFinished?.Invoke();
|
||||
}
|
||||
|
||||
public int GetCurrentAppliedDefaultTransformOption()
|
||||
@@ -536,7 +544,9 @@ namespace Pal3.Camera
|
||||
|
||||
var waiter = new WaitUntilCanceled();
|
||||
CommandDispatcher<ICommand>.Instance.Dispatch(new ScriptRunnerAddWaiterRequest(waiter));
|
||||
StartCoroutine(ShakeAsync(command.Duration, GameBoxInterpreter.ToUnityDistance(command.Amplitude), waiter));
|
||||
StartCoroutine(ShakeAsync(command.Duration,
|
||||
GameBoxInterpreter.ToUnityDistance(command.Amplitude),
|
||||
() => waiter.CancelWait()));
|
||||
}
|
||||
|
||||
public void Execute(CameraOrbitCommand command)
|
||||
@@ -546,7 +556,11 @@ namespace Pal3.Camera
|
||||
var waiter = new WaitUntilCanceled();
|
||||
CommandDispatcher<ICommand>.Instance.Dispatch(new ScriptRunnerAddWaiterRequest(waiter));
|
||||
Quaternion rotation = GameBoxInterpreter.ToUnityRotation(command.Pitch, command.Yaw, 0f);
|
||||
StartCoroutine(OrbitAsync(rotation, command.Duration, (AnimationCurveType)command.CurveType, 0f, waiter));
|
||||
StartCoroutine(OrbitAsync(rotation,
|
||||
command.Duration,
|
||||
(AnimationCurveType)command.CurveType,
|
||||
0f,
|
||||
() => waiter.CancelWait()));
|
||||
}
|
||||
|
||||
public void Execute(CameraRotateCommand command)
|
||||
@@ -562,7 +576,10 @@ namespace Pal3.Camera
|
||||
var waiter = new WaitUntilCanceled();
|
||||
CommandDispatcher<ICommand>.Instance.Dispatch(new ScriptRunnerAddWaiterRequest(waiter));
|
||||
Quaternion rotation = GameBoxInterpreter.ToUnityRotation(command.Pitch, command.Yaw, 0f);
|
||||
StartCoroutine(RotateAsync(rotation, command.Duration, (AnimationCurveType)command.CurveType, waiter));
|
||||
StartCoroutine(RotateAsync(rotation,
|
||||
command.Duration,
|
||||
(AnimationCurveType)command.CurveType,
|
||||
() => waiter.CancelWait()));
|
||||
}
|
||||
#if PAL3A
|
||||
else
|
||||
@@ -572,7 +589,7 @@ namespace Pal3.Camera
|
||||
StartCoroutine(RotateAsync(rotation,
|
||||
command.Duration,
|
||||
(AnimationCurveType)command.CurveType,
|
||||
waiter: null,
|
||||
onFinished: null,
|
||||
_asyncCameraAnimationCts.Token));
|
||||
}
|
||||
#endif
|
||||
@@ -584,7 +601,11 @@ namespace Pal3.Camera
|
||||
_cameraFadeAnimationCts = new CancellationTokenSource();
|
||||
var waiter = new WaitUntilCanceled();
|
||||
CommandDispatcher<ICommand>.Instance.Dispatch(new ScriptRunnerAddWaiterRequest(waiter));
|
||||
StartCoroutine(FadeAsync(true, FADE_ANIMATION_DURATION, Color.black, waiter, _cameraFadeAnimationCts.Token));
|
||||
StartCoroutine(FadeAsync(true,
|
||||
FADE_ANIMATION_DURATION,
|
||||
Color.black,
|
||||
() => waiter.CancelWait(),
|
||||
_cameraFadeAnimationCts.Token));
|
||||
}
|
||||
|
||||
public void Execute(CameraFadeInWhiteCommand command)
|
||||
@@ -593,7 +614,11 @@ namespace Pal3.Camera
|
||||
_cameraFadeAnimationCts = new CancellationTokenSource();
|
||||
var waiter = new WaitUntilCanceled();
|
||||
CommandDispatcher<ICommand>.Instance.Dispatch(new ScriptRunnerAddWaiterRequest(waiter));
|
||||
StartCoroutine(FadeAsync(true, FADE_ANIMATION_DURATION, Color.white, waiter, _cameraFadeAnimationCts.Token));
|
||||
StartCoroutine(FadeAsync(true,
|
||||
FADE_ANIMATION_DURATION,
|
||||
Color.white,
|
||||
() => waiter.CancelWait(),
|
||||
_cameraFadeAnimationCts.Token));
|
||||
}
|
||||
|
||||
public void Execute(CameraFadeOutCommand command)
|
||||
@@ -602,7 +627,11 @@ namespace Pal3.Camera
|
||||
_cameraFadeAnimationCts = new CancellationTokenSource();
|
||||
var waiter = new WaitUntilCanceled();
|
||||
CommandDispatcher<ICommand>.Instance.Dispatch(new ScriptRunnerAddWaiterRequest(waiter));
|
||||
StartCoroutine(FadeAsync(false, FADE_ANIMATION_DURATION, Color.black, waiter, _cameraFadeAnimationCts.Token));
|
||||
StartCoroutine(FadeAsync(false,
|
||||
FADE_ANIMATION_DURATION,
|
||||
Color.black,
|
||||
() => waiter.CancelWait(),
|
||||
_cameraFadeAnimationCts.Token));
|
||||
}
|
||||
|
||||
public void Execute(CameraFadeOutWhiteCommand command)
|
||||
@@ -611,7 +640,11 @@ namespace Pal3.Camera
|
||||
_cameraFadeAnimationCts = new CancellationTokenSource();
|
||||
var waiter = new WaitUntilCanceled();
|
||||
CommandDispatcher<ICommand>.Instance.Dispatch(new ScriptRunnerAddWaiterRequest(waiter));
|
||||
StartCoroutine(FadeAsync(false, FADE_ANIMATION_DURATION, Color.white, waiter, _cameraFadeAnimationCts.Token));
|
||||
StartCoroutine(FadeAsync(false,
|
||||
FADE_ANIMATION_DURATION,
|
||||
Color.white,
|
||||
() => waiter.CancelWait(),
|
||||
_cameraFadeAnimationCts.Token));
|
||||
}
|
||||
|
||||
public void Execute(CameraPushCommand command)
|
||||
@@ -627,7 +660,10 @@ namespace Pal3.Camera
|
||||
var waiter = new WaitUntilCanceled();
|
||||
CommandDispatcher<ICommand>.Instance.Dispatch(new ScriptRunnerAddWaiterRequest(waiter));
|
||||
var distance = GameBoxInterpreter.ToUnityDistance(command.GameBoxDistance);
|
||||
StartCoroutine(PushAsync(distance, command.Duration, (AnimationCurveType)command.CurveType, waiter));
|
||||
StartCoroutine(PushAsync(distance,
|
||||
command.Duration,
|
||||
(AnimationCurveType)command.CurveType,
|
||||
() => waiter.CancelWait()));
|
||||
}
|
||||
#if PAL3A
|
||||
else
|
||||
@@ -637,7 +673,7 @@ namespace Pal3.Camera
|
||||
StartCoroutine(PushAsync(distance,
|
||||
command.Duration,
|
||||
(AnimationCurveType)command.CurveType,
|
||||
waiter: null,
|
||||
onFinished: null,
|
||||
_asyncCameraAnimationCts.Token));
|
||||
}
|
||||
#endif
|
||||
@@ -659,7 +695,10 @@ namespace Pal3.Camera
|
||||
command.GameBoxXPosition,
|
||||
command.GameBoxYPosition,
|
||||
command.GameBoxZPosition));
|
||||
StartCoroutine(MoveAsync(position, command.Duration, (AnimationCurveType)command.CurveType, waiter));
|
||||
StartCoroutine(MoveAsync(position,
|
||||
command.Duration,
|
||||
(AnimationCurveType)command.CurveType,
|
||||
() => waiter.CancelWait()));
|
||||
}
|
||||
#if PAL3A
|
||||
else
|
||||
@@ -672,7 +711,7 @@ namespace Pal3.Camera
|
||||
StartCoroutine(MoveAsync(position,
|
||||
command.Duration,
|
||||
(AnimationCurveType)command.CurveType,
|
||||
waiter: null,
|
||||
onFinished: null,
|
||||
_asyncCameraAnimationCts.Token));
|
||||
}
|
||||
#endif
|
||||
@@ -784,7 +823,11 @@ namespace Pal3.Camera
|
||||
var waiter = new WaitUntilCanceled();
|
||||
CommandDispatcher<ICommand>.Instance.Dispatch(new ScriptRunnerAddWaiterRequest(waiter));
|
||||
Quaternion rotation = GameBoxInterpreter.ToUnityRotation(command.Pitch, command.Yaw, 0f);
|
||||
StartCoroutine(OrbitAsync(rotation, command.Duration, (AnimationCurveType)command.CurveType, distanceDelta, waiter));
|
||||
StartCoroutine(OrbitAsync(rotation,
|
||||
command.Duration,
|
||||
(AnimationCurveType)command.CurveType,
|
||||
distanceDelta,
|
||||
() => waiter.CancelWait()));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -794,7 +837,7 @@ namespace Pal3.Camera
|
||||
command.Duration,
|
||||
(AnimationCurveType)command.CurveType,
|
||||
distanceDelta,
|
||||
waiter: null,
|
||||
onFinished: null,
|
||||
_asyncCameraAnimationCts.Token));
|
||||
}
|
||||
}
|
||||
@@ -812,7 +855,11 @@ namespace Pal3.Camera
|
||||
var waiter = new WaitUntilCanceled();
|
||||
CommandDispatcher<ICommand>.Instance.Dispatch(new ScriptRunnerAddWaiterRequest(waiter));
|
||||
Quaternion rotation = GameBoxInterpreter.ToUnityRotation(command.Pitch, command.Yaw, 0f);
|
||||
StartCoroutine(OrbitAsync(rotation, command.Duration, (AnimationCurveType)command.CurveType, distanceDelta, waiter));
|
||||
StartCoroutine(OrbitAsync(rotation,
|
||||
command.Duration,
|
||||
(AnimationCurveType)command.CurveType,
|
||||
distanceDelta,
|
||||
() => waiter.CancelWait()));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -822,7 +869,7 @@ namespace Pal3.Camera
|
||||
command.Duration,
|
||||
(AnimationCurveType)command.CurveType,
|
||||
distanceDelta,
|
||||
waiter: null,
|
||||
onFinished: null,
|
||||
_asyncCameraAnimationCts.Token));
|
||||
}
|
||||
}
|
||||
@@ -843,7 +890,10 @@ namespace Pal3.Camera
|
||||
command.GameBoxXPosition,
|
||||
command.GameBoxYPosition,
|
||||
command.GameBoxZPosition));
|
||||
StartCoroutine(MoveAsync(position, duration, AnimationCurveType.Sine, waiter));
|
||||
StartCoroutine(MoveAsync(position,
|
||||
duration,
|
||||
AnimationCurveType.Sine,
|
||||
() => waiter.CancelWait()));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -855,7 +905,7 @@ namespace Pal3.Camera
|
||||
StartCoroutine(MoveAsync(position,
|
||||
duration,
|
||||
AnimationCurveType.Sine,
|
||||
waiter: null,
|
||||
onFinished: null,
|
||||
_asyncCameraAnimationCts.Token));
|
||||
}
|
||||
}
|
||||
@@ -870,7 +920,10 @@ namespace Pal3.Camera
|
||||
if (_gamePlayController.TryGetPlayerActorLastKnownPosition(out Vector3 playerActorPosition))
|
||||
{
|
||||
Vector3 position = _cameraOffset + playerActorPosition;
|
||||
StartCoroutine(MoveAsync(position, command.Duration, AnimationCurveType.Sine, waiter));
|
||||
StartCoroutine(MoveAsync(position,
|
||||
command.Duration,
|
||||
AnimationCurveType.Sine,
|
||||
() => waiter.CancelWait()));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -313,7 +313,10 @@ namespace Pal3.Data
|
||||
return sfxFilePath;
|
||||
}
|
||||
|
||||
public IEnumerator LoadAudioClipAsync(string filePath, AudioType audioType, bool streamAudio, Action<AudioClip> callback)
|
||||
public IEnumerator LoadAudioClipAsync(string filePath,
|
||||
AudioType audioType,
|
||||
bool streamAudio,
|
||||
Action<AudioClip> onLoaded)
|
||||
{
|
||||
var fileName = Path.GetFileName(filePath);
|
||||
var shouldCache = _audioClipCacheList.Contains(fileName);
|
||||
@@ -322,19 +325,22 @@ namespace Pal3.Data
|
||||
{
|
||||
if (_audioClipCache[fileName] != null) // check if clip has been destroyed
|
||||
{
|
||||
callback?.Invoke(_audioClipCache[fileName]);
|
||||
onLoaded?.Invoke(_audioClipCache[fileName]);
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
yield return AudioClipLoader.LoadAudioClipAsync(filePath, audioType, streamAudio, audioClip =>
|
||||
yield return AudioClipLoader.LoadAudioClipAsync(filePath,
|
||||
audioType,
|
||||
streamAudio,
|
||||
audioClip =>
|
||||
{
|
||||
if (shouldCache && audioClip != null)
|
||||
{
|
||||
_audioClipCache[fileName] = audioClip;
|
||||
}
|
||||
|
||||
callback?.Invoke(audioClip);
|
||||
onLoaded?.Invoke(audioClip);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -577,19 +583,17 @@ namespace Pal3.Data
|
||||
}
|
||||
|
||||
Object vfxPrefab = Resources.Load(GetVfxPrefabPath(effectGroupId));
|
||||
if (vfxPrefab != null)
|
||||
{
|
||||
_vfxEffectPrefabCache[effectGroupId] = vfxPrefab;
|
||||
return vfxPrefab;
|
||||
}
|
||||
else
|
||||
|
||||
if (vfxPrefab == null)
|
||||
{
|
||||
Debug.LogWarning("VFX prefab not found: " + effectGroupId);
|
||||
return null;
|
||||
}
|
||||
|
||||
_vfxEffectPrefabCache[effectGroupId] = vfxPrefab;
|
||||
return vfxPrefab;
|
||||
}
|
||||
|
||||
public IEnumerator PreLoadVfxEffectAsync(int effectGroupId)
|
||||
public IEnumerator PreLoadVfxEffectAsync(int effectGroupId, Action onFinished = null)
|
||||
{
|
||||
if (_vfxEffectPrefabCache.ContainsKey(effectGroupId))
|
||||
{
|
||||
@@ -603,11 +607,17 @@ namespace Pal3.Data
|
||||
yield return request;
|
||||
}
|
||||
|
||||
if (request.asset != null)
|
||||
if (request.asset == null)
|
||||
{
|
||||
Debug.LogWarning("VFX prefab not found: " + effectGroupId);
|
||||
}
|
||||
else
|
||||
{
|
||||
_vfxEffectPrefabCache[effectGroupId] = request.asset;
|
||||
Debug.Log("VFX prefab preloaded: " + effectGroupId);
|
||||
}
|
||||
|
||||
_vfxEffectPrefabCache[effectGroupId] = request.asset;
|
||||
onFinished?.Invoke();
|
||||
}
|
||||
|
||||
public Texture2D GetCursorTexture()
|
||||
|
||||
@@ -13,16 +13,6 @@ namespace Pal3.Dev
|
||||
public static readonly Dictionary<string, string> StoryJumpPoints = new()
|
||||
{
|
||||
#if PAL3
|
||||
{"永安当\n\n去客房找赵文昌", @"
|
||||
ScriptVarSetValue -32768 10202
|
||||
SceneLoad q01 y
|
||||
ActorActivate -1 1
|
||||
ActorEnablePlayerControl -1
|
||||
PlayerEnableInput 1
|
||||
ActorSetNavLayer -1 0
|
||||
ActorSetTilePosition -1 77 175
|
||||
TeamAddOrRemoveActor 0 1
|
||||
CameraFadeIn"},
|
||||
{"渝州\n\n去唐家堡找雪见", @"
|
||||
ScriptVarSetValue -32768 10401
|
||||
SceneLoad q01 b
|
||||
@@ -728,6 +718,10 @@ namespace Pal3.Dev
|
||||
CameraFadeIn"},
|
||||
{"蜀山\n\n绿萝嶂", @"
|
||||
ScriptVarSetValue -32768 30101
|
||||
SceneSaveGlobalObjectSwitchState m02 1 35 1
|
||||
SceneSaveGlobalObjectTimesCount m02 1 35 0
|
||||
SceneSaveGlobalObjectActivationState m02 1 36 False
|
||||
SceneSaveGlobalObjectSwitchState m02 1 36 1
|
||||
SceneLoad Q02 HH
|
||||
ActorActivate -1 1
|
||||
ActorEnablePlayerControl -1
|
||||
@@ -736,13 +730,13 @@ namespace Pal3.Dev
|
||||
ActorSetTilePosition -1 342 137
|
||||
TeamAddOrRemoveActor 0 1
|
||||
TeamAddOrRemoveActor 1 1
|
||||
CameraFadeIn"},
|
||||
{"地脉门户\n\n少阳三焦", @"
|
||||
ScriptVarSetValue -32768 40200
|
||||
SceneSaveGlobalObjectSwitchState m02 1 35 1
|
||||
SceneSaveGlobalObjectTimesCount m02 1 35 0
|
||||
SceneSaveGlobalObjectActivationState m02 1 36 False
|
||||
SceneSaveGlobalObjectSwitchState m02 1 36 1
|
||||
CameraFadeIn"},
|
||||
{"地脉门户\n\n少阳三焦", @"
|
||||
ScriptVarSetValue -32768 40200
|
||||
SceneLoad m02 2
|
||||
ActorActivate -1 1
|
||||
ActorEnablePlayerControl -1
|
||||
@@ -756,13 +750,13 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 2 2
|
||||
BigMapEnableRegion 4 2
|
||||
BigMapEnableRegion 5 2
|
||||
CameraFadeIn"},
|
||||
{"第一次进入里蜀山", @"
|
||||
ScriptVarSetValue -32768 41100
|
||||
SceneSaveGlobalObjectSwitchState m02 1 35 1
|
||||
SceneSaveGlobalObjectTimesCount m02 1 35 0
|
||||
SceneSaveGlobalObjectActivationState m02 1 36 False
|
||||
SceneSaveGlobalObjectSwitchState m02 1 36 1
|
||||
CameraFadeIn"},
|
||||
{"第一次进入里蜀山", @"
|
||||
ScriptVarSetValue -32768 41100
|
||||
SceneLoad q04 wb
|
||||
ActorActivate -1 1
|
||||
ActorEnablePlayerControl -1
|
||||
@@ -778,13 +772,13 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 4 2
|
||||
BigMapEnableRegion 5 2
|
||||
BigMapEnableRegion 6 1
|
||||
CameraFadeIn"},
|
||||
{"里蜀山外城南\n\n厥阴心包", @"
|
||||
ScriptVarSetValue -32768 50200
|
||||
SceneSaveGlobalObjectSwitchState m02 1 35 1
|
||||
SceneSaveGlobalObjectTimesCount m02 1 35 0
|
||||
SceneSaveGlobalObjectActivationState m02 1 36 False
|
||||
SceneSaveGlobalObjectSwitchState m02 1 36 1
|
||||
CameraFadeIn"},
|
||||
{"里蜀山外城南\n\n厥阴心包", @"
|
||||
ScriptVarSetValue -32768 50200
|
||||
SceneLoad q04 wn
|
||||
ActorActivate -1 1
|
||||
ActorEnablePlayerControl -1
|
||||
@@ -800,13 +794,13 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 4 2
|
||||
BigMapEnableRegion 5 2
|
||||
BigMapEnableRegion 6 1
|
||||
CameraFadeIn"},
|
||||
{"厥阴心包\n\n胜州", @"
|
||||
ScriptVarSetValue -32768 50500
|
||||
SceneSaveGlobalObjectSwitchState m02 1 35 1
|
||||
SceneSaveGlobalObjectTimesCount m02 1 35 0
|
||||
SceneSaveGlobalObjectActivationState m02 1 36 False
|
||||
SceneSaveGlobalObjectSwitchState m02 1 36 1
|
||||
CameraFadeIn"},
|
||||
{"厥阴心包\n\n胜州", @"
|
||||
ScriptVarSetValue -32768 50500
|
||||
SceneLoad M05 4
|
||||
ActorActivate -1 1
|
||||
ActorEnablePlayerControl -1
|
||||
@@ -822,13 +816,13 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 4 2
|
||||
BigMapEnableRegion 5 2
|
||||
BigMapEnableRegion 6 1
|
||||
CameraFadeIn"},
|
||||
{"蜀山\n\n深夜去经库", @"
|
||||
ScriptVarSetValue -32768 60500
|
||||
SceneSaveGlobalObjectSwitchState m02 1 35 1
|
||||
SceneSaveGlobalObjectTimesCount m02 1 35 0
|
||||
SceneSaveGlobalObjectActivationState m02 1 36 False
|
||||
SceneSaveGlobalObjectSwitchState m02 1 36 1
|
||||
CameraFadeIn"},
|
||||
{"蜀山\n\n深夜去经库", @"
|
||||
ScriptVarSetValue -32768 60500
|
||||
SceneLoad q02 qY
|
||||
ActorActivate -1 1
|
||||
ActorEnablePlayerControl -1
|
||||
@@ -846,13 +840,13 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 6 1
|
||||
BigMapEnableRegion 7 2
|
||||
BigMapEnableRegion 8 2
|
||||
CameraFadeIn"},
|
||||
{"地脉门户大厅\n\n阳名百纳", @"
|
||||
ScriptVarSetValue -32768 70100
|
||||
SceneSaveGlobalObjectSwitchState m02 1 35 1
|
||||
SceneSaveGlobalObjectTimesCount m02 1 35 0
|
||||
SceneSaveGlobalObjectActivationState m02 1 36 False
|
||||
SceneSaveGlobalObjectSwitchState m02 1 36 1
|
||||
CameraFadeIn"},
|
||||
{"地脉门户大厅\n\n阳名百纳", @"
|
||||
ScriptVarSetValue -32768 70100
|
||||
SceneLoad m02 2
|
||||
ActorActivate -1 1
|
||||
ActorEnablePlayerControl -1
|
||||
@@ -869,13 +863,13 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 6 1
|
||||
BigMapEnableRegion 7 2
|
||||
BigMapEnableRegion 8 2
|
||||
CameraFadeIn"},
|
||||
{"血濡回魂\n\n初入京城", @"
|
||||
ScriptVarSetValue -32768 70700
|
||||
SceneSaveGlobalObjectSwitchState m02 1 35 1
|
||||
SceneSaveGlobalObjectTimesCount m02 1 35 0
|
||||
SceneSaveGlobalObjectActivationState m02 1 36 False
|
||||
SceneSaveGlobalObjectSwitchState m02 1 36 1
|
||||
CameraFadeIn"},
|
||||
{"血濡回魂\n\n初入京城", @"
|
||||
ScriptVarSetValue -32768 70700
|
||||
SceneLoad q06 q06
|
||||
ActorActivate -1 1
|
||||
ActorEnablePlayerControl -1
|
||||
@@ -892,13 +886,13 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 7 2
|
||||
BigMapEnableRegion 8 2
|
||||
BigMapEnableRegion 9 1
|
||||
CameraFadeIn"},
|
||||
{"失散\n\n双溪", @"
|
||||
ScriptVarSetValue -32768 80100
|
||||
SceneSaveGlobalObjectSwitchState m02 1 35 1
|
||||
SceneSaveGlobalObjectTimesCount m02 1 35 0
|
||||
SceneSaveGlobalObjectActivationState m02 1 36 False
|
||||
SceneSaveGlobalObjectSwitchState m02 1 36 1
|
||||
CameraFadeIn"},
|
||||
{"失散\n\n双溪", @"
|
||||
ScriptVarSetValue -32768 80100
|
||||
SceneLoad m07 3
|
||||
ActorActivate -1 1
|
||||
ActorEnablePlayerControl -1
|
||||
@@ -918,13 +912,13 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 8 2
|
||||
BigMapEnableRegion 9 1
|
||||
BigMapEnableRegion 10 2
|
||||
CameraFadeIn"},
|
||||
{"双溪\n\n里蜀山", @"
|
||||
ScriptVarSetValue -32768 80700
|
||||
SceneSaveGlobalObjectSwitchState m02 1 35 1
|
||||
SceneSaveGlobalObjectTimesCount m02 1 35 0
|
||||
SceneSaveGlobalObjectActivationState m02 1 36 False
|
||||
SceneSaveGlobalObjectSwitchState m02 1 36 1
|
||||
CameraFadeIn"},
|
||||
{"双溪\n\n里蜀山", @"
|
||||
ScriptVarSetValue -32768 80700
|
||||
SceneLoad q04 wb
|
||||
ActorActivate -1 1
|
||||
ActorEnablePlayerControl -1
|
||||
@@ -945,13 +939,13 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 8 2
|
||||
BigMapEnableRegion 9 1
|
||||
BigMapEnableRegion 10 2
|
||||
CameraFadeIn"},
|
||||
{"里蜀山外城南\n\n太阴归尘", @"
|
||||
ScriptVarSetValue -32768 80700
|
||||
SceneSaveGlobalObjectSwitchState m02 1 35 1
|
||||
SceneSaveGlobalObjectTimesCount m02 1 35 0
|
||||
SceneSaveGlobalObjectActivationState m02 1 36 False
|
||||
SceneSaveGlobalObjectSwitchState m02 1 36 1
|
||||
CameraFadeIn"},
|
||||
{"里蜀山外城南\n\n太阴归尘", @"
|
||||
ScriptVarSetValue -32768 80700
|
||||
SceneLoad q04 wn
|
||||
ActorActivate -1 1
|
||||
ActorEnablePlayerControl -1
|
||||
@@ -972,13 +966,13 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 8 2
|
||||
BigMapEnableRegion 9 1
|
||||
BigMapEnableRegion 10 2
|
||||
CameraFadeIn"},
|
||||
{"太阴归尘\n\n蜀山故道", @"
|
||||
ScriptVarSetValue -32768 90300
|
||||
SceneSaveGlobalObjectSwitchState m02 1 35 1
|
||||
SceneSaveGlobalObjectTimesCount m02 1 35 0
|
||||
SceneSaveGlobalObjectActivationState m02 1 36 False
|
||||
SceneSaveGlobalObjectSwitchState m02 1 36 1
|
||||
CameraFadeIn"},
|
||||
{"太阴归尘\n\n蜀山故道", @"
|
||||
ScriptVarSetValue -32768 90300
|
||||
SceneLoad m10 1
|
||||
ActorActivate -1 1
|
||||
ActorEnablePlayerControl -1
|
||||
@@ -997,13 +991,13 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 8 2
|
||||
BigMapEnableRegion 9 1
|
||||
BigMapEnableRegion 10 2
|
||||
CameraFadeIn"},
|
||||
{"蜀山深夜\n\n养父常纪房间", @"
|
||||
ScriptVarSetValue -32768 100400
|
||||
SceneSaveGlobalObjectSwitchState m02 1 35 1
|
||||
SceneSaveGlobalObjectTimesCount m02 1 35 0
|
||||
SceneSaveGlobalObjectActivationState m02 1 36 False
|
||||
SceneSaveGlobalObjectSwitchState m02 1 36 1
|
||||
CameraFadeIn"},
|
||||
{"蜀山深夜\n\n养父常纪房间", @"
|
||||
ScriptVarSetValue -32768 100400
|
||||
SceneLoad q02 qTY
|
||||
ActorActivate -1 1
|
||||
ActorEnablePlayerControl -1
|
||||
@@ -1024,13 +1018,13 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 9 1
|
||||
BigMapEnableRegion 10 2
|
||||
BigMapEnableRegion 11 1
|
||||
CameraFadeIn"},
|
||||
{"无极阁找掌门去锁妖塔", @"
|
||||
ScriptVarSetValue -32768 100701
|
||||
SceneSaveGlobalObjectSwitchState m02 1 35 1
|
||||
SceneSaveGlobalObjectTimesCount m02 1 35 0
|
||||
SceneSaveGlobalObjectActivationState m02 1 36 False
|
||||
SceneSaveGlobalObjectSwitchState m02 1 36 1
|
||||
CameraFadeIn"},
|
||||
{"无极阁找掌门去锁妖塔", @"
|
||||
ScriptVarSetValue -32768 100701
|
||||
SceneLoad q02 hn01
|
||||
ActorActivate -1 1
|
||||
ActorEnablePlayerControl -1
|
||||
@@ -1052,13 +1046,13 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 10 2
|
||||
BigMapEnableRegion 11 1
|
||||
CameraSetDefaultTransform 2
|
||||
CameraFadeIn"},
|
||||
{"新安当", @"
|
||||
ScriptVarSetValue -32768 101500
|
||||
SceneSaveGlobalObjectSwitchState m02 1 35 1
|
||||
SceneSaveGlobalObjectTimesCount m02 1 35 0
|
||||
SceneSaveGlobalObjectActivationState m02 1 36 False
|
||||
SceneSaveGlobalObjectSwitchState m02 1 36 1
|
||||
CameraFadeIn"},
|
||||
{"新安当", @"
|
||||
ScriptVarSetValue -32768 101500
|
||||
SceneLoad q09 d
|
||||
ActorActivate -1 1
|
||||
ActorEnablePlayerControl -1
|
||||
@@ -1081,13 +1075,13 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 11 1
|
||||
BigMapEnableRegion 12 1
|
||||
BigMapEnableRegion 13 2
|
||||
CameraFadeIn"},
|
||||
{"地脉门户\n\n太阳华池", @"
|
||||
ScriptVarSetValue -32768 110200
|
||||
SceneSaveGlobalObjectSwitchState m02 1 35 1
|
||||
SceneSaveGlobalObjectTimesCount m02 1 35 0
|
||||
SceneSaveGlobalObjectActivationState m02 1 36 False
|
||||
SceneSaveGlobalObjectSwitchState m02 1 36 1
|
||||
CameraFadeIn"},
|
||||
{"地脉门户\n\n太阳华池", @"
|
||||
ScriptVarSetValue -32768 110200
|
||||
SceneLoad m12 1
|
||||
ActorActivate -1 1
|
||||
ActorEnablePlayerControl -1
|
||||
@@ -1107,13 +1101,13 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 10 2
|
||||
BigMapEnableRegion 11 1
|
||||
BigMapEnableRegion 13 2
|
||||
CameraFadeIn"},
|
||||
{"小秘屋会和", @"
|
||||
ScriptVarSetValue -32768 120300
|
||||
SceneSaveGlobalObjectSwitchState m02 1 35 1
|
||||
SceneSaveGlobalObjectTimesCount m02 1 35 0
|
||||
SceneSaveGlobalObjectActivationState m02 1 36 False
|
||||
SceneSaveGlobalObjectSwitchState m02 1 36 1
|
||||
CameraFadeIn"},
|
||||
{"小秘屋会和", @"
|
||||
ScriptVarSetValue -32768 120300
|
||||
SceneLoad q04 wn
|
||||
ActorActivate -1 1
|
||||
ActorEnablePlayerControl -1
|
||||
@@ -1134,13 +1128,13 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 10 2
|
||||
BigMapEnableRegion 11 1
|
||||
BigMapEnableRegion 13 2
|
||||
CameraFadeIn"},
|
||||
{"里蜀山\n\n魔界之门", @"
|
||||
ScriptVarSetValue -32768 120400
|
||||
SceneSaveGlobalObjectSwitchState m02 1 35 1
|
||||
SceneSaveGlobalObjectTimesCount m02 1 35 0
|
||||
SceneSaveGlobalObjectActivationState m02 1 36 False
|
||||
SceneSaveGlobalObjectSwitchState m02 1 36 1
|
||||
CameraFadeIn"},
|
||||
{"里蜀山\n\n魔界之门", @"
|
||||
ScriptVarSetValue -32768 120400
|
||||
SceneLoad q04 wn
|
||||
ActorActivate -1 1
|
||||
ActorEnablePlayerControl -1
|
||||
@@ -1162,13 +1156,13 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 10 2
|
||||
BigMapEnableRegion 11 1
|
||||
BigMapEnableRegion 13 2
|
||||
CameraFadeIn"},
|
||||
{"里蜀山外城北\n\n少阴凝碧", @"
|
||||
ScriptVarSetValue -32768 130100
|
||||
SceneSaveGlobalObjectSwitchState m02 1 35 1
|
||||
SceneSaveGlobalObjectTimesCount m02 1 35 0
|
||||
SceneSaveGlobalObjectActivationState m02 1 36 False
|
||||
SceneSaveGlobalObjectSwitchState m02 1 36 1
|
||||
CameraFadeIn"},
|
||||
{"里蜀山外城北\n\n少阴凝碧", @"
|
||||
ScriptVarSetValue -32768 130100
|
||||
SceneLoad m14 1
|
||||
ActorActivate -1 1
|
||||
ActorEnablePlayerControl -1
|
||||
@@ -1190,13 +1184,13 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 10 2
|
||||
BigMapEnableRegion 11 1
|
||||
BigMapEnableRegion 13 2
|
||||
CameraFadeIn"},
|
||||
{"施洞", @"
|
||||
ScriptVarSetValue -32768 140200
|
||||
SceneSaveGlobalObjectSwitchState m02 1 35 1
|
||||
SceneSaveGlobalObjectTimesCount m02 1 35 0
|
||||
SceneSaveGlobalObjectActivationState m02 1 36 False
|
||||
SceneSaveGlobalObjectSwitchState m02 1 36 1
|
||||
CameraFadeIn"},
|
||||
{"施洞", @"
|
||||
ScriptVarSetValue -32768 140200
|
||||
SceneLoad q10 q10
|
||||
ActorActivate -1 1
|
||||
ActorEnablePlayerControl -1
|
||||
@@ -1219,13 +1213,13 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 10 2
|
||||
BigMapEnableRegion 11 1
|
||||
BigMapEnableRegion 13 2
|
||||
CameraFadeIn"},
|
||||
{"出发去月光城", @"
|
||||
ScriptVarSetValue -32768 140400
|
||||
SceneSaveGlobalObjectSwitchState m02 1 35 1
|
||||
SceneSaveGlobalObjectTimesCount m02 1 35 0
|
||||
SceneSaveGlobalObjectActivationState m02 1 36 False
|
||||
SceneSaveGlobalObjectSwitchState m02 1 36 1
|
||||
CameraFadeIn"},
|
||||
{"出发去月光城", @"
|
||||
ScriptVarSetValue -32768 140400
|
||||
SceneLoad q10 q10y
|
||||
ActorActivate -1 1
|
||||
ActorEnablePlayerControl -1
|
||||
@@ -1248,13 +1242,13 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 10 2
|
||||
BigMapEnableRegion 11 1
|
||||
BigMapEnableRegion 13 2
|
||||
CameraFadeIn"},
|
||||
{"蜀山\n\n重回绿萝山", @"
|
||||
ScriptVarSetValue -32768 150300
|
||||
SceneSaveGlobalObjectSwitchState m02 1 35 1
|
||||
SceneSaveGlobalObjectTimesCount m02 1 35 0
|
||||
SceneSaveGlobalObjectActivationState m02 1 36 False
|
||||
SceneSaveGlobalObjectSwitchState m02 1 36 1
|
||||
CameraFadeIn"},
|
||||
{"蜀山\n\n重回绿萝山", @"
|
||||
ScriptVarSetValue -32768 150300
|
||||
SceneLoad Q02 HS
|
||||
ActorActivate -1 1
|
||||
ActorEnablePlayerControl -1
|
||||
@@ -1277,13 +1271,13 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 11 1
|
||||
BigMapEnableRegion 13 2
|
||||
BigMapEnableRegion 14 2
|
||||
CameraFadeIn"},
|
||||
{"地脉门户\n\n少阳参天", @"
|
||||
ScriptVarSetValue -32768 150400
|
||||
SceneSaveGlobalObjectSwitchState m02 1 35 1
|
||||
SceneSaveGlobalObjectTimesCount m02 1 35 0
|
||||
SceneSaveGlobalObjectActivationState m02 1 36 False
|
||||
SceneSaveGlobalObjectSwitchState m02 1 36 1
|
||||
CameraFadeIn"},
|
||||
{"地脉门户\n\n少阳参天", @"
|
||||
ScriptVarSetValue -32768 150400
|
||||
SceneLoad m02 2
|
||||
ActorActivate -1 1
|
||||
ActorEnablePlayerControl -1
|
||||
@@ -1305,13 +1299,13 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 11 1
|
||||
BigMapEnableRegion 13 2
|
||||
BigMapEnableRegion 14 2
|
||||
CameraFadeIn"},
|
||||
{"回里蜀山秘密基地", @"
|
||||
ScriptVarSetValue -32768 160101
|
||||
SceneSaveGlobalObjectSwitchState m02 1 35 1
|
||||
SceneSaveGlobalObjectTimesCount m02 1 35 0
|
||||
SceneSaveGlobalObjectActivationState m02 1 36 False
|
||||
SceneSaveGlobalObjectSwitchState m02 1 36 1
|
||||
CameraFadeIn"},
|
||||
{"回里蜀山秘密基地", @"
|
||||
ScriptVarSetValue -32768 160101
|
||||
SceneLoad q04 wn
|
||||
ActorActivate -1 1
|
||||
ActorEnablePlayerControl -1
|
||||
@@ -1334,13 +1328,13 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 11 1
|
||||
BigMapEnableRegion 13 2
|
||||
BigMapEnableRegion 14 2
|
||||
CameraFadeIn"},
|
||||
{"里蜀山内城\n\n厥阴蔽日", @"
|
||||
ScriptVarSetValue -32768 170200
|
||||
SceneSaveGlobalObjectSwitchState m02 1 35 1
|
||||
SceneSaveGlobalObjectTimesCount m02 1 35 0
|
||||
SceneSaveGlobalObjectActivationState m02 1 36 False
|
||||
SceneSaveGlobalObjectSwitchState m02 1 36 1
|
||||
CameraFadeIn"},
|
||||
{"里蜀山内城\n\n厥阴蔽日", @"
|
||||
ScriptVarSetValue -32768 170200
|
||||
SceneLoad Q04 N
|
||||
ActorActivate -1 1
|
||||
ActorEnablePlayerControl -1
|
||||
@@ -1364,13 +1358,13 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 11 1
|
||||
BigMapEnableRegion 13 2
|
||||
BigMapEnableRegion 14 2
|
||||
CameraFadeIn"},
|
||||
{"地脉门户\n\n蜀山前山", @"
|
||||
ScriptVarSetValue -32768 171200
|
||||
SceneSaveGlobalObjectSwitchState m02 1 35 1
|
||||
SceneSaveGlobalObjectTimesCount m02 1 35 0
|
||||
SceneSaveGlobalObjectActivationState m02 1 36 False
|
||||
SceneSaveGlobalObjectSwitchState m02 1 36 1
|
||||
CameraFadeIn"},
|
||||
{"地脉门户\n\n蜀山前山", @"
|
||||
ScriptVarSetValue -32768 171200
|
||||
SceneLoad m02 1
|
||||
ActorActivate -1 1
|
||||
ActorEnablePlayerControl -1
|
||||
@@ -1392,13 +1386,13 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 11 1
|
||||
BigMapEnableRegion 13 2
|
||||
BigMapEnableRegion 14 2
|
||||
CameraFadeIn"},
|
||||
{"花圃\n\n温慧最高好感", @"
|
||||
ScriptVarSetValue -32768 180600
|
||||
SceneSaveGlobalObjectSwitchState m02 1 35 1
|
||||
SceneSaveGlobalObjectTimesCount m02 1 35 0
|
||||
SceneSaveGlobalObjectActivationState m02 1 36 False
|
||||
SceneSaveGlobalObjectSwitchState m02 1 36 1
|
||||
CameraFadeIn"},
|
||||
{"花圃\n\n温慧最高好感", @"
|
||||
ScriptVarSetValue -32768 180600
|
||||
SceneLoad q02 q
|
||||
ActorActivate -1 1
|
||||
ActorEnablePlayerControl -1
|
||||
@@ -1422,13 +1416,13 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 14 2
|
||||
FavorAdd 1 50
|
||||
FavorAdd 2 10
|
||||
CameraFadeIn"},
|
||||
{"花圃\n\n王蓬絮最高好感", @"
|
||||
ScriptVarSetValue -32768 180600
|
||||
SceneSaveGlobalObjectSwitchState m02 1 35 1
|
||||
SceneSaveGlobalObjectTimesCount m02 1 35 0
|
||||
SceneSaveGlobalObjectActivationState m02 1 36 False
|
||||
SceneSaveGlobalObjectSwitchState m02 1 36 1
|
||||
CameraFadeIn"},
|
||||
{"花圃\n\n王蓬絮最高好感", @"
|
||||
ScriptVarSetValue -32768 180600
|
||||
SceneLoad q02 q
|
||||
ActorActivate -1 1
|
||||
ActorEnablePlayerControl -1
|
||||
@@ -1452,10 +1446,6 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 14 2
|
||||
FavorAdd 1 10
|
||||
FavorAdd 2 50
|
||||
SceneSaveGlobalObjectSwitchState m02 1 35 1
|
||||
SceneSaveGlobalObjectTimesCount m02 1 35 0
|
||||
SceneSaveGlobalObjectActivationState m02 1 36 False
|
||||
SceneSaveGlobalObjectSwitchState m02 1 36 1
|
||||
CameraFadeIn"},
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -561,11 +561,14 @@ namespace Pal3.Dev
|
||||
: new UIDisplayNoteCommand("游戏保存失败"));
|
||||
if (success)
|
||||
{
|
||||
string newButtonText = string.Format(saveSlotButtonFormat, slotIndex,
|
||||
_saveManager.GetSaveSlotLastWriteTime(slotIndex));
|
||||
// Update button text
|
||||
var currentButtonText = slotButtonText;
|
||||
_menuItems.FirstOrDefault(_ => _.GetComponentInChildren<TextMeshProUGUI>() is
|
||||
{ } textUGUI && textUGUI.text.Equals(slotButtonText, StringComparison.Ordinal))!
|
||||
.GetComponentInChildren<TextMeshProUGUI>().text =
|
||||
string.Format(saveSlotButtonFormat, slotIndex, _saveManager.GetSaveSlotLastWriteTime(slotIndex));
|
||||
{ } textUGUI && textUGUI.text.Equals(currentButtonText, StringComparison.Ordinal))!
|
||||
.GetComponentInChildren<TextMeshProUGUI>().text = newButtonText;
|
||||
slotButtonText = newButtonText;
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ namespace Pal3.Effect
|
||||
using Data;
|
||||
using MetaData;
|
||||
using Scene;
|
||||
using Script.Waiter;
|
||||
using UnityEngine;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
@@ -56,8 +57,12 @@ namespace Pal3.Effect
|
||||
{
|
||||
// In PAL3A, PreLoad command is always issued right before the effect is played.
|
||||
// So it is pointless to pre-load the effect here for PAL3A.
|
||||
// Even with a waiter, we need to make sure waiter's current execution mode is set
|
||||
// to synchronous otherwise the effect will be played before the pre-load is finished.
|
||||
#if PAL3
|
||||
StartCoroutine(_resourceProvider.PreLoadVfxEffectAsync(command.EffectGroupId));
|
||||
WaitUntilCanceled waiter = new ();
|
||||
CommandDispatcher<ICommand>.Instance.Dispatch(new ScriptRunnerAddWaiterRequest(waiter));
|
||||
StartCoroutine(_resourceProvider.PreLoadVfxEffectAsync(command.EffectGroupId, () => waiter.CancelWait()));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ namespace Pal3.Effect.PostProcessing
|
||||
#if UNITY_IOS
|
||||
if (command.SettingName is nameof(GameSettings.ResolutionScale))
|
||||
{
|
||||
StartCoroutine(ReloadAmbientOcclusionSetting());
|
||||
StartCoroutine(ReloadAmbientOcclusionSettingAsync());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -176,12 +176,12 @@ namespace Pal3.Effect.PostProcessing
|
||||
#if UNITY_IOS
|
||||
private IEnumerator Start()
|
||||
{
|
||||
yield return ReloadAmbientOcclusionSetting();
|
||||
yield return ReloadAmbientOcclusionSettingAsync();
|
||||
}
|
||||
|
||||
// On iOS, the SSAO and Resolution changing are causing the RoundedFrostedGlass
|
||||
// shader to malfunction. This is a workaround to disable and re-enable SSAO to fix the issue.
|
||||
private IEnumerator ReloadAmbientOcclusionSetting()
|
||||
private IEnumerator ReloadAmbientOcclusionSettingAsync()
|
||||
{
|
||||
if (_gameSettings.IsAmbientOcclusionEnabled)
|
||||
{
|
||||
|
||||
@@ -918,12 +918,17 @@ namespace Pal3.GamePlay
|
||||
CommandDispatcher<ICommand>.Instance.Dispatch(new ScriptRunnerAddWaiterRequest(waiter));
|
||||
|
||||
var climbAnimationOnly = command.ClimbUp != -1;
|
||||
StartCoroutine(PlayerActorMoveToClimbableObjectAndClimbAsync(climbableObject, climbUp,
|
||||
climbAnimationOnly, climbableHeight, lowerPosition, lowerStandingPosition,
|
||||
upperPosition, upperStandingPosition, currentPlayerLayer, currentPlayerLayer, () =>
|
||||
{
|
||||
waiter.CancelWait();
|
||||
}));
|
||||
StartCoroutine(PlayerActorMoveToClimbableObjectAndClimbAsync(climbableObject,
|
||||
climbUp,
|
||||
climbAnimationOnly,
|
||||
climbableHeight,
|
||||
lowerPosition,
|
||||
lowerStandingPosition,
|
||||
upperPosition,
|
||||
upperStandingPosition,
|
||||
currentPlayerLayer,
|
||||
currentPlayerLayer,
|
||||
() => waiter.CancelWait()));
|
||||
}
|
||||
|
||||
public IEnumerator PlayerActorMoveToClimbableObjectAndClimbAsync(
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace Pal3.GameSystem
|
||||
return _totalTimeUsedBeforeSkippingTheLastDialogue < LIMIT_TIME_DIALOGUE_PLAYER_MAX_REACTION_TIME_IN_SECONDS;
|
||||
}
|
||||
|
||||
IEnumerator TypeSentenceAsync(TextMeshProUGUI textUI, string sentence, float waitSecondsBeforeRenderingChar)
|
||||
private IEnumerator TypeSentenceAsync(TextMeshProUGUI textUI, string sentence, float waitSecondsBeforeRenderingChar)
|
||||
{
|
||||
var charTypingAnimationDelay = new WaitForSeconds(waitSecondsBeforeRenderingChar);
|
||||
|
||||
@@ -234,10 +234,10 @@ namespace Pal3.GameSystem
|
||||
yield return text;
|
||||
}
|
||||
|
||||
public IEnumerator RenderDialogueAndWaitAsync(string text,
|
||||
private IEnumerator RenderDialogueAndWaitAsync(string text,
|
||||
bool trackReactionTime,
|
||||
WaitUntilCanceled waitUntilCanceled,
|
||||
DialogueRenderActorAvatarCommand avatarCommand = null)
|
||||
DialogueRenderActorAvatarCommand avatarCommand = null,
|
||||
Action onFinished = null)
|
||||
{
|
||||
CommandDispatcher<ICommand>.Instance.Dispatch(new DialogueRenderingStartedNotification());
|
||||
|
||||
@@ -305,8 +305,10 @@ namespace Pal3.GameSystem
|
||||
yield return StartDialogueAnimationAsync(false);
|
||||
|
||||
ResetUI();
|
||||
waitUntilCanceled.CancelWait();
|
||||
|
||||
_isDialoguePresenting = false;
|
||||
|
||||
onFinished?.Invoke();
|
||||
}
|
||||
|
||||
private IEnumerator StartDialogueAnimationAsync(bool showDialogue)
|
||||
@@ -361,7 +363,7 @@ namespace Pal3.GameSystem
|
||||
_selectionButtons.Clear();
|
||||
}
|
||||
|
||||
IEnumerator SkipDialogueRequestedAsync()
|
||||
private IEnumerator SkipDialogueRequestedAsync()
|
||||
{
|
||||
yield return new WaitUntil(() => _isSkipDialogueRequested);
|
||||
_isSkipDialogueRequested = false;
|
||||
@@ -436,7 +438,10 @@ namespace Pal3.GameSystem
|
||||
CommandDispatcher<ICommand>.Instance.Dispatch(new ScriptRunnerAddWaiterRequest(skipDialogueWaiter));
|
||||
DialogueRenderActorAvatarCommand avatarCommand = _lastAvatarCommand;
|
||||
_dialogueRenderQueue.Enqueue(RenderDialogueAndWaitAsync(
|
||||
GetDisplayText(command.DialogueText), false, skipDialogueWaiter, avatarCommand));
|
||||
GetDisplayText(command.DialogueText),
|
||||
false,
|
||||
avatarCommand,
|
||||
() => skipDialogueWaiter.CancelWait()));
|
||||
_lastAvatarCommand = null;
|
||||
}
|
||||
|
||||
@@ -446,7 +451,10 @@ namespace Pal3.GameSystem
|
||||
CommandDispatcher<ICommand>.Instance.Dispatch(new ScriptRunnerAddWaiterRequest(skipDialogueWaiter));
|
||||
DialogueRenderActorAvatarCommand avatarCommand = _lastAvatarCommand;
|
||||
_dialogueRenderQueue.Enqueue(RenderDialogueAndWaitAsync(
|
||||
GetDisplayText(command.DialogueText), true, skipDialogueWaiter, avatarCommand));
|
||||
GetDisplayText(command.DialogueText),
|
||||
true,
|
||||
avatarCommand,
|
||||
() => skipDialogueWaiter.CancelWait()));
|
||||
_lastAvatarCommand = null;
|
||||
}
|
||||
|
||||
@@ -497,7 +505,7 @@ namespace Pal3.GameSystem
|
||||
{
|
||||
_gameStateManager.GoToState(GameState.MenuShowing);
|
||||
|
||||
var waiter = new WaitUntilCanceled();
|
||||
WaitUntilCanceled waiter = new ();
|
||||
CommandDispatcher<ICommand>.Instance.Dispatch(new ScriptRunnerAddWaiterRequest(waiter));
|
||||
|
||||
Transform canvasTransform = _dialogueSelectionButtonsCanvas.transform;
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Pal3.State
|
||||
private const string LEGACY_SAVE_FILE_NAME = "save.txt";
|
||||
private const string SAVE_FILE_FORMAT = "slot_{0}.txt";
|
||||
private const string SAVE_FOLDER_NAME = "Saves";
|
||||
private const float AUTO_SAVE_MIN_DURATION = 180f; // 3 minutes
|
||||
private const float AUTO_SAVE_MIN_DURATION = 120f; // 2 minutes
|
||||
|
||||
private readonly SceneManager _sceneManager;
|
||||
private readonly PlayerManager _playerManager;
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
m_EditorVersion: 2022.2.12f1
|
||||
m_EditorVersionWithRevision: 2022.2.12f1 (022dac4955a3)
|
||||
m_EditorVersion: 2022.2.13f1
|
||||
m_EditorVersionWithRevision: 2022.2.13f1 (5f5de2657605)
|
||||
+2
-2
@@ -52,11 +52,11 @@ Open the current project folder using Unity 2022.2.X. For the specific Unity ver
|
||||
```
|
||||
ffmpeg -i input.mp4 -c:v libvpx -b:v 3M -c:a libvorbis output.webm // vp8 + vorbis
|
||||
```
|
||||
Note: You need to first decompress the OG game data to get the .bik videos. You can do this by running "ExtractAllCpkArchives" command under "Scenes\ResourceViewer" scene, which decompress all the CPK archives in the OG game data folder to a destination folder you choose. All .bik videos will be extracted to the output location once complete.
|
||||
Note: You need to first decompress the OG game data to get the .bik videos. You can do this by running "ExtractAllCpkArchives" command under "Scenes\ResourceViewer" scene, which decompress all the CPK archives in the OG game data folder to a destination folder you choose. All .bik videos will be extracted to the output location once complete.
|
||||
|
||||
## How to run the game
|
||||
- In runtime, when the game is launched for the first time, it will search the [Application.persistentDataPath](https://docs.unity3d.com/2022.2/Documentation/ScriptReference/Application-persistentDataPath.html) directory or the [StreamingAssets](https://docs.unity3d.com/2022.2/Documentation/Manual/StreamingAssets.html) directory to detect whether the game data exists. If the original game data files cannot be detected on desktop clients, the game will pop up a folder selection window for you to select the root directory of the original game installation files on the current device.
|
||||
- If the previous step is unsuccessful, please copy the entire "The Legend of Sword and Fairy 3" (or The Legend of Sword and Fairy 3 Gaiden: Wenqing Pian) original game installation directory to [Application.persistentDataPath](https://docs.unity3d.com/2022.2/Documentation/ScriptReference/Application-persistentDataPath.html). Note: If you manually copy the game data to this directory, the folder name must be PAL3 for "The Legend of Sword and Fairy 3," and PAL3A for The Legend of Sword and Fairy 3 Gaiden: Wenqing Pian. For iOS devices, please use iTunes to share the folder with the game application (this location is where the persistentDataPath is located), or you can package the original game data into the StreamingAssets folder during compilation with Unity, so you don't have to pick a folder when deployed.
|
||||
- If the previous step is unsuccessful, please copy the entire "The Legend of Sword and Fairy 3" (or "The Legend of Sword and Fairy 3 Gaiden: Wenqing Pian") original game installation directory to [Application.persistentDataPath](https://docs.unity3d.com/2022.2/Documentation/ScriptReference/Application-persistentDataPath.html). Note: If you manually copy the game data to this directory, the folder name must be PAL3 for "The Legend of Sword and Fairy 3," and PAL3A for The Legend of Sword and Fairy 3 Gaiden: Wenqing Pian. For iOS devices, please use iTunes to share the folder with the game application (this location is where the persistentDataPath is located), or you can package the original game data into the StreamingAssets folder during compilation with Unity, so you don't have to pick a folder when deployed.
|
||||
|
||||
## How to switch between two variants of the game
|
||||
The version switching is implemented through [Custom scripting symbols](https://docs.unity3d.com/2022.2/Documentation/Manual/CustomScriptingSymbols.html). PAL3 corresponds to The Legend of Sword and Fairy 3, and PAL3A corresponds to The Legend of Sword and Fairy 3 Gaiden: Wenqing Pian. I added a shortcut button in the Unity editor menu bar for one-click switching (Menu bar->Pal3->Switch Variant->PAL3A). After switching, the corresponding game folder will automatically change from PAL3 to PAL3A.
|
||||
|
||||
Reference in new issue
Block a user