mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 07:57:38 +02:00
Spaceball camera easings
This commit is contained in:
@ -53,7 +53,7 @@ namespace RhythmHeavenMania.Editor
|
||||
private bool changedMusic = false;
|
||||
private bool loadedMusic = false;
|
||||
private string currentRemixPath = "";
|
||||
private int lastEditorObjectsCount = 0;
|
||||
private string remixName = "";
|
||||
private bool fullscreen;
|
||||
public bool discordDuringTesting = false;
|
||||
|
||||
@ -176,13 +176,6 @@ namespace RhythmHeavenMania.Editor
|
||||
}
|
||||
}
|
||||
|
||||
if (lastEditorObjectsCount != GameManager.instance.BeatmapEntities())
|
||||
{
|
||||
UpdateEditorStatus(false);
|
||||
}
|
||||
|
||||
lastEditorObjectsCount = GameManager.instance.BeatmapEntities();
|
||||
|
||||
if (Application.isEditor)
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.S))
|
||||
@ -308,6 +301,9 @@ namespace RhythmHeavenMania.Editor
|
||||
zipStream.Write(bytes, 0, bytes.Length);
|
||||
}
|
||||
}
|
||||
|
||||
currentRemixPath = path;
|
||||
UpdateEditorStatus(false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -364,6 +360,8 @@ namespace RhythmHeavenMania.Editor
|
||||
}
|
||||
|
||||
currentRemixPath = path;
|
||||
remixName = Path.GetFileName(path);
|
||||
UpdateEditorStatus(false);
|
||||
CommandManager.instance.Clear();
|
||||
}
|
||||
});
|
||||
@ -394,7 +392,7 @@ namespace RhythmHeavenMania.Editor
|
||||
private void UpdateEditorStatus(bool updateTime)
|
||||
{
|
||||
if (discordDuringTesting || !Application.isEditor)
|
||||
DiscordRPC.DiscordRPC.UpdateActivity("In Editor", $"Objects: {GameManager.instance.Beatmap.entities.Count + GameManager.instance.Beatmap.tempoChanges.Count}", updateTime);
|
||||
DiscordRPC.DiscordRPC.UpdateActivity("In Editor", $"{remixName}", updateTime);
|
||||
}
|
||||
|
||||
public string GetJson()
|
||||
|
@ -14,6 +14,7 @@ namespace RhythmHeavenMania.Editor
|
||||
|
||||
[Header("Property Prefabs")]
|
||||
[SerializeField] private GameObject IntegerP;
|
||||
[SerializeField] private GameObject DropdownP;
|
||||
|
||||
public Beatmap.Entity entity;
|
||||
|
||||
@ -88,6 +89,10 @@ namespace RhythmHeavenMania.Editor
|
||||
{
|
||||
prefab = IntegerP;
|
||||
}
|
||||
else if (type.GetType() == typeof(RhythmHeavenMania.Util.EasingFunction.Ease))
|
||||
{
|
||||
prefab = DropdownP;
|
||||
}
|
||||
|
||||
GameObject input = Instantiate(prefab);
|
||||
input.transform.SetParent(this.gameObject.transform);
|
||||
@ -101,7 +106,7 @@ namespace RhythmHeavenMania.Editor
|
||||
private void DestroyParams()
|
||||
{
|
||||
active = false;
|
||||
for (int i = 1; i < transform.childCount; i++)
|
||||
for (int i = 2; i < transform.childCount; i++)
|
||||
{
|
||||
Destroy(transform.GetChild(i).gameObject);
|
||||
}
|
||||
|
@ -5,39 +5,68 @@ using UnityEngine.UI;
|
||||
|
||||
using TMPro;
|
||||
|
||||
using RhythmHeavenMania.Util;
|
||||
|
||||
namespace RhythmHeavenMania.Editor
|
||||
{
|
||||
public class EventPropertyPrefab : MonoBehaviour
|
||||
{
|
||||
public TMP_Text caption;
|
||||
[SerializeField] private EventParameterManager parameterManager;
|
||||
|
||||
[Header("Integer and Float")]
|
||||
[Space(10)]
|
||||
public Slider slider;
|
||||
public TMP_InputField inputField;
|
||||
|
||||
[Header("Dropdown")]
|
||||
[Space(10)]
|
||||
public TMP_Dropdown dropdown;
|
||||
|
||||
private string propertyName;
|
||||
|
||||
[SerializeField] private EventParameterManager parameterManager;
|
||||
|
||||
public void SetProperties(string propertyName, object type, string caption)
|
||||
{
|
||||
this.propertyName = propertyName;
|
||||
this.caption.text = caption;
|
||||
|
||||
var integer = ((EntityTypes.Integer)type);
|
||||
if (type.GetType() == typeof(EntityTypes.Integer))
|
||||
{
|
||||
var integer = ((EntityTypes.Integer)type);
|
||||
|
||||
slider.minValue = integer.min;
|
||||
slider.maxValue = integer.max;
|
||||
slider.minValue = integer.min;
|
||||
slider.maxValue = integer.max;
|
||||
|
||||
slider.value = Mathf.RoundToInt(System.Convert.ToSingle(parameterManager.entity[propertyName]));
|
||||
inputField.text = slider.value.ToString();
|
||||
slider.value = Mathf.RoundToInt(System.Convert.ToSingle(parameterManager.entity[propertyName]));
|
||||
inputField.text = slider.value.ToString();
|
||||
|
||||
slider.onValueChanged.AddListener(delegate { TestChange(); });
|
||||
}
|
||||
slider.onValueChanged.AddListener(delegate
|
||||
{
|
||||
inputField.text = slider.value.ToString();
|
||||
parameterManager.entity[propertyName] = (int)slider.value;
|
||||
});
|
||||
}
|
||||
else if (type.GetType() == typeof(EasingFunction.Ease))
|
||||
{
|
||||
List<TMP_Dropdown.OptionData> dropDownData = new List<TMP_Dropdown.OptionData>();
|
||||
for (int i = 0; i < System.Enum.GetValues(typeof(EasingFunction.Ease)).Length; i++)
|
||||
{
|
||||
string name = System.Enum.GetNames(typeof(EasingFunction.Ease))[i];
|
||||
TMP_Dropdown.OptionData optionData = new TMP_Dropdown.OptionData();
|
||||
|
||||
public void TestChange()
|
||||
{
|
||||
print("bru");
|
||||
inputField.text = slider.value.ToString();
|
||||
parameterManager.entity[propertyName] = (int)slider.value;
|
||||
optionData.text = name;
|
||||
|
||||
dropDownData.Add(optionData);
|
||||
}
|
||||
dropdown.AddOptions(dropDownData);
|
||||
dropdown.value = ((int)(EasingFunction.Ease)parameterManager.entity[propertyName]);
|
||||
|
||||
dropdown.onValueChanged.AddListener(delegate
|
||||
{
|
||||
parameterManager.entity[propertyName] = (EasingFunction.Ease)dropdown.value;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user