protected void updateKeys()
        {
            if (mTarget.replaceMaterial != null)
            {
                Shader shader = mTarget.replaceMaterial.shader;
                int    len    = ShaderUtil.GetPropertyCount(shader);
                keys.Clear();
                max.Clear();
                max.Clear();
                def.Clear();
                for (int i = 0; i < len; i++)
                {
                    string g = ShaderUtil.GetPropertyName(shader, i);
                    ShaderUtil.ShaderPropertyType type = ShaderUtil.GetPropertyType(shader, i);
                    if (type == ShaderUtil.ShaderPropertyType.Range)
                    {
                        def[g] = ShaderUtil.GetRangeLimits(shader, i, 0);
                        min[g] = ShaderUtil.GetRangeLimits(shader, i, 1);
                        max[g] = ShaderUtil.GetRangeLimits(shader, i, 2);

                        keys.Add(g);
                    }

                    if (type == ShaderUtil.ShaderPropertyType.Color)
                    {
                        Color color = mTarget.replaceMaterial.GetColor(g);
                        colors.Add(g, color);
                        colorKeys = colors.Keys.ToArray();
                    }
                }
            }
        }
 public static void AddMapItem(ExcelMapVO excelVO)
 {
     ExcelMapMapping.Add(excelVO.uri, excelVO);
 }
Beispiel #3
0
        public static XmlDocument load()
        {
            string path = Application.dataPath + "/Editor/config.xml";

            if (File.Exists(path) == false)
            {
                return(null);
            }
            _doc = new XmlDocument();
            _doc.Load(path);

            XmlNode node = _doc.SelectSingleNode("config/prefixes");

            foreach (XmlNode childNode in node.ChildNodes)
            {
                string key   = childNode.Attributes["name"].InnerText;
                string value = childNode.Attributes["value"].InnerText;

                prefixs.Add(key, value);
            }


            node = doc.SelectSingleNode("config/prefabExport");
            foreach (XmlNode itemNode in node.ChildNodes)
            {
                string name = itemNode.Attributes["name"].InnerText;
                if (prefabExports.ContainsKey(name))
                {
                    continue;
                }
                prefabExportsRaw.Add(name, itemNode);
                try
                {
                    string[] tempList = itemNode.Attributes["from"].InnerText.As3Split(",");
                    prefabExports.Add(name, tempList);
                }
                catch (Exception)
                {
                }
            }

            autoCopys.Clear();
            node = doc.SelectSingleNode("config/autoCopy");
            if (node != null)
            {
                foreach (XmlNode itemNode in node.ChildNodes)
                {
                    string from = itemNode.Attributes["from"].InnerText;
                    string to   = itemNode.Attributes["to"].InnerText;
                    if (string.IsNullOrEmpty(from) || string.IsNullOrEmpty(to))
                    {
                        continue;
                    }
                    if (autoCopys.ContainsKey(from) == false)
                    {
                        autoCopys.Add(from, to);
                    }
                }
            }
            return(_doc);
        }