Ejemplo n.º 1
0
 public void Add(UnityUIContentTemplate instance, RectTransform container)
 {
     if (container == null)
     {
         Debug.LogError("Quest Machine: Container isn't assigned to hold instance of UI template.", instance);
         return;
     }
     instance.gameObject.SetActive(true);
     instances.Add(instance);
     instance.transform.SetParent(container, false);
 }
        protected virtual IEnumerator TimedDespawn(UnityUIContentTemplate instance, float duration)
        {
            if (instance == null)
            {
                yield break;
            }
            yield return(new WaitForSeconds(duration));

            if (leaveLastContentVisibleDuringHide && contentManager.instancedContent.Count <= 1)
            {
                Hide();
            }
            else
            {
                contentManager.Remove(instance);
                if (contentManager.instancedContent.Count == 0)
                {
                    Hide();
                }
            }
        }
Ejemplo n.º 3
0
 public void Remove(UnityUIContentTemplate instance)
 {
     instances.Remove(instance);
     instance.Despawn();
 }
Ejemplo n.º 4
0
 public void AddInstanceToContainer(UnityUIContentTemplate instance)
 {
     instance.gameObject.SetActive(true);
     instances.Add(instance);
     instance.transform.SetParent(this.transform, false);
 }