1
0
mirror of synced 2025-01-07 18:41:35 +01:00
WACVR/Assets/uWindowCapture/Samples/Horizontal Layout/UwcHorizontalLayouter.cs
2022-05-16 23:38:40 +02:00

30 lines
678 B
C#

using UnityEngine;
namespace uWindowCapture
{
[RequireComponent(typeof(UwcWindowTextureManager))]
public class UwcHorizontalLayouter : MonoBehaviour
{
UwcWindowTextureManager manager_;
void Awake()
{
manager_ = GetComponent<UwcWindowTextureManager>();
}
void Update()
{
var pos = Vector3.zero;
foreach (var kv in manager_.windows) {
var windowTexture = kv.Value;
var width = windowTexture.transform.localScale.x;
pos += new Vector3(width * 0.5f, 0f, 0f);
windowTexture.transform.localPosition = pos;
pos += new Vector3(width * 0.5f, 0f, 0f);
}
}
}
}