/// <summary> /// Sets the visibility of the game object with a smooth fade in/out. /// </summary> /// <param name="isVisible"></param> public void SetVisibility(bool isVisible) { if (isVisible) { _controller.gameObject.SetActive(true); _controller.FadeToAlphaOverSeconds(1f, 0.5f); } else { _controller.FadeToAlphaOverSeconds(0f, 0.5f); _manager.StartCoroutine(SetVisibleAfterSeconds(false, 0.5f)); } }
/// <summary> /// Constructs the instance and sets the UI as a sibling of the transform passed. /// </summary> /// <param name="parent"></param> public MetaSensorUiController() { _controller = CreateMessageUi(); _manager = GameObject.FindObjectOfType <MetaManager>(); _controller.FadeToAlphaOverSeconds(0f, 0.01f); _controller.gameObject.SetActive(false); }