public void SwitchTo(Enum name, SetActiveOptions options = null)
 {
     CurrentView = name;
     //Debug.Log($"Switch to {CurrentView}");
     if (_lastView != name)
     {
         Views.Where(v => v.ViewType == ViewType.Window).ToList().ForEach(v => v.SetActive(v.ViewName.Equals(name), options));
         if (Views.Exists(v => v.ViewName.Equals(name)))
         {
             _lastView = name;
         }
     }
 }
 public void SetActive(bool active, SetActiveOptions options = null)
 {
     if (active)
     {
         gameObject.SetActive(true);
         OnShow(options);
         _lateShowCoroutine = StartCoroutine(CallOnShowLate());
     }
     else
     {
         gameObject.SetActive(false);
         OnHide(options);
         if (_lateShowCoroutine != null)
         {
             StopCoroutine(_lateShowCoroutine);
         }
     }
 }
예제 #3
0
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //Message from GameManager
    void SetActivePlayer(SetActiveOptions options)
    {
        if(!bGoalReached)
        {
            isActive = options.bSetActive;

            if(!bConcept)
            {
                if(options.bPlayAudio && isActive)
                    PlaySound(2);

                if(!isActive && animation_child)
                    animation_child.Play("idle");

                /*
                if(isActive)
                    mat_child.color = Color.white;
                else
                    mat_child.color = Color.grey;
                */
            }
        }
    }
 public virtual void OnHide(SetActiveOptions options = null)
 {
 }
 public virtual void OnShow(SetActiveOptions options = null)
 {
 }
        public void HidePanel(Enum name, SetActiveOptions options = null)
        {
            var view = GetView(name);

            view.SetActive(false, options);
        }
        public void ShowPanel(Enum name, SetActiveOptions options = null)
        {
            var view = GetView(name);

            view.SetActive(true, options);
        }