Merge branch 'megaminerjenny:master' into karate-man-event-merging

This commit is contained in:
Carson Kompon 2022-03-01 12:23:25 -05:00 committed by GitHub
commit 3f84054779
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 48 additions and 14 deletions

View file

@ -473,8 +473,8 @@ TextureImporter:
y: 248
width: 48
height: 68
alignment: 0
pivot: {x: 0.5, y: 0.5}
alignment: 9
pivot: {x: 0.5, y: 0.5441176}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
@ -494,8 +494,8 @@ TextureImporter:
y: 248
width: 49
height: 68
alignment: 0
pivot: {x: 0.5, y: 0.5}
alignment: 9
pivot: {x: 0.5, y: 0.4852941}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
@ -1230,7 +1230,7 @@ TextureImporter:
width: 49
height: 48
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
@ -1251,7 +1251,7 @@ TextureImporter:
width: 65
height: 68
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []

View file

@ -25,6 +25,7 @@ namespace RhythmHeavenMania
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public float valA;
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public float valB;
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public float valC;
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public bool toggle;
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public int type;
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public int type2;
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public EasingFunction.Ease ease;

View file

@ -36,6 +36,7 @@ namespace RhythmHeavenMania
public float startBeat;
[NonSerialized] public GameObject currentGameO;
public bool autoplay;
public bool canInput = true;
public event Action<float> onBeatChanged;
@ -195,10 +196,16 @@ namespace RhythmHeavenMania
}
}
public void ToggleInputs(bool inputs)
{
canInput = inputs;
}
#region Play Events
public void Play(float beat)
{
canInput = true;
StartCoroutine(PlayCo(beat));
onBeatChanged?.Invoke(beat);
}

View file

@ -33,7 +33,7 @@ namespace RhythmHeavenMania.Games
{
if (aceTimes == 0)
{
if (triggersAutoplay && (GameManager.instance.autoplay || autoPlay) && normalizedBeat > 0.99f)
if (triggersAutoplay && (GameManager.instance.autoplay || autoPlay) && GameManager.instance.canInput && normalizedBeat > 0.99f)
{
OnAce();
if (!autoPlay)

View file

@ -358,7 +358,7 @@ namespace RhythmHeavenMania.Games.SpaceSoccer
private void CheckIfFall(float normalizedBeat)
{
if (normalizedBeat > Minigame.LateTime() && !GameManager.instance.autoplay)
if (normalizedBeat > Minigame.LateTime() && (!GameManager.instance.autoplay || !GameManager.instance.canInput))
{
Jukebox.PlayOneShotGame("spaceSoccer/missNeutral");
ball = null;

View file

@ -15,6 +15,7 @@ namespace RhythmHeavenMania.Editor
[Header("Property Prefabs")]
[SerializeField] private GameObject IntegerP;
[SerializeField] private GameObject FloatP;
[SerializeField] private GameObject BooleanP;
[SerializeField] private GameObject DropdownP;
[SerializeField] private GameObject ColorP;
@ -106,6 +107,10 @@ namespace RhythmHeavenMania.Editor
{
prefab = FloatP;
}
else if(type is bool)
{
prefab = BooleanP;
}
else if (objType.IsEnum)
{
prefab = DropdownP;

View file

@ -21,6 +21,10 @@ namespace RhythmHeavenMania.Editor
public Slider slider;
public TMP_InputField inputField;
[Header("Boolean")]
[Space(10)]
public Toggle toggle;
[Header("Dropdown")]
[Space(10)]
public TMP_Dropdown dropdown;
@ -86,6 +90,15 @@ namespace RhythmHeavenMania.Editor
parameterManager.entity[propertyName] = slider.value;
});
}
else if(type is bool)
{
toggle.isOn = (bool)type;
toggle.onValueChanged.AddListener(delegate
{
parameterManager.entity[propertyName] = toggle.isOn;
});
}
else if (objType.IsEnum)
{
List<TMP_Dropdown.OptionData> dropDownData = new List<TMP_Dropdown.OptionData>();

View file

@ -111,6 +111,13 @@ namespace RhythmHeavenMania
new Param("valB", new EntityTypes.Float(0, 1, 0), "End Opacity"),
new Param("ease", EasingFunction.Ease.Linear, "Ease")
} ),
new GameAction("toggle inputs", delegate
{
GameManager.instance.ToggleInputs(eventCaller.currentEntity.toggle);
}, 0.5f, true, new List<Param>()
{
new Param("toggle", true, "Enable Inputs")
}),
}),
new Minigame("countIn", "Count-Ins", "", false, true, new List<GameAction>()
{

View file

@ -6,38 +6,39 @@ namespace RhythmHeavenMania
{
public class PlayerInput
{
public static bool Pressed(bool includeDPad = false)
{
bool keyDown = Input.GetKeyDown(KeyCode.Z) || (includeDPad && GetAnyDirectionDown());
return keyDown && !GameManager.instance.autoplay && Conductor.instance.isPlaying;
return keyDown && !GameManager.instance.autoplay && Conductor.instance.isPlaying && GameManager.instance.canInput ;
}
public static bool PressedUp(bool includeDPad = false)
{
bool keyUp = Input.GetKeyUp(KeyCode.Z) || (includeDPad && GetAnyDirectionUp());
return keyUp && !GameManager.instance.autoplay && Conductor.instance.isPlaying;
return keyUp && !GameManager.instance.autoplay && Conductor.instance.isPlaying && GameManager.instance.canInput;
}
public static bool Pressing(bool includeDPad = false)
{
bool pressing = Input.GetKey(KeyCode.Z) || (includeDPad && GetAnyDirection());
return pressing && !GameManager.instance.autoplay && Conductor.instance.isPlaying;
return pressing && !GameManager.instance.autoplay && Conductor.instance.isPlaying && GameManager.instance.canInput;
}
public static bool AltPressed()
{
return Input.GetKeyDown(KeyCode.X) && !GameManager.instance.autoplay && Conductor.instance.isPlaying;
return Input.GetKeyDown(KeyCode.X) && !GameManager.instance.autoplay && Conductor.instance.isPlaying && GameManager.instance.canInput;
}
public static bool AltPressedUp()
{
return Input.GetKeyUp(KeyCode.X) && !GameManager.instance.autoplay && Conductor.instance.isPlaying;
return Input.GetKeyUp(KeyCode.X) && !GameManager.instance.autoplay && Conductor.instance.isPlaying && GameManager.instance.canInput;
}
public static bool AltPressing()
{
return Input.GetKey(KeyCode.X) && !GameManager.instance.autoplay && Conductor.instance.isPlaying;
return Input.GetKey(KeyCode.X) && !GameManager.instance.autoplay && Conductor.instance.isPlaying && GameManager.instance.canInput;
}
public static bool GetAnyDirectionDown()