Beispiel #1
0
 public static AssetFormatRule CreateFormatRule(EdNode node)
 {
     try
     {
         AssetFormatRule rule = new AssetFormatRule();
         rule.FilterPath = node.GetAttribute("FilterPath").ToStr();
         EdAttribute filterPathattribute = node.GetAttribute("FilterRule");
         if (filterPathattribute != null)
         {
             rule.FilterRule = filterPathattribute.ToStr();
             Type filterType = Type.GetType("SummerEditor." + rule.FilterRule);
             Debug.AssertFormat(filterType != null, "找不到对应的规则文件:[{0}]", rule.FilterRule);
             rule._filter = Activator.CreateInstance(filterType) as I_AssetFilter;
         }
         rule.FormatRule = node.GetAttribute("FormatRule").ToStr();
         Type ruleType = Type.GetType("SummerEditor." + rule.FormatRule);
         Debug.AssertFormat(ruleType != null, "找不到对应的格式化文件:[{0}]", rule.FormatRule);
         rule._rule = Activator.CreateInstance(ruleType) as I_AssetRule;
         Debug.AssertFormat(rule._rule != null, "格式规则不存在:[{0}]", rule.FormatRule);
         return(rule);
     }
     catch (Exception e)
     {
         Debug.Log(e.Message);
         return(null);
     }
 }
Beispiel #2
0
        private static bool AddLeafNodes(SequenceLine sequenceLine, EdNode trackNode)
        {
            int       startFarme  = trackNode.GetAttribute(StartFrame).ToInt();
            int       frameLength = trackNode.GetAttribute(FrameLength).ToInt();
            TrackLine trackLine   = CreateTrack(startFarme, frameLength);

            sequenceLine.AddTrack(trackLine);

            List <EdNode> nodes  = trackNode.Nodes;
            int           length = nodes.Count;

            for (int i = 0; i < length; i++)
            {
                EdNode           node     = nodes[i];
                SequenceLeafNode leafNode = CreateLeftNode(node);
                if (leafNode == null)
                {
                    return(false);
                }
                trackLine.AddNode(leafNode);
            }
            return(true);
        }
Beispiel #3
0
        public static SequenceLine Create(EdNode root)
        {
            SequenceLine sequenceLine = new SequenceLine();

            sequenceLine.Id = root.GetAttribute(Id).ToInt();
            List <EdNode> nodes  = root.GetNodes(Track);
            int           length = nodes.Count;

            for (int i = 0; i < length; i++)
            {
                EdNode node   = nodes[i];
                bool   result = AddLeafNodes(sequenceLine, node);
                if (!result)
                {
                    return(null);
                }
            }
            return(sequenceLine);
        }
Beispiel #4
0
 public override void SetConfigInfo(EdNode cnf)
 {
     _effectName = cnf.GetAttribute(EFFECT_NAME).ToStr();
 }
Beispiel #5
0
 public override void SetConfigInfo(EdNode cnf)
 {
     _radius = cnf.GetAttribute(RADIUS).ToFloat();
     _degree = cnf.GetAttribute(DEGREE).ToFloat();
 }
Beispiel #6
0
 public void Parse(EdNode node)
 {
     _key     = node.GetAttribute(KEY).Text.ToInt();
     _fresnel = node.GetAttribute(FRESNEL).Text.ToFloat();
     _color   = node.GetAttribute(COLOR).Text.ToV3();
 }
Beispiel #7
0
 public override void SetConfigInfo(EdNode node)
 {
     _animationName = node.GetAttribute(ANIMATION_NAME).ToStr();
 }