示例#1
0
        public static Type FindFirstTypeName(this Assembly assem, string typeName)
        {
            Type found = null;

            Type[] arrayOfTypes = null;
            try
            {
                arrayOfTypes = assem.GetTypes();
            }
            catch (Exception ex)
            {
                if (ex is ReflectionTypeLoadException)
                {
                    var typeLoadException = ex as ReflectionTypeLoadException;
                    DebugMore.WriteExceptions(typeLoadException.LoaderExceptions);
                    throw typeLoadException;
                }
                throw ex;
            }

            foreach (var typeItem in arrayOfTypes)
            {
                var simpleName = typeItem.Name;
                if (simpleName == typeName)
                {
                    found = typeItem;
                    break;
                }
            }

            return(found);
        }
示例#2
0
 void Update()
 {
     if (Input.GetMouseButtonDown(0))
     {
         Ray mouseRay = Camera.main.ScreenPointToRay(Input.mousePosition);
         if (Physics.Raycast(mouseRay, out RaycastHit raycastHit, 1000.0f /*,LayerMask.GetMask("Ground")*/))
         {
             DebugMore.DrawCross(raycastHit.point);
         }
     }
 }