protected void OnCollisionEnter2D(Collision2D _other) { if (_other.gameObject.CompareTag("Alien")) { return; } SoundManager.Instance.PlaySoundInPosition(transform.position, crashSound, 0.1f); destructionComponent.AutoDestroyObject(); }
public override void OnInspectorGUI() { DrawDefaultInspector(); EditorGUILayout.Separator(); AutoDestroy autoDestroy = target as AutoDestroy; if (GUILayout.Button("Auto Destroy")) { autoDestroy.AutoDestroyObject(); } }
public void TakeDamage() { destroyComponent.AutoDestroyObject(); }