2025-11-25 08:19:33 -05:00
|
|
|
using System.Collections.Generic;
|
2026-02-13 09:22:11 -05:00
|
|
|
using Lean.Pool;
|
|
|
|
|
using MoreMountains.Feedbacks;
|
|
|
|
|
using MoreMountains.FeedbacksForThirdParty;
|
|
|
|
|
using SLSUtilities.FeelAssistance;
|
2025-11-25 08:19:33 -05:00
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace Cielonos.MainGame.Characters
|
|
|
|
|
{
|
2026-02-13 09:22:11 -05:00
|
|
|
public partial class FeedbackSubcontroller : SubcontrollerBase<CharacterBase>
|
2025-11-25 08:19:33 -05:00
|
|
|
{
|
|
|
|
|
public Dictionary<string, FeedbackUnit> feedbacks;
|
2026-03-20 12:07:44 -04:00
|
|
|
public FeedbackUnit this[string feedbackName] => feedbacks?.GetValueOrDefault(feedbackName, null);
|
2025-11-25 08:19:33 -05:00
|
|
|
|
|
|
|
|
private void Update()
|
|
|
|
|
{
|
2026-01-03 18:19:39 -05:00
|
|
|
if (feedbacks == null) return;
|
|
|
|
|
|
2025-11-25 08:19:33 -05:00
|
|
|
foreach (var feedbackUnit in feedbacks.Values)
|
|
|
|
|
{
|
2025-12-22 18:36:29 -05:00
|
|
|
float timeScaleMultiplier = owner.selfTimeSm.TimeScale;
|
|
|
|
|
feedbackUnit.feedback.ExternalTimeScale = timeScaleMultiplier;
|
2025-11-25 08:19:33 -05:00
|
|
|
feedbackUnit.Update();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-02-13 09:22:11 -05:00
|
|
|
|
|
|
|
|
public partial class FeedbackSubcontroller
|
|
|
|
|
{
|
|
|
|
|
protected void Swing(Vector3 swingRotation, float rotationDuration, Vector3 swingPosition, float positionDuration)
|
|
|
|
|
{
|
|
|
|
|
MMF_Player swing = LeanPool.Spawn(MainGameBaseCollection.Instance.feedbackCollection["Swing"]).GetComponent<MMF_Player>();
|
|
|
|
|
|
|
|
|
|
MMF_CinemachineRotation cinemachineRotation = swing.GetFeedbackOfType<MMF_CinemachineRotation>();
|
|
|
|
|
if (cinemachineRotation != null)
|
|
|
|
|
{
|
|
|
|
|
cinemachineRotation.RotationAmplitude = swingRotation != default ? swingRotation : Vector3.zero;
|
|
|
|
|
cinemachineRotation.Duration = rotationDuration;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MMF_CinemachinePosition cinemachinePosition = swing.GetFeedbackOfType<MMF_CinemachinePosition>();
|
|
|
|
|
if (cinemachinePosition != null)
|
|
|
|
|
{
|
|
|
|
|
cinemachinePosition.PositionAmplitude = swingPosition != default ? swingPosition : Vector3.zero;
|
|
|
|
|
cinemachinePosition.Duration = positionDuration;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swing.Events.OnComplete.RemoveAllListeners();
|
|
|
|
|
swing.Events.OnComplete.AddListener(()=> LeanPool.Despawn(swing.gameObject));
|
|
|
|
|
swing.PlayFeedbacks();
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-11-25 08:19:33 -05:00
|
|
|
}
|