Exemplo n.º 1
0
 public static DynamicElement GetInstance()
 {
     if (instance == null)
     {
         instance = new DynamicElement();
     }
     return(instance);
 }
Exemplo n.º 2
0
 private void OnDisable()
 {
     if (!DynamicElement.GetInstance().inPlay)
     {
         foreach (KeyValuePair <string, List <Transform> > item in dicResType)
         {
             foreach (Transform itemChild in item.Value)
             {
                 itemChild.gameObject.SetActive(true);
             }
         }
     }
 }
Exemplo n.º 3
0
 public void SetTrackData(Track track, bool refresh = false, List <IndexData> _data = null, bool inPlay = true)
 {
     if (!refresh)
     {
         if (DynamicElement.GetInstance().exist)
         {
             foreach (Transform item in textParent)
             {
                 Destroy(item.gameObject);
             }
             numTemp = 1.8f;
         }
     }
     if (inPlay)
     {
         StartCoroutine(WaitTrack(track, refresh, _data));
     }
 }
Exemplo n.º 4
0
 public void Set(List <Transform> listEntitys)
 {
     foreach (KeyValuePair <string, List <Transform> > item in dicResType)
     {
         foreach (Transform itemValue in item.Value)
         {
             if (!listEntitys.Contains(itemValue))
             {
                 foreach (Transform itemChild in textParent)
                 {
                     Destroy(itemChild.gameObject);
                 }
             }
         }
     }
     dicResType.Clear();
     foreach (Transform item in listEntitys)
     {
         item.GetComponent <ElementItem>().arrayTrans = transform;
         if ((DynamicElement.GetInstance().exist&& DynamicElement.GetInstance().inPlay) || !DynamicElement.GetInstance().inPlay)
         {
             if (!gameObject.activeInHierarchy)
             {
                 item.gameObject.SetActive(true);
             }
         }
         if (dicResType.ContainsKey(item.GetComponent <ElementItem>().t_eType))
         {
             dicResType[item.GetComponent <ElementItem>().t_eType].Add(item);
         }
         else
         {
             List <Transform> listTemp = new List <Transform>();
             listTemp.Add(item);
             dicResType.Add(item.GetComponent <ElementItem>().t_eType, listTemp);
         }
     }
     if (gameObject.activeInHierarchy)
     {
         StartCoroutine(wait());
     }
 }
Exemplo n.º 5
0
 private void Awake()
 {
     instance = this;
 }