22 lines
592 B
C#
22 lines
592 B
C#
using UnityEngine;
|
|
|
|
public class DeactivateAmplifyMotion : MonoBehaviour
|
|
{
|
|
public bool withChildren = true;
|
|
|
|
private void Start()
|
|
{
|
|
AmplifyMotionObjectBase[] array = null;
|
|
array = ((!withChildren) ? GetComponents<AmplifyMotionObjectBase>() : GetComponentsInChildren<AmplifyMotionObjectBase>(true));
|
|
if (array != null)
|
|
{
|
|
AmplifyMotionObjectBase[] array2 = array;
|
|
foreach (AmplifyMotionObjectBase amplifyMotionObjectBase in array2)
|
|
{
|
|
AmplifyMotionEffect.Instance.Unregister(amplifyMotionObjectBase.gameObject);
|
|
amplifyMotionObjectBase.enabled = false;
|
|
}
|
|
}
|
|
}
|
|
}
|