예제 #1
0
 /// <summary>
 /// 清空引用 释放内存
 /// </summary>
 public void Clear()
 {
     try
     {
         cop = null;
     }
     catch (Exception)
     {
     }
 }
예제 #2
0
 private void InitComponent()
 {
     System.Type classType = this.GetType();
     FieldInfo[] fields    = classType.GetFields();
     foreach (FieldInfo item in fields)
     {
         string name = StringUtil.ToUpper(item.Name, 0, 1);
         if (transform.Find(name) != null)
         {
             if (transform.Find(name).GetComponent <GUIComponentBase>() != null)
             {
                 cop = transform.Find(name).GetComponent <GUIComponentBase>();
                 item.SetValue(this, cop);
             }
         }
     }
 }