more games
fix bugs with some input related systems
This commit is contained in:
parent
ee0cd1bcd8
commit
3543491f17
|
|
@ -27064,7 +27064,7 @@ MonoBehaviour:
|
|||
pitch: 1
|
||||
volume: 1
|
||||
looping: 0
|
||||
offset: 0.055
|
||||
offset: 0.02
|
||||
parameters: []
|
||||
- name: arisa_iina_fast
|
||||
sequence:
|
||||
|
|
@ -27083,7 +27083,7 @@ MonoBehaviour:
|
|||
pitch: 1
|
||||
volume: 1
|
||||
looping: 0
|
||||
offset: 0.055
|
||||
offset: 0.025
|
||||
parameters: []
|
||||
- name: crowd_big_ready
|
||||
sequence:
|
||||
|
|
@ -27165,7 +27165,6 @@ MonoBehaviour:
|
|||
parameters: []
|
||||
EligibleHits: []
|
||||
scheduledInputs: []
|
||||
firstEnable: 0
|
||||
StageAnimator: {fileID: 22498285944424125}
|
||||
Arisa: {fileID: 3728697055337045071}
|
||||
ArisaRootMotion: {fileID: 2223479141072930853}
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -37,7 +37,7 @@ namespace HeavenStudio
|
|||
{
|
||||
this.gameObject.transform.position = new Vector3(pos.x, pos.y, 0);
|
||||
|
||||
if (PlayerInput.GetIsAction(Minigame.InputAction_BasicPress, out _))
|
||||
if (PlayerInput.GetIsAction(Minigame.InputAction_BasicPress))
|
||||
{
|
||||
Circle.transform.DOScale(0, 0.5f).SetEase(Ease.OutExpo);
|
||||
InnerCircle.SetActive(true);
|
||||
|
|
@ -48,7 +48,7 @@ namespace HeavenStudio
|
|||
eyesTween.Kill();
|
||||
eyesTween = Eyes.transform.DOLocalMoveY(0.15f, 0.15f).SetEase(Ease.OutExpo);
|
||||
}
|
||||
else if (PlayerInput.GetIsAction(Minigame.InputAction_BasicRelease, out _))
|
||||
else if (PlayerInput.GetIsAction(Minigame.InputAction_BasicRelease))
|
||||
{
|
||||
Circle.transform.DOScale(0.2f, 0.5f).SetEase(Ease.OutExpo);
|
||||
InnerCircle.SetActive(false);
|
||||
|
|
|
|||
|
|
@ -160,11 +160,11 @@ namespace HeavenStudio.Games
|
|||
}
|
||||
|
||||
public static PlayerInput.InputAction InputAction_Left =
|
||||
new("BlueBearLeft", new int[] { IALeft, IALeft, IALeft },
|
||||
new("CtrBearLeft", new int[] { IALeft, IALeft, IALeft },
|
||||
IA_PadLeft, IA_TouchLeft, IA_BatonLeft);
|
||||
|
||||
public static PlayerInput.InputAction InputAction_Right =
|
||||
new("BlueBearRight", new int[] { IARight, IARight, IARight },
|
||||
new("CtrBearRight", new int[] { IARight, IARight, IARight },
|
||||
IA_PadRight, IA_TouchRight, IA_BatonRight);
|
||||
|
||||
void OnDestroy()
|
||||
|
|
@ -189,11 +189,11 @@ namespace HeavenStudio.Games
|
|||
{
|
||||
headAndBodyAnim.SetBool("ShouldOpenMouth", foodHolder.childCount != 0);
|
||||
|
||||
if (PlayerInput.GetIsAction(InputAction_Left, out _) && !IsExpectingInputNow(InputAction_Left.inputLockCategory))
|
||||
if (PlayerInput.GetIsAction(InputAction_Left) && !IsExpectingInputNow(InputAction_Left.inputLockCategory))
|
||||
{
|
||||
Bite(true);
|
||||
}
|
||||
else if (PlayerInput.GetIsAction(InputAction_Right, out _) && !IsExpectingInputNow(InputAction_Right.inputLockCategory))
|
||||
else if (PlayerInput.GetIsAction(InputAction_Right) && !IsExpectingInputNow(InputAction_Right.inputLockCategory))
|
||||
{
|
||||
Bite(false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ namespace HeavenStudio.Games
|
|||
{
|
||||
SingleBop();
|
||||
}
|
||||
if(PlayerInput.Pressed() && !IsExpectingInputNow(InputType.STANDARD_DOWN))
|
||||
if (PlayerInput.GetIsAction(InputAction_BasicPressing) && !IsExpectingInputNow(InputAction_BasicPress.inputLockCategory))
|
||||
{
|
||||
if (executives[executiveCount - 1].spinning)
|
||||
{
|
||||
|
|
@ -214,7 +214,7 @@ namespace HeavenStudio.Games
|
|||
}),
|
||||
new BeatAction.Action(beat + 2.5f, delegate { assistantCanBop = true; })
|
||||
});
|
||||
ScheduleInput(beat, 2f, InputType.STANDARD_DOWN, JustAssistant, MissAssistant, Empty);
|
||||
ScheduleInput(beat, 2f, InputAction_BasicPress, JustAssistant, MissAssistant, Empty);
|
||||
}
|
||||
|
||||
public void Stop(double beat, float length)
|
||||
|
|
@ -255,7 +255,7 @@ namespace HeavenStudio.Games
|
|||
}
|
||||
stops.Add(new BeatAction.Action(beat + length * executiveCount + 0.5f, delegate { executivesCanBop = true; }));
|
||||
BeatAction.New(instance, stops);
|
||||
ScheduleInput(beat, length * (executiveCount - 1), InputType.STANDARD_DOWN, Just, Miss, Empty);
|
||||
ScheduleInput(beat, length * (executiveCount - 1), InputAction_BasicPress, Just, Miss, Empty);
|
||||
}
|
||||
|
||||
public void Prepare()
|
||||
|
|
|
|||
|
|
@ -290,7 +290,7 @@ namespace HeavenStudio.Games
|
|||
if (canShoot && lastShotOut)
|
||||
lastShotOut = false;
|
||||
|
||||
if (canShoot && !lastShotOut && PlayerInput.GetIsAction(InputAction_FlickPress, out _) && !IsExpectingInputNow(InputAction_FlickPress.inputLockCategory))
|
||||
if (canShoot && !lastShotOut && PlayerInput.GetIsAction(InputAction_FlickPress) && !IsExpectingInputNow(InputAction_FlickPress.inputLockCategory))
|
||||
{
|
||||
lastShotOut = true;
|
||||
shootingThisFrame = true;
|
||||
|
|
@ -306,11 +306,11 @@ namespace HeavenStudio.Games
|
|||
|
||||
if (PlayerInput.PlayerHasControl() && PlayerInput.CurrentControlStyle is InputSystem.InputController.ControlStyles.Touch)
|
||||
{
|
||||
if (PlayerInput.GetIsAction(InputAction_BasicPress, out _))
|
||||
if (PlayerInput.GetIsAction(InputAction_BasicPress))
|
||||
{
|
||||
shooterAnim.Play("Windup", 0, 0);
|
||||
}
|
||||
if (PlayerInput.GetIsAction(InputAction_BasicRelease, out _) && !shootingThisFrame)
|
||||
if (PlayerInput.GetIsAction(InputAction_BasicRelease) && !shootingThisFrame)
|
||||
{
|
||||
shooterAnim.Play("WindDown", 0, 23 / 28f);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using HeavenStudio.Util;
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using HeavenStudio.InputSystem;
|
||||
|
||||
namespace HeavenStudio.Games.Loaders
|
||||
{
|
||||
|
|
@ -55,10 +56,10 @@ namespace HeavenStudio.Games.Loaders
|
|||
},
|
||||
}
|
||||
},
|
||||
new List<string>() {"ctr", "normal"},
|
||||
new List<string>() { "ctr", "normal" },
|
||||
"ctrcatchy",
|
||||
"en",
|
||||
new List<string>(){}
|
||||
new List<string>() { }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -125,6 +126,61 @@ namespace HeavenStudio.Games
|
|||
public float endSmile;
|
||||
}
|
||||
|
||||
const int IALeft = 0;
|
||||
const int IARight = 1;
|
||||
protected static bool IA_PadLeft(out double dt)
|
||||
{
|
||||
return PlayerInput.GetPadDown(InputController.ActionsPad.Up, out dt)
|
||||
|| PlayerInput.GetPadDown(InputController.ActionsPad.Down, out dt)
|
||||
|| PlayerInput.GetPadDown(InputController.ActionsPad.Left, out dt)
|
||||
|| PlayerInput.GetPadDown(InputController.ActionsPad.Right, out dt);
|
||||
}
|
||||
protected static bool IA_BatonLeft(out double dt)
|
||||
{
|
||||
return PlayerInput.GetBatonDown(InputController.ActionsBaton.West, out dt);
|
||||
}
|
||||
protected static bool IA_TouchLeft(out double dt)
|
||||
{
|
||||
bool want = PlayerInput.GetTouchDown(InputController.ActionsTouch.Left, out dt);
|
||||
bool simul = false;
|
||||
if (!want)
|
||||
{
|
||||
simul = PlayerInput.GetTouchDown(InputController.ActionsTouch.Right, out dt)
|
||||
&& instance.IsExpectingInputNow(InputAction_Left.inputLockCategory)
|
||||
&& instance.IsExpectingInputNow(InputAction_Right.inputLockCategory);
|
||||
}
|
||||
return want || simul;
|
||||
}
|
||||
|
||||
protected static bool IA_PadRight(out double dt)
|
||||
{
|
||||
return PlayerInput.GetPadDown(InputController.ActionsPad.East, out dt);
|
||||
}
|
||||
protected static bool IA_BatonRight(out double dt)
|
||||
{
|
||||
return PlayerInput.GetBatonDown(InputController.ActionsBaton.East, out dt);
|
||||
}
|
||||
protected static bool IA_TouchRight(out double dt)
|
||||
{
|
||||
bool want = PlayerInput.GetTouchDown(InputController.ActionsTouch.Right, out dt);
|
||||
bool simul = false;
|
||||
if (!want)
|
||||
{
|
||||
simul = PlayerInput.GetTouchDown(InputController.ActionsTouch.Left, out dt)
|
||||
&& instance.IsExpectingInputNow(InputAction_Left.inputLockCategory)
|
||||
&& instance.IsExpectingInputNow(InputAction_Right.inputLockCategory);
|
||||
}
|
||||
return want || simul;
|
||||
}
|
||||
|
||||
public static PlayerInput.InputAction InputAction_Left =
|
||||
new("CtrStepLeft", new int[] { IALeft, IALeft, IALeft },
|
||||
IA_PadLeft, IA_TouchLeft, IA_BatonLeft);
|
||||
|
||||
public static PlayerInput.InputAction InputAction_Right =
|
||||
new("CtrStepRight", new int[] { IARight, IARight, IARight },
|
||||
IA_PadRight, IA_TouchRight, IA_BatonRight);
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
instance = this;
|
||||
|
|
@ -193,16 +249,13 @@ namespace HeavenStudio.Games
|
|||
}
|
||||
}
|
||||
|
||||
if (!IsExpectingInputNow())
|
||||
if (PlayerInput.GetIsAction(InputAction_Left) && !IsExpectingInputNow(InputAction_Left.inputLockCategory))
|
||||
{
|
||||
if (PlayerInput.GetAnyDirectionDown())
|
||||
{
|
||||
catchWhiff(false);
|
||||
}
|
||||
if (PlayerInput.Pressed())
|
||||
{
|
||||
catchWhiff(true);
|
||||
}
|
||||
catchWhiff(false);
|
||||
}
|
||||
if (PlayerInput.GetIsAction(InputAction_Right) && !IsExpectingInputNow(InputAction_Right.inputLockCategory))
|
||||
{
|
||||
catchWhiff(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -346,7 +399,7 @@ namespace HeavenStudio.Games
|
|||
double beat = Conductor.instance.songPositionInBeatsAsDouble;
|
||||
|
||||
string fruitType = isPineapple ? "Pineapple" : "Orange";
|
||||
|
||||
|
||||
if (side)
|
||||
{
|
||||
alalinAnim.Play("miss" + fruitType, 0, 0);
|
||||
|
|
@ -382,7 +435,7 @@ namespace HeavenStudio.Games
|
|||
public void whiffAnim(bool side)
|
||||
{
|
||||
double beat = Conductor.instance.songPositionInBeatsAsDouble;
|
||||
|
||||
|
||||
if (side)
|
||||
{
|
||||
alalinAnim.Play("whiff", 0, 0);
|
||||
|
|
|
|||
|
|
@ -70,18 +70,17 @@ namespace HeavenStudio.Games.Scripts_CatchyTune
|
|||
soundText += "Orange";
|
||||
}
|
||||
|
||||
game.ScheduleInput(startBeat, beatLength, side ? InputType.STANDARD_DOWN : InputType.DIRECTION_DOWN,
|
||||
game.ScheduleInput(startBeat, beatLength, side ? CatchyTune.InputAction_Right : CatchyTune.InputAction_Left,
|
||||
CatchFruit, Miss, WayOff);
|
||||
}
|
||||
|
||||
// minenice: note - needs PlayerActionEvent implementation
|
||||
private void Update()
|
||||
{
|
||||
if (barelyStart > 0f)
|
||||
{
|
||||
anim.DoScaledAnimation("barely", barelyStart, isPineapple ? 2f : 1f);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
anim.DoScaledAnimation("fruit bounce", startBeat, beatLength + (isPineapple ? 4f : 2f));
|
||||
}
|
||||
|
|
@ -142,7 +141,7 @@ namespace HeavenStudio.Games.Scripts_CatchyTune
|
|||
{
|
||||
//near miss (barely)
|
||||
barelyStart = Conductor.instance.songPositionInBeatsAsDouble;
|
||||
|
||||
|
||||
game.catchBarely(side);
|
||||
|
||||
// play near miss animation
|
||||
|
|
@ -154,7 +153,7 @@ namespace HeavenStudio.Games.Scripts_CatchyTune
|
|||
});
|
||||
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
SoundByte.PlayOneShotGame(soundText + "Catch");
|
||||
game.catchSuccess(side, isPineapple, smile, startBeat + beatLength, endSmile);
|
||||
|
|
@ -172,6 +171,6 @@ namespace HeavenStudio.Games.Scripts_CatchyTune
|
|||
});
|
||||
}
|
||||
|
||||
private void WayOff(PlayerActionEvent caller) {} // whiffing is handled in the main loop
|
||||
private void WayOff(PlayerActionEvent caller) { } // whiffing is handled in the main loop
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ namespace HeavenStudio.Games.Scripts_ClappyTrio
|
|||
|
||||
private void Update()
|
||||
{
|
||||
if (PlayerInput.Pressed() && !game.IsExpectingInputNow(InputType.STANDARD_DOWN))
|
||||
if (PlayerInput.GetIsAction(ClappyTrio.InputAction_BasicPress) && !game.IsExpectingInputNow(ClappyTrio.InputAction_BasicPress.inputLockCategory))
|
||||
{
|
||||
Clap(false);
|
||||
game.ScoreMiss();
|
||||
|
|
@ -37,7 +37,7 @@ namespace HeavenStudio.Games.Scripts_ClappyTrio
|
|||
lastClapBeat = startBeat;
|
||||
lastClapLength = length;
|
||||
|
||||
game.ScheduleInput(startBeat, length, InputType.STANDARD_DOWN, Just, Miss, Out);
|
||||
game.ScheduleInput(startBeat, length, ClappyTrio.InputAction_BasicPress, Just, Miss, Out);
|
||||
}
|
||||
|
||||
private void Just(PlayerActionEvent caller, float state)
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ namespace HeavenStudio.Games
|
|||
|
||||
this.audienceReacting = audienceReacting;
|
||||
|
||||
coin = ScheduleInput(beat, 6f, InputType.STANDARD_DOWN, CatchSuccess, CatchMiss, CatchEmpty);
|
||||
coin = ScheduleInput(beat, 6f, InputAction_BasicPress, CatchSuccess, CatchMiss, CatchEmpty);
|
||||
//coin.perfectOnly = true;
|
||||
}
|
||||
|
||||
|
|
@ -176,7 +176,7 @@ namespace HeavenStudio.Games
|
|||
isThrowing = true;
|
||||
this.audienceReacting = false;
|
||||
|
||||
coin = ScheduleInput(beat, 6f, InputType.STANDARD_DOWN, CatchSuccess, CatchMiss, CatchEmpty);
|
||||
coin = ScheduleInput(beat, 6f, InputAction_BasicPress, CatchSuccess, CatchMiss, CatchEmpty);
|
||||
//coin.perfectOnly = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ namespace HeavenStudio.Games.Scripts_DrummingPractice
|
|||
|
||||
private void Update()
|
||||
{
|
||||
if (player && PlayerInput.Pressed() && !DrummingPractice.instance.IsExpectingInputNow(InputType.STANDARD_DOWN))
|
||||
if (player && PlayerInput.GetIsAction(DrummingPractice.InputAction_BasicPress) && !DrummingPractice.instance.IsExpectingInputNow(DrummingPractice.InputAction_BasicPress.inputLockCategory))
|
||||
{
|
||||
Hit(false, false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ namespace HeavenStudio.Games.Scripts_DrummingPractice
|
|||
|
||||
void Start()
|
||||
{
|
||||
game.ScheduleInput(startBeat, 1f, InputType.STANDARD_DOWN, Just, Miss, Out);
|
||||
game.ScheduleInput(startBeat, 1f, DrummingPractice.InputAction_BasicPress, Just, Miss, Out);
|
||||
|
||||
BeatAction.New(game, new List<BeatAction.Action>()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -226,6 +226,10 @@ namespace HeavenStudio.Games
|
|||
//game scene
|
||||
public static FanClub instance;
|
||||
|
||||
public static PlayerInput.InputAction InputAction_TouchRelease =
|
||||
new("NtrIdolTouchRelease", new int[] { IAEmptyCat, IAReleaseCat, IAEmptyCat },
|
||||
IA_Empty, IA_TouchBasicRelease, IA_Empty);
|
||||
|
||||
const int FAN_COUNT = 12;
|
||||
const float RADIUS = 1.5f;
|
||||
private void Awake()
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ using Starpelly;
|
|||
using NaughtyBezierCurves;
|
||||
|
||||
using HeavenStudio.Util;
|
||||
using HeavenStudio.InputSystem;
|
||||
|
||||
namespace HeavenStudio.Games.Scripts_FanClub
|
||||
{
|
||||
|
|
@ -35,16 +36,16 @@ namespace HeavenStudio.Games.Scripts_FanClub
|
|||
switch (type)
|
||||
{
|
||||
case 0:
|
||||
FanClub.instance.ScheduleInput(beat, 1f, InputType.STANDARD_DOWN, ClapJust, ClapThrough, Out);
|
||||
FanClub.instance.ScheduleInput(beat, 1f, FanClub.InputAction_BasicPress, ClapJust, ClapThrough, Out);
|
||||
break;
|
||||
case 1:
|
||||
FanClub.instance.ScheduleInput(beat, 1f, InputType.STANDARD_UP, JumpJust, JumpThrough, JumpOut);
|
||||
FanClub.instance.ScheduleInput(beat, 1f, FanClub.InputAction_FlickRelease, JumpJust, JumpThrough, JumpOut);
|
||||
break;
|
||||
case 2:
|
||||
FanClub.instance.ScheduleInput(beat, 1f, InputType.STANDARD_DOWN, ChargeClapJust, ClapThrough, Out);
|
||||
FanClub.instance.ScheduleInput(beat, 1f, FanClub.InputAction_BasicPress, ChargeClapJust, ClapThrough, Out);
|
||||
break;
|
||||
default:
|
||||
FanClub.instance.ScheduleInput(beat, 1f, InputType.STANDARD_DOWN, LongClapJust, ClapThrough, Out);
|
||||
FanClub.instance.ScheduleInput(beat, 1f, FanClub.InputAction_BasicPress, LongClapJust, ClapThrough, Out);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -97,9 +98,9 @@ namespace HeavenStudio.Games.Scripts_FanClub
|
|||
|
||||
if (player)
|
||||
{
|
||||
if (PlayerInput.Pressed())
|
||||
if (PlayerInput.GetIsAction(FanClub.InputAction_BasicPress))
|
||||
{
|
||||
if (!FanClub.instance.IsExpectingInputNow(InputType.STANDARD_DOWN))
|
||||
if (!FanClub.instance.IsExpectingInputNow(FanClub.InputAction_BasicPress.inputLockCategory))
|
||||
{
|
||||
if (FanClub.instance.JudgementPaused)
|
||||
{
|
||||
|
|
@ -112,7 +113,7 @@ namespace HeavenStudio.Games.Scripts_FanClub
|
|||
}
|
||||
}
|
||||
}
|
||||
if (PlayerInput.Pressing())
|
||||
if (PlayerInput.GetIsAction(FanClub.InputAction_BasicPressing))
|
||||
{
|
||||
if (clappingStartTime != double.MinValue && cond.songPositionInBeatsAsDouble > clappingStartTime + 2f && !stopCharge)
|
||||
{
|
||||
|
|
@ -121,9 +122,16 @@ namespace HeavenStudio.Games.Scripts_FanClub
|
|||
stopCharge = true;
|
||||
}
|
||||
}
|
||||
if (PlayerInput.PressedUp())
|
||||
if (PlayerInput.GetIsAction(FanClub.InputAction_FlickRelease))
|
||||
{
|
||||
if (clappingStartTime != double.MinValue && cond.songPositionInBeatsAsDouble > clappingStartTime + 2f && stopCharge && !FanClub.instance.IsExpectingInputNow(InputType.STANDARD_UP))
|
||||
float nonTouchDelay = 2f;
|
||||
if (PlayerInput.CurrentControlStyle == InputController.ControlStyles.Touch)
|
||||
{
|
||||
nonTouchDelay = 0f;
|
||||
stopCharge = true;
|
||||
}
|
||||
if (clappingStartTime != double.MinValue && cond.songPositionInBeatsAsDouble > clappingStartTime + nonTouchDelay && stopCharge
|
||||
&& !FanClub.instance.IsExpectingInputNow(FanClub.InputAction_FlickRelease.inputLockCategory))
|
||||
{
|
||||
if (FanClub.instance.JudgementPaused)
|
||||
{
|
||||
|
|
@ -143,6 +151,14 @@ namespace HeavenStudio.Games.Scripts_FanClub
|
|||
clappingStartTime = double.MinValue;
|
||||
}
|
||||
}
|
||||
if (PlayerInput.GetIsAction(FanClub.InputAction_TouchRelease))
|
||||
{
|
||||
animator.speed = 1f;
|
||||
animator.Play("FanFree", -1, 0);
|
||||
stopBeat = false;
|
||||
stopCharge = false;
|
||||
clappingStartTime = double.MinValue;
|
||||
}
|
||||
}
|
||||
|
||||
float jumpPos = cond.GetPositionFromBeat(jumpStartTime, 1f);
|
||||
|
|
@ -199,7 +215,7 @@ namespace HeavenStudio.Games.Scripts_FanClub
|
|||
BeatAction.New(this, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(cond.songPositionInBeatsAsDouble + 0.1f, delegate {
|
||||
if (PlayerInput.Pressing() || autoplayRelease > 0f)
|
||||
if (PlayerInput.GetIsAction(FanClub.InputAction_BasicPressing) || autoplayRelease > 0f)
|
||||
{
|
||||
animator.Play("FanClapCharge", -1, 0);
|
||||
stopCharge = true;
|
||||
|
|
|
|||
|
|
@ -30,10 +30,11 @@ namespace HeavenStudio.Games
|
|||
}
|
||||
|
||||
#region Premade Input Actions
|
||||
const int IAEmptyCat = -1;
|
||||
const int IAPressCat = 0;
|
||||
const int IAReleaseCat = 1;
|
||||
const int IAFlickCat = 2;
|
||||
protected const int IAEmptyCat = -1;
|
||||
protected const int IAPressCat = 0;
|
||||
protected const int IAReleaseCat = 1;
|
||||
protected const int IAPressingCat = 2;
|
||||
protected const int IAFlickCat = 3;
|
||||
|
||||
protected static bool IA_Empty(out double dt)
|
||||
{
|
||||
|
|
@ -67,6 +68,22 @@ namespace HeavenStudio.Games
|
|||
return PlayerInput.GetBatonUp(InputController.ActionsBaton.Face, out dt);
|
||||
}
|
||||
|
||||
protected static bool IA_PadBasicPressing(out double dt)
|
||||
{
|
||||
dt = 0;
|
||||
return PlayerInput.GetPad(InputController.ActionsPad.East);
|
||||
}
|
||||
protected static bool IA_TouchBasicPressing(out double dt)
|
||||
{
|
||||
dt = 0;
|
||||
return PlayerInput.GetTouch(InputController.ActionsTouch.Tap);
|
||||
}
|
||||
protected static bool IA_BatonBasicPressing(out double dt)
|
||||
{
|
||||
dt = 0;
|
||||
return PlayerInput.GetBaton(InputController.ActionsBaton.Face);
|
||||
}
|
||||
|
||||
protected static bool IA_TouchFlick(out double dt)
|
||||
{
|
||||
return PlayerInput.GetFlick(out dt);
|
||||
|
|
@ -76,14 +93,17 @@ namespace HeavenStudio.Games
|
|||
new("BasicPress", new int[] { IAPressCat, IAPressCat, IAPressCat },
|
||||
IA_PadBasicPress, IA_TouchBasicPress, IA_BatonBasicPress);
|
||||
public static PlayerInput.InputAction InputAction_BasicRelease =
|
||||
new("BasicPress", new int[] { IAReleaseCat, IAReleaseCat, IAReleaseCat },
|
||||
new("BasicRelease", new int[] { IAReleaseCat, IAReleaseCat, IAReleaseCat },
|
||||
IA_PadBasicRelease, IA_TouchBasicRelease, IA_BatonBasicRelease);
|
||||
public static PlayerInput.InputAction InputAction_BasicPressing =
|
||||
new("BasicRelease", new int[] { IAReleaseCat, IAReleaseCat, IAReleaseCat },
|
||||
IA_PadBasicPressing, IA_TouchBasicPressing, IA_BatonBasicPressing);
|
||||
|
||||
public static PlayerInput.InputAction InputAction_FlickPress =
|
||||
new("BasicPress", new int[] { IAPressCat, IAFlickCat, IAPressCat },
|
||||
new("FlickPress", new int[] { IAPressCat, IAFlickCat, IAPressCat },
|
||||
IA_PadBasicPress, IA_TouchFlick, IA_BatonBasicPress);
|
||||
public static PlayerInput.InputAction InputAction_FlickRelease =
|
||||
new("BasicPress", new int[] { IAReleaseCat, IAFlickCat, IAReleaseCat },
|
||||
new("FlickRelease", new int[] { IAReleaseCat, IAFlickCat, IAReleaseCat },
|
||||
IA_PadBasicRelease, IA_TouchFlick, IA_BatonBasicRelease);
|
||||
#endregion
|
||||
|
||||
|
|
@ -289,6 +309,7 @@ namespace HeavenStudio.Games
|
|||
{
|
||||
// ignore inputs that are for sequencing in autoplay
|
||||
if (toCompare.autoplayOnly) continue;
|
||||
if (toCompare.InputAction == null) continue;
|
||||
|
||||
if (closest == null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -134,6 +134,10 @@ namespace HeavenStudio.Games
|
|||
normalizedTime -= dt;
|
||||
if (IsExpectingInputNow())
|
||||
{
|
||||
if (InputAction != null)
|
||||
{
|
||||
Debug.Log("Hit " + InputAction.name);
|
||||
}
|
||||
double stateProg = ((normalizedTime - Minigame.JustEarlyTime()) / (Minigame.JustLateTime() - Minigame.JustEarlyTime()) - 0.5f) * 2;
|
||||
Hit(stateProg, normalizedTime);
|
||||
}
|
||||
|
|
@ -146,7 +150,8 @@ namespace HeavenStudio.Games
|
|||
|
||||
public void LateUpdate() {
|
||||
if (markForDeletion) {
|
||||
CleanUp();
|
||||
allEvents.Remove(this);
|
||||
OnDestroy(this);
|
||||
Destroy(this.gameObject);
|
||||
}
|
||||
foreach (PlayerActionEvent evt in allEvents)
|
||||
|
|
@ -166,7 +171,7 @@ namespace HeavenStudio.Games
|
|||
if (toCompare.InputAction == null) continue;
|
||||
int catIdx = (int)PlayerInput.CurrentControlStyle;
|
||||
if (toCompare.InputAction != null
|
||||
&& toCompare.InputAction.inputLockCategory[catIdx] == InputAction.inputLockCategory[catIdx]) continue;
|
||||
&& toCompare.InputAction.inputLockCategory[catIdx] != InputAction.inputLockCategory[catIdx]) continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -216,7 +221,6 @@ namespace HeavenStudio.Games
|
|||
}
|
||||
if (!enabled) return false;
|
||||
if (!isEligible) return false;
|
||||
if (markForDeletion) return false;
|
||||
|
||||
double normalizedBeat = GetNormalizedTime();
|
||||
return normalizedBeat > Minigame.NgEarlyTime() && normalizedBeat < Minigame.NgLateTime();
|
||||
|
|
@ -353,8 +357,6 @@ namespace HeavenStudio.Games
|
|||
public void CleanUp()
|
||||
{
|
||||
if (markForDeletion) return;
|
||||
allEvents.Remove(this);
|
||||
OnDestroy(this);
|
||||
markForDeletion = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -483,7 +483,7 @@ namespace HeavenStudio.Games
|
|||
});
|
||||
}
|
||||
|
||||
ScheduleInput(beat, 2f, InputType.STANDARD_DOWN, high ? JustLongHigh : JustLong, MissLong, Empty);
|
||||
ScheduleInput(beat, 2f, InputAction_BasicPress, high ? JustLongHigh : JustLong, MissLong, Empty);
|
||||
if (currentJumpIndex < allJumpEvents.Count)
|
||||
{
|
||||
if (currentJumpIndex >= 0)
|
||||
|
|
@ -542,7 +542,7 @@ namespace HeavenStudio.Games
|
|||
new MultiSound.Sound("seeSaw/otherVoiceLong2", beat + 1),
|
||||
});
|
||||
}
|
||||
ScheduleInput(beat, 2f, InputType.STANDARD_DOWN, high ? JustShortHigh : JustShort, MissShort, Empty);
|
||||
ScheduleInput(beat, 2f, InputAction_BasicPress, high ? JustShortHigh : JustShort, MissShort, Empty);
|
||||
if (currentJumpIndex < allJumpEvents.Count)
|
||||
{
|
||||
if (currentJumpIndex >= 0)
|
||||
|
|
@ -602,7 +602,7 @@ namespace HeavenStudio.Games
|
|||
new MultiSound.Sound("seeSaw/otherVoiceShort2", beat + 0.5f),
|
||||
});
|
||||
}
|
||||
ScheduleInput(beat, 1f, InputType.STANDARD_DOWN, high ? JustLongHigh : JustLong, MissLong, Empty);
|
||||
ScheduleInput(beat, 1f, InputAction_BasicPress, high ? JustLongHigh : JustLong, MissLong, Empty);
|
||||
if (currentJumpIndex < allJumpEvents.Count)
|
||||
{
|
||||
if (currentJumpIndex >= 0)
|
||||
|
|
@ -662,7 +662,7 @@ namespace HeavenStudio.Games
|
|||
new MultiSound.Sound("seeSaw/otherVoiceShort2", beat + 0.5f),
|
||||
});
|
||||
}
|
||||
ScheduleInput(beat, 1f, InputType.STANDARD_DOWN, high ? JustShortHigh : JustShort, MissShort, Empty);
|
||||
ScheduleInput(beat, 1f, InputAction_BasicPress, high ? JustShortHigh : JustShort, MissShort, Empty);
|
||||
if (currentJumpIndex < allJumpEvents.Count)
|
||||
{
|
||||
if (currentJumpIndex >= 0)
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ namespace HeavenStudio.Games
|
|||
var cond = Conductor.instance;
|
||||
if (cond.isPlaying && !cond.isPaused)
|
||||
{
|
||||
if (PlayerInput.Pressed() && !IsExpectingInputNow(InputType.STANDARD_DOWN) && hasArrowLoaded)
|
||||
if (PlayerInput.GetIsAction(InputAction_FlickPress, out _) && !IsExpectingInputNow(InputAction_FlickPress.inputLockCategory) && hasArrowLoaded)
|
||||
{
|
||||
WhiffArrow(cond.songPositionInBeatsAsDouble);
|
||||
}
|
||||
|
|
@ -189,11 +189,11 @@ namespace HeavenStudio.Games
|
|||
{
|
||||
if (slowDown)
|
||||
{
|
||||
ScheduleInput(beat, length * 7, InputType.STANDARD_DOWN, Just, Miss, Out);
|
||||
ScheduleInput(beat, length * 7, InputAction_FlickPress, Just, Miss, Out);
|
||||
}
|
||||
else
|
||||
{
|
||||
ScheduleInput(beat, length * 7, InputType.STANDARD_DOWN, JustNoSlowDown, Miss, Out);
|
||||
ScheduleInput(beat, length * 7, InputAction_FlickPress, JustNoSlowDown, Miss, Out);
|
||||
}
|
||||
BeatAction.New(instance, new List<BeatAction.Action>()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ namespace HeavenStudio.Games.Scripts_Spaceball
|
|||
|
||||
private void Start()
|
||||
{
|
||||
Spaceball.instance.ScheduleInput(startBeat, high ? 2f : 1f, InputType.STANDARD_DOWN, Just, Miss, Out);
|
||||
Spaceball.instance.ScheduleInput(startBeat, high ? 2f : 1f, Spaceball.InputAction_BasicPress, Just, Miss, Out);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ namespace HeavenStudio.Games.Scripts_Spaceball
|
|||
|
||||
private void Update()
|
||||
{
|
||||
if (PlayerInput.Pressed())
|
||||
if (PlayerInput.GetIsAction(Spaceball.InputAction_BasicPress, out _))
|
||||
{
|
||||
Swing(null);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -290,7 +290,8 @@ namespace HeavenStudio.InputSystem
|
|||
if (button < 0) return false;
|
||||
if (button is 0 or 1 or 2)
|
||||
{
|
||||
bool bt = Input.GetKeyUp((KeyCode)currentBindings.Touch[1]) || Input.GetKeyUp((KeyCode)currentBindings.Touch[2]);
|
||||
bool bt = (Input.GetKeyUp((KeyCode)currentBindings.Touch[1]) || Input.GetKeyUp((KeyCode)currentBindings.Touch[2]))
|
||||
&& !(Input.GetKey((KeyCode)currentBindings.Touch[1]) || Input.GetKey((KeyCode)currentBindings.Touch[2]));
|
||||
switch (button)
|
||||
{
|
||||
case 0:
|
||||
|
|
|
|||
|
|
@ -231,6 +231,20 @@ namespace HeavenStudio
|
|||
return false;
|
||||
}
|
||||
|
||||
public static bool GetIsAction(InputAction action)
|
||||
{
|
||||
switch (CurrentControlStyle)
|
||||
{
|
||||
case InputController.ControlStyles.Pad:
|
||||
return action.padAction(out _);
|
||||
case InputController.ControlStyles.Touch:
|
||||
return action.touchAction(out _);
|
||||
case InputController.ControlStyles.Baton:
|
||||
return action.batonAction(out _);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool GetPadDown(InputController.ActionsPad ac, out double dt)
|
||||
{
|
||||
bool a = GetInputController(1).GetActionDown(InputController.ControlStyles.Pad, (int)ac, out dt);
|
||||
|
|
|
|||
Loading…
Reference in a new issue