1234567891011121314151617181920212223242526272829 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class SycnTransform : MonoBehaviour
- {
- public Transform obj;
- private Vector3 oldScale;
- private void Start()
- {
- oldScale = obj.localScale;
- }
- private void Update()
- {
- if(obj.eulerAngles!= transform.eulerAngles)
- {
- transform.eulerAngles = obj.eulerAngles;
- }
- if(oldScale!=obj.localScale)
- {
- transform.localScale += (obj.localScale - oldScale);
- oldScale = obj.localScale;
- }
-
- }
- }
|