Cleaned up animations a bit further, changed 'fusuma' to 'shoji'

This commit is contained in:
wookywok 2024-03-05 10:23:55 -06:00
parent afc14b9966
commit c9de6f31c0
5 changed files with 22 additions and 22 deletions

View file

@ -644,7 +644,7 @@ MonoBehaviour:
scrollingHolder: {fileID: 5348239490659111460}
nailHolder: {fileID: 7148765670405675429}
boardTrans: {fileID: 3085823780726025195}
fusumaTrans: {fileID: 1196000419050048408}
shojiTrans: {fileID: 1196000419050048408}
--- !u!1 &1716111394362355661
GameObject:
m_ObjectHideFlags: 0

View file

@ -21,8 +21,6 @@ AnimationClip:
- curve:
- time: 0
value: {fileID: -1220576532, guid: 99d6a57b351ee2046b9af317c31f4a05, type: 3}
- time: 0.41666666
value: {fileID: -1543273638, guid: 99d6a57b351ee2046b9af317c31f4a05, type: 3}
attribute: m_Sprite
path: Arm
classID: 212
@ -43,13 +41,12 @@ AnimationClip:
isPPtrCurve: 1
pptrCurveMapping:
- {fileID: -1220576532, guid: 99d6a57b351ee2046b9af317c31f4a05, type: 3}
- {fileID: -1543273638, guid: 99d6a57b351ee2046b9af317c31f4a05, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.43333334
m_StopTime: 0.016666668
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0

View file

@ -21,8 +21,8 @@ AnimationClip:
- serializedVersion: 3
time: 0
value: {x: 0.1, y: 3.2, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
inSlope: {x: Infinity, y: Infinity, z: 0}
outSlope: {x: Infinity, y: Infinity, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
@ -180,9 +180,9 @@ AnimationClip:
- serializedVersion: 3
time: 0
value: 0.1
inSlope: 0
outSlope: 0
tangentMode: 136
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
@ -244,9 +244,9 @@ AnimationClip:
- serializedVersion: 3
time: 0
value: 3.2
inSlope: 0
outSlope: 0
tangentMode: 136
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334

View file

@ -26,7 +26,7 @@ namespace HeavenStudio.Games.Scripts_NailCarpenter
private void HammmerJust(PlayerActionEvent caller, float state)
{
game.Carpenter.DoScaledAnimationAsync("carpenterHit", 1f);
game.Carpenter.DoScaledAnimationAsync("carpenterHit", 0.25f);
if (state >= 1f || state <= -1f)
{
nailAnim.DoScaledAnimationAsync(

View file

@ -38,21 +38,22 @@ namespace HeavenStudio.Games.Loaders
defaultLength = 4f,
resizable = true
},
new GameAction("slideFusuma", "Slide Fusuma")
new GameAction("slideShoji", "Slide Shoji")
{
function = delegate {
var e = eventCaller.currentEntity;
NailCarpenter.instance.SlideFusuma(e.beat, e.length, e["fillRatio"], e["ease"], e["mute"]);
NailCarpenter.instance.SlideShoji(e.beat, e.length, e["fillRatio"], e["ease"], e["mute"]);
},
defaultLength = 1f,
resizable = true,
parameters = new List<Param>()
{
new Param("fillRatio", new EntityTypes.Float(0f, 1f, 0.3f), "Ratio", "Set the ratio of closing the fusuma."),
new Param("fillRatio", new EntityTypes.Float(0f, 1f, 0.3f), "Ratio", "Set how much of the screen the shoji covers."),
new Param("ease", Util.EasingFunction.Ease.Linear, "Ease", "Set the easing of the action."),
new Param("mute", false, "Mute", "Toggle if the cue should be muted.")
}
},
},
new List<string>() { "pco", "normal" },
"pconail", "en",
@ -79,7 +80,7 @@ namespace HeavenStudio.Games
public Transform scrollingHolder;
public Transform nailHolder;
public Transform boardTrans;
public Transform fusumaTrans;
public Transform shojiTrans;
const float nailDistance = -4f;
const float boardWidth = 19.2f;
float scrollRate => nailDistance / (Conductor.instance.pitchedSecPerBeat * 2f);
@ -136,6 +137,7 @@ namespace HeavenStudio.Games
Util.EasingFunction.Ease slideEase;
float slideRatioLast = 0, slideRatioNext = 0;
void Update()
{
var cond = Conductor.instance;
@ -171,7 +173,7 @@ namespace HeavenStudio.Games
newBoardX %= boardWidth;
boardTrans.localPosition = new Vector3(newBoardX, boardPos.y, boardPos.z);
UpdateFusuma(currentBeat);
UpdateShoji(currentBeat);
}
public override void OnGameSwitch(double beat)
@ -317,7 +319,7 @@ namespace HeavenStudio.Games
OnGameSwitch(beat);
}
public void SlideFusuma(double beat, double length, float fillRatio, int ease, bool mute)
public void SlideShoji(double beat, double length, float fillRatio, int ease, bool mute)
{
if (!mute) MultiSound.Play(new MultiSound.Sound[]{ new MultiSound.Sound("nailCarpenter/open", beat)});
slideBeat = beat;
@ -326,7 +328,7 @@ namespace HeavenStudio.Games
slideRatioLast = slideRatioNext;
slideRatioNext = fillRatio;
}
void UpdateFusuma(double beat)
void UpdateShoji(double beat)
{
if (beat >= slideBeat)
{
@ -336,7 +338,7 @@ namespace HeavenStudio.Games
float slideProg = Conductor.instance.GetPositionFromBeat(slideBeat, slideLength, true);
slideProg = Mathf.Clamp01(slideProg);
float slide = func(slideLast, slideNext, slideProg);
fusumaTrans.localPosition = new Vector3(slide, 0, 0);
shojiTrans.localPosition = new Vector3(slide, 0, 0);
}
}
@ -387,6 +389,7 @@ namespace HeavenStudio.Games
return false;
}
// MultiSound.Play may not work in OnPlay (OnGameSwitch?), so I play the audio using an alternative method.
List<MultiSound.Sound> sounds = new List<MultiSound.Sound>(){};
bool isPlayed = false;