Ejemplo n.º 1
0
		public void Reveal(bool immediate = false, VisibilityEvent.OnceEventHandler handler = null)
		{
			if (handler != null)
			{
				RevealedEvent.EventTriggered += handler;
			}

			OnAppearing();
			if (immediate || BindingContext.IsRevealed)
			{
				OnVisible();
			}
			else
			{
				GetComponent<Animator>().SetTrigger("Show");
			}
		}
Ejemplo n.º 2
0
		public void Hide(bool immediate = false, VisibilityEvent.OnceEventHandler handler = null)
		{
			if (handler != null)
			{
				HiddenEvent.EventTriggered += handler;
			}

			OnDisappearing();
			if (immediate || !BindingContext.IsRevealed)
			{
				OnHidden();
			}
			else
			{
				GetComponent<Animator>().SetTrigger("Hide");
			}
		}
Ejemplo n.º 3
0
    public void Awake()
    {
        _root = transform.GetChild(0);
        _root.gameObject.SetActive(false);

        _visibilityEvent = GetComponent <VisibilityEvent>();

        _visibilityEvent.OnVisible += () =>
        {
            StartCoroutine(TurnOn());
        };

        _visibilityEvent.OnInvisible += () =>
        {
            StartCoroutine(TurnOff());
        };
    }
Ejemplo n.º 4
0
		public void Reveal(bool immediate = false, VisibilityEvent.OnceEventHandler handler = null)
		{
			if (handler != null)
			{
				RevealedEvent.EventTriggered += handler;
			}

			OnAppearing();
			if (immediate || BindingContext.IsRevealed)
			{
				OnVisible();
			}
			else
			{
                SceneService.Instance.LoadScene(sceneName, true, (bool success, string error) =>
                {
                    IsLoaded = true;
                    OnVisible();
                });
			}
		}