mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-13 02:37:38 +02:00
Play Mode Features Part 1 (#413)
* add pause menu assets * layout and animation for pause * make play mode prefab function re-assign unused class inheritance * remove filepath * don't init medals twice * remove PlayerActionObject * initial attempt at anti-note lock TODO: circumvent inputs clearing themselves making the functionality not work * properly implement input lock prevention * fix error on editor open * functional pause menu * bugfix * make unpausing not reset current play statistics * serialize initializer components in inspector instead of procedurally generating * sanity check * note for fade * make flashes in the camera prefabs instead of in world space remove / reorganize script files address issue #411 * fix bug with perfect campaign make minigame transitions hide the game canvas adjust animation of the song credits textbox * fully functional intro scene (placeholder for future title screen) refactored entire game loading procedure re-organized some files * add interaction query to disclaimer text * reword legal * anchor section medals to section display more tempo change placement controls * operation order bugfix * prep for future ratings and stats * loading text * autoload opening scene * splash screen adjustments added setting to force enable splash screen * adjust setting entry
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
using HeavenStudio.Util;
|
||||
using System.Linq;
|
||||
@ -9,49 +11,40 @@ namespace HeavenStudio.Games.Global
|
||||
{
|
||||
public class Flash : MonoBehaviour
|
||||
{
|
||||
public float startBeat;
|
||||
public float length;
|
||||
[NonSerialized] public float startBeat;
|
||||
[NonSerialized] public float length;
|
||||
|
||||
public Color startColor;
|
||||
public Color endColor;
|
||||
[NonSerialized] public Color startColor;
|
||||
[NonSerialized] public Color endColor;
|
||||
|
||||
public EasingFunction.Ease ease;
|
||||
private EasingFunction.Function func;
|
||||
[NonSerialized] public EasingFunction.Ease ease;
|
||||
[NonSerialized] private EasingFunction.Function func;
|
||||
|
||||
private SpriteRenderer spriteRenderer;
|
||||
[NonSerialized] private Image spriteRenderer;
|
||||
|
||||
[SerializeField] private Color currentCol;
|
||||
|
||||
private List<DynamicBeatmap.DynamicEntity> allFadeEvents = new List<DynamicBeatmap.DynamicEntity>();
|
||||
[NonSerialized] private List<DynamicBeatmap.DynamicEntity> allFadeEvents = new List<DynamicBeatmap.DynamicEntity>();
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
this.gameObject.transform.SetParent(GameManager.instance.gameObject.transform);
|
||||
gameObject.layer = LayerMask.NameToLayer("Flash");
|
||||
this.gameObject.transform.localScale = new Vector3(1, 1);
|
||||
|
||||
spriteRenderer = this.gameObject.AddComponent<SpriteRenderer>();
|
||||
|
||||
spriteRenderer.color = startColor;
|
||||
spriteRenderer.sortingOrder = 30001;
|
||||
spriteRenderer.sprite = Resources.Load<Sprite>("Sprites/GeneralPurpose/Square");
|
||||
|
||||
spriteRenderer = GetComponent<Image>();
|
||||
spriteRenderer.color = currentCol;
|
||||
func = EasingFunction.GetEasingFunction(EasingFunction.Ease.Linear);
|
||||
|
||||
GameManager.instance.onBeatChanged += OnBeatChanged;
|
||||
}
|
||||
|
||||
public void OnBeatChanged(float beat)
|
||||
{
|
||||
allFadeEvents = EventCaller.GetAllInGameManagerList("vfx", new string[] { "flash" });
|
||||
Test(beat);
|
||||
|
||||
// backwards-compatibility baybee
|
||||
allFadeEvents.AddRange(EventCaller.GetAllInGameManagerList("gameManager", new string[] { "flash" }));
|
||||
Test(beat);
|
||||
allFadeEvents.Sort((x, y) => x.beat.CompareTo(y.beat));
|
||||
|
||||
FindFadeFromBeat(beat);
|
||||
}
|
||||
|
||||
private void Test(float beat)
|
||||
private void FindFadeFromBeat(float beat)
|
||||
{
|
||||
Color startCol = Color.white;
|
||||
Color endCol = Color.white;
|
||||
@ -105,7 +98,7 @@ namespace HeavenStudio.Games.Global
|
||||
|
||||
private void Update()
|
||||
{
|
||||
Test(Conductor.instance.songPositionInBeats);
|
||||
FindFadeFromBeat(Conductor.instance.songPositionInBeats);
|
||||
float normalizedBeat = Conductor.instance.GetPositionFromBeat(startBeat, length);
|
||||
// normalizedBeat = Mathf.Clamp01(normalizedBeat);
|
||||
|
||||
|
@ -32,7 +32,7 @@ namespace HeavenStudio.Games.Global
|
||||
private List<DynamicBeatmap.DynamicEntity> idolEvents = new List<DynamicBeatmap.DynamicEntity>();
|
||||
private List<DynamicBeatmap.DynamicEntity> closedCaptionsEvents = new List<DynamicBeatmap.DynamicEntity>();
|
||||
|
||||
Textbox instance;
|
||||
public static Textbox instance { get; private set; }
|
||||
|
||||
[Header("Objects")]
|
||||
public GameObject TextboxEnabler;
|
||||
|
Reference in New Issue
Block a user