예제 #1
0
 static CZTypeFactory()
 {
     foreach (var type in Utility_Reflection.GetChildrenTypes <ICZType>())
     {
         if (!type.IsGenericType && !type.IsAbstract)
         {
             TypeCreator[type] = () => { return(Activator.CreateInstance(type) as ICZType); }
         }
         ;
     }
 }
예제 #2
0
 protected virtual IEnumerable <Type> GetNodeTypes()
 {
     foreach (var type in Utility_Reflection.GetChildrenTypes <BaseNode>())
     {
         if (type.IsAbstract)
         {
             continue;
         }
         Debug.Log(type.Name);
         yield return(type);
     }
 }
 static GraphProcessorCache()
 {
     portCache = new Dictionary <Type, List <NodePort> >();
     foreach (var nodeType in Utility_Reflection.GetChildrenTypes <BaseNode>())
     {
         if (nodeType.IsAbstract)
         {
             continue;
         }
         CachePorts(nodeType);
     }
 }
 static TimelineLiteObject()
 {
     ActionDataDict = new Dictionary <Type, Type>();
     foreach (var actionType in Utility_Reflection.GetChildrenTypes <ITLAction>())
     {
         if (actionType.IsGenericType || actionType.IsAbstract)
         {
             continue;
         }
         Type actionDataType = actionType.GetProperty("TActionData",
                                                      BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Public).PropertyType;
         ActionDataDict[actionDataType] = actionType;
     }
 }
예제 #5
0
 public ConversationManager()
 {
     if (CommandResolverTypeCache == null)
     {
         CommandResolverTypeCache = new Dictionary <string, Type>();
         foreach (var type in Utility_Reflection.GetChildrenTypes <IConversationCommand>())
         {
             if (Utility_Attribute.TryGetTypeAttribute(type, out CommandNameAttribute attribute))
             {
                 CommandResolverTypeCache[attribute.commandText] = type;
             }
         }
     }
 }
예제 #6
0
 protected override IEnumerable <Type> GetNodeTypes()
 {
     foreach (var type in Utility_Reflection.GetChildrenTypes <GOAPAction>())
     {
         if (type.IsAbstract)
         {
             continue;
         }
         yield return(type);
     }
     foreach (var type in Utility_Reflection.GetChildrenTypes <GOAPActionEvtNode>())
     {
         if (type.IsAbstract)
         {
             continue;
         }
         yield return(type);
     }
 }