mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 08:07:38 +02:00
Camera flashes (bug associated with fullscreen)
This commit is contained in:
@ -146,7 +146,7 @@ namespace RhythmHeavenMania.Editor
|
||||
|
||||
private void SelectEvents()
|
||||
{
|
||||
if (!Input.GetKey(KeyCode.LeftShift) && !Timeline.instance.InteractingWithEvents() && !Timeline.instance.MouseInRectTransform(Editor.instance.eventSelectorBG)) Selections.instance.DeselectAll();
|
||||
if (!Input.GetKey(KeyCode.LeftShift) && !Timeline.instance.InteractingWithEvents() && Editor.instance.canSelect) Selections.instance.DeselectAll();
|
||||
|
||||
int selected = 0;
|
||||
|
||||
|
25
Assets/Scripts/LevelEditor/DisableSelectOnHover.cs
Normal file
25
Assets/Scripts/LevelEditor/DisableSelectOnHover.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
namespace RhythmHeavenMania.Editor
|
||||
{
|
||||
public class DisableSelectOnHover : MonoBehaviour
|
||||
{
|
||||
public EventParameterManager eventParameterManager;
|
||||
|
||||
// this is fucking retarded
|
||||
private void LateUpdate()
|
||||
{
|
||||
eventParameterManager.canDisable = true;
|
||||
for (int i = 0; i < transform.childCount; i++)
|
||||
{
|
||||
if (Editor.MouseInRectTransform(transform.GetChild(i).GetComponent<RectTransform>()))
|
||||
{
|
||||
eventParameterManager.canDisable = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/LevelEditor/DisableSelectOnHover.cs.meta
Normal file
11
Assets/Scripts/LevelEditor/DisableSelectOnHover.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c29b4f68c2b2e3849af4ab850c275cea
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -56,6 +56,7 @@ namespace RhythmHeavenMania.Editor
|
||||
private string remixName = "";
|
||||
private bool fullscreen;
|
||||
public bool discordDuringTesting = false;
|
||||
public bool canSelect = true;
|
||||
|
||||
public static Editor instance { get; private set; }
|
||||
|
||||
@ -63,6 +64,7 @@ namespace RhythmHeavenMania.Editor
|
||||
{
|
||||
instance = this;
|
||||
Initializer = GetComponent<Initializer>();
|
||||
canSelect = true;
|
||||
}
|
||||
|
||||
public void Init()
|
||||
@ -134,7 +136,7 @@ namespace RhythmHeavenMania.Editor
|
||||
}
|
||||
}
|
||||
|
||||
if (Timeline.instance.timelineState.selected)
|
||||
if (Timeline.instance.timelineState.selected && Editor.instance.canSelect)
|
||||
{
|
||||
if (Input.GetMouseButtonUp(0))
|
||||
{
|
||||
@ -408,5 +410,10 @@ namespace RhythmHeavenMania.Editor
|
||||
{
|
||||
GameEventSelectorTitle.text = txt;
|
||||
}
|
||||
|
||||
public static bool MouseInRectTransform(RectTransform rectTransform)
|
||||
{
|
||||
return (rectTransform.gameObject.activeSelf && RectTransformUtility.RectangleContainsScreenPoint(rectTransform, Input.mousePosition, Editor.instance.EditorCamera));
|
||||
}
|
||||
}
|
||||
}
|
@ -16,6 +16,7 @@ namespace RhythmHeavenMania.Editor
|
||||
[SerializeField] private GameObject IntegerP;
|
||||
[SerializeField] private GameObject FloatP;
|
||||
[SerializeField] private GameObject DropdownP;
|
||||
[SerializeField] private GameObject ColorP;
|
||||
|
||||
public Beatmap.Entity entity;
|
||||
|
||||
@ -23,6 +24,8 @@ namespace RhythmHeavenMania.Editor
|
||||
|
||||
private int childCountAtStart;
|
||||
|
||||
public bool canDisable = true;
|
||||
|
||||
public static EventParameterManager instance { get; set; }
|
||||
|
||||
private void Awake()
|
||||
@ -39,7 +42,7 @@ namespace RhythmHeavenMania.Editor
|
||||
{
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
if (!Timeline.instance.MouseInRectTransform(Editor.instance.eventSelectorBG) && active)
|
||||
if (canDisable && active)
|
||||
{
|
||||
Disable();
|
||||
}
|
||||
@ -107,6 +110,10 @@ namespace RhythmHeavenMania.Editor
|
||||
{
|
||||
prefab = DropdownP;
|
||||
}
|
||||
else if (objType == typeof(Color))
|
||||
{
|
||||
prefab = ColorP;
|
||||
}
|
||||
|
||||
GameObject input = Instantiate(prefab);
|
||||
input.transform.SetParent(this.gameObject.transform);
|
||||
|
@ -4,6 +4,7 @@ using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
using TMPro;
|
||||
using Starpelly;
|
||||
|
||||
using RhythmHeavenMania.Util;
|
||||
|
||||
@ -23,8 +24,14 @@ namespace RhythmHeavenMania.Editor
|
||||
[Space(10)]
|
||||
public TMP_Dropdown dropdown;
|
||||
|
||||
private string propertyName;
|
||||
[Header("Color")]
|
||||
[Space(10)]
|
||||
public Button ColorBTN;
|
||||
public RectTransform ColorTable;
|
||||
public bool colorTableActive;
|
||||
public ColorPreview colorPreview;
|
||||
|
||||
private string propertyName;
|
||||
|
||||
public void SetProperties(string propertyName, object type, string caption)
|
||||
{
|
||||
@ -97,6 +104,40 @@ namespace RhythmHeavenMania.Editor
|
||||
parameterManager.entity[propertyName] = (EasingFunction.Ease)dropdown.value;
|
||||
});
|
||||
}
|
||||
else if (objType == typeof(Color))
|
||||
{
|
||||
colorPreview.colorPicker.onColorChanged += delegate
|
||||
{
|
||||
parameterManager.entity[propertyName] = (Color)colorPreview.colorPicker.color;
|
||||
};
|
||||
|
||||
Color paramCol = (Color)parameterManager.entity[propertyName];
|
||||
|
||||
ColorBTN.onClick.AddListener(delegate
|
||||
{
|
||||
ColorTable.gameObject.SetActive(true);
|
||||
colorTableActive = true;
|
||||
colorPreview.ChangeColor(paramCol);
|
||||
});
|
||||
|
||||
colorPreview.ChangeColor(paramCol);
|
||||
ColorTable.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (colorTableActive)
|
||||
{
|
||||
if (!Editor.MouseInRectTransform(ColorTable))
|
||||
{
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
ColorTable.gameObject.SetActive(false);
|
||||
colorTableActive = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -244,7 +244,7 @@ namespace RhythmHeavenMania.Editor.Track
|
||||
}
|
||||
|
||||
|
||||
if (Input.GetMouseButton(1) && !Conductor.instance.isPlaying && MouseInRectTransform(TimelineGridSelect))
|
||||
if (Input.GetMouseButton(1) && !Conductor.instance.isPlaying && Editor.MouseInRectTransform(TimelineGridSelect))
|
||||
{
|
||||
movingPlayback = true;
|
||||
}
|
||||
@ -429,11 +429,6 @@ namespace RhythmHeavenMania.Editor.Track
|
||||
{
|
||||
return (this.gameObject.activeSelf && RectTransformUtility.RectangleContainsScreenPoint(TimelineContent.transform.parent.gameObject.GetComponent<RectTransform>(), Input.mousePosition, Editor.instance.EditorCamera));
|
||||
}
|
||||
|
||||
public bool MouseInRectTransform(RectTransform rectTransform)
|
||||
{
|
||||
return (rectTransform.gameObject.activeSelf && RectTransformUtility.RectangleContainsScreenPoint(rectTransform, Input.mousePosition, Editor.instance.EditorCamera));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Functions
|
||||
|
Reference in New Issue
Block a user