Editor: Added Float type. Space Soccer: Added "swing" property to high-kick-toe event.

This commit is contained in:
Jenny Crowe
2022-02-06 01:28:14 -07:00
parent f376e30ee2
commit b5d3621051
8 changed files with 1041 additions and 16 deletions

View File

@ -2,6 +2,7 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using TMPro;
using Starpelly;
@ -79,6 +80,15 @@ namespace RhythmHeavenMania.Editor.Track
public static Timeline instance { get; private set; }
private bool userIsEditingInputField
{
get
{
var selectedGO = EventSystem.current.currentSelectedGameObject;
return selectedGO != null && (selectedGO.GetComponent<InputField>() != null || selectedGO.GetComponent<TMP_InputField>() != null);
}
}
#region Initializers
public void LoadRemix()
@ -273,15 +283,15 @@ namespace RhythmHeavenMania.Editor.Track
CurrentTempo.text = $" = {Conductor.instance.songBpm}";
if (Input.GetKeyDown(KeyCode.Alpha1))
if (Input.GetKeyDown(KeyCode.Alpha1) && !userIsEditingInputField)
{
timelineState.SetState(true, false, false);
}
else if (Input.GetKeyDown(KeyCode.Alpha2))
else if (Input.GetKeyDown(KeyCode.Alpha2) && !userIsEditingInputField)
{
timelineState.SetState(false, true, false);
}
else if (Input.GetKeyDown(KeyCode.Alpha3))
else if (Input.GetKeyDown(KeyCode.Alpha3) && !userIsEditingInputField)
{
timelineState.SetState(false, false, true);
}
@ -512,10 +522,16 @@ namespace RhythmHeavenMania.Editor.Track
for (int i = 0; i < ep.Count; i++)
{
object returnVal = ep[i].parameter;
if (ep[i].parameter.GetType() == typeof(EntityTypes.Integer))
var propertyType = returnVal.GetType();
if (propertyType == typeof(EntityTypes.Integer))
{
returnVal = ((EntityTypes.Integer)ep[i].parameter).val;
}
else if (propertyType == typeof(EntityTypes.Float))
{
returnVal = ((EntityTypes.Float)ep[i].parameter).val;
}
tempEntity[ep[i].propertyName] = returnVal;
}