Tanoda
EnableMovingChildren.cs
Go to the documentation of this file.
1using System.Collections;
2using System.Collections.Generic;
3using UnityEngine;
4
5public class EnableMovingChildren : MonoBehaviour
6{
7 public void EnableChildren()
8 {
9#if !UNITY_WEBGL
10 var childs = GetComponentsInChildren<ThrowableCanDisable>();
11 foreach (var throwableCanDisable in childs)
12 {
13 throwableCanDisable.enabled = true;
14 }
15#endif
16 }
17 public void DisableChildren()
18 {
19#if !UNITY_WEBGL
20 var childs = GetComponentsInChildren<ThrowableCanDisable>();
21 foreach (var throwableCanDisable in childs)
22 {
23 throwableCanDisable.enabled = false;
24 }
25#endif
26 }
27}