XRoom_Unity/Assets/ScaleCon.cs

22 lines
483 B
C#
Raw Normal View History

2025-05-31 06:50:20 +00:00
using UnityEngine;
public class ScaleCon : MonoBehaviour
{
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
size = transform.localScale;
realParent = transform.parent;
}
public Vector3 size;
public Transform realParent;
// Update is called once per frame
void Update()
{
if(transform.parent== realParent)
transform.localScale = size;
}
}