You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
695 B
34 lines
695 B
4 years ago
|
using AX.MessageSystem;
|
||
|
using System;
|
||
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
|
||
|
public class HideUIWhileClear : MonoBehaviour
|
||
|
{
|
||
|
|
||
|
// Use this for initialization
|
||
|
void Start()
|
||
|
{
|
||
|
MessageDispatcher.AddListener("ClearObject", HideUI);
|
||
|
}
|
||
|
|
||
|
private void HideUI(IMessage obj)
|
||
|
{
|
||
|
if (GetComponent<MultiSelectNAV>())
|
||
|
{
|
||
|
GetComponent<MultiSelectNAV>().Clear();
|
||
|
return;
|
||
|
}
|
||
|
if (gameObject.activeInHierarchy)
|
||
|
{
|
||
|
gameObject.SetActive(false);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private void OnDestroy()
|
||
|
{
|
||
|
MessageDispatcher.RemoveListener("ClearObject", HideUI);
|
||
|
}
|
||
|
}
|