public TextureNode ReadTextureNode() { // Get the type: int type = (int)ReadCompressed(); if (type == 0) { return(null); } // Get the node meta: TextureNodeMeta meta = TextureNodes.Get(type); // Instance it: TextureNode instance = meta.GetInstance(); // Load now: instance.Read(this); return(instance); }
/// <summary>Loads the set of nodes.</summary> public static void LoadAvailableNodes() { // Refresh the node set: TextureNodes.All = null; TextureNodes.Get(0); // Get the full list: AllNodes = TextureNodes.All; // The result list: List <TextureNodeMeta> meta = new List <TextureNodeMeta>(); // For each one.. foreach (KeyValuePair <int, TextureNodeMeta> kvp in AllNodes) { // Add it to the list: meta.Add(kvp.Value); } // Sort it: meta.Sort(delegate(TextureNodeMeta a, TextureNodeMeta b){ return(a.Name.CompareTo(b.Name)); }); // Ok! Time to create a textual list: Instances = meta; string[] names = new string[meta.Count]; for (int i = 0; i < meta.Count; i++) { names[i] = meta[i].Name; } Nodes = names; }