12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class DisplaceAll : MonoBehaviour
- {
-
- public GameObject objects1;
- public GameObject objects2;
- public GameObject objects3;
- // Start is called before the first frame update
- void Start()
- {
-
- }
- // Update is called once per frame
- void Update()
- {
-
- }
- public void displaceAll()
- {
- Transform[] children = this.objects1.GetComponentsInChildren<Transform>(true);
- Transform[] children2 = this.objects2.GetComponentsInChildren<Transform>(true);
- Transform[] children3 = this.objects3.GetComponentsInChildren<Transform>(true);
- foreach(Transform ch in children)
- {
- if(ch.gameObject.name.Contains("QR") && !ch.gameObject.name.Contains("AA"))
- ch.position = new Vector3(0.0f, 10000.0f, 0.0f);
- }
- foreach(Transform ch in children2)
- {
- if(ch.gameObject.name.Contains("QR") && !ch.gameObject.name.Contains("AA"))
- ch.position = new Vector3(0.0f, 10000.0f, 0.0f);
- }
- foreach(Transform ch in children3)
- {
- if(ch.gameObject.name.Contains("QR") && !ch.gameObject.name.Contains("AA"))
- ch.position = new Vector3(0.0f, 10000.0f, 0.0f);
- }
- }
- }
|