22 lines
435 B
C#
22 lines
435 B
C#
using UnityEngine;
|
|
|
|
public class Gridtester : MonoBehaviour
|
|
{
|
|
[SerializeField] RectTransform t1, t2;
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
if (Input.GetKeyDown(KeyCode.Space))
|
|
{
|
|
Recalc();
|
|
}
|
|
}
|
|
|
|
private void Recalc()
|
|
{
|
|
t1.position = transform.GetChild(0).position;
|
|
t2.position = transform.GetChild(transform.childCount-1).position;
|
|
}
|
|
}
|