mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-12-05 07:47:30 +00:00
495cc5ad4c
* Spaceball cleanup and small bug fix * Replace old hit sound in spaceball * Camera filters * added 9 new filters, including 3 types of sepia * oops * remark * normalization of fade out and fade in on filters are by 100 * GenerateFilterTypeEnum comments * Pure black and white filter * Zooming * Constant playback bar offset * Prepare box selector rewrite * Update icons, finalize
32 lines
858 B
C#
32 lines
858 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace HeavenStudio.Editor.Track
|
|
{
|
|
public class KeepSizeRelativeToContent : MonoBehaviour
|
|
{
|
|
private RectTransform rectTransform;
|
|
|
|
public float sizeDeltaXInternal;
|
|
|
|
public float sizeDeltaX = 1.0f;
|
|
public float multiply;
|
|
|
|
private void Start()
|
|
{
|
|
rectTransform = GetComponent<RectTransform>();
|
|
SetScale(Timeline.instance.TimelineContent.localScale.x);
|
|
}
|
|
|
|
private void LateUpdate()
|
|
{
|
|
SetScale(Timeline.instance.TimelineContent.localScale.x);
|
|
}
|
|
|
|
private void SetScale(float scale)
|
|
{
|
|
rectTransform.localScale = new Vector3((1.0f / scale) * multiply, transform.localScale.y, 1);
|
|
LayoutRebuilder.ForceRebuildLayoutImmediate(rectTransform);
|
|
}
|
|
}
|
|
}
|