29 lines
564 B
C#
29 lines
564 B
C#
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
|
||
|
public class DisableAfterFinish : MonoBehaviour
|
||
|
{
|
||
|
private DisableAfterFinishController disableController;
|
||
|
|
||
|
private void Awake()
|
||
|
{
|
||
|
disableController = FindObjectOfType<DisableAfterFinishController>();
|
||
|
}
|
||
|
|
||
|
private void OnEnable()
|
||
|
{
|
||
|
disableController.DoDisable += Disable;
|
||
|
}
|
||
|
|
||
|
private void OnDisable()
|
||
|
{
|
||
|
disableController.DoDisable -= Disable;
|
||
|
}
|
||
|
|
||
|
private void Disable()
|
||
|
{
|
||
|
gameObject.SetActive(false);
|
||
|
}
|
||
|
}
|