示例#1
0
 public override void OnAttributeValueChanged(BaseNodeAttr attr = null)
 {
     if (attr != null)
     {
         if (attr.GetPreValue() == null)
         {
             string newTypeName = attr.GetValueString();
             if (newTypeName != "")
             {
                 BaseNode onCreteNode = GetChildByType(NodeType.OnEnemyCreate);
                 _isWatchingData = CustomDefine.AddData(CustomDefineType.Enemy, newTypeName, onCreteNode.GetAttrByIndex(0).GetValueString());
             }
         }
         else
         {
             string fromName = attr.GetPreValue().ToString();
             if (fromName != "")
             {
                 if (_isWatchingData)
                 {
                     _isWatchingData = CustomDefine.ModifyDefineName(CustomDefineType.Enemy, fromName, attr.GetValueString());
                 }
                 else
                 {
                     BaseNode onCreteNode = GetChildByType(NodeType.OnEnemyCreate);
                     _isWatchingData = CustomDefine.AddData(CustomDefineType.Enemy, attr.GetValueString(), onCreteNode.GetAttrByIndex(0).GetValueString());
                 }
             }
             else
             {
                 string newTypeName = attr.GetValueString();
                 if (newTypeName != "")
                 {
                     BaseNode onCreteNode = GetChildByType(NodeType.OnEnemyCreate);
                     _isWatchingData = CustomDefine.AddData(CustomDefineType.Enemy, newTypeName, onCreteNode.GetAttrByIndex(0).GetValueString());
                 }
             }
         }
     }
     else // 载入节点数据or设置节点默认值时
     {
         string typeName = GetAttrByIndex(0).GetValueString();
         if (typeName != "")
         {
             BaseNode onCreteNode = GetChildByType(NodeType.OnEnemyCreate);
             string   paraList    = onCreteNode.GetAttrByIndex(0).GetValueString();
             _isWatchingData = CustomDefine.AddData(CustomDefineType.Enemy, typeName, paraList);
         }
     }
     base.OnAttributeValueChanged(attr);
 }
示例#2
0
 public override void OnAttributeValueChanged(BaseNodeAttr attr = null)
 {
     if (attr != null)
     {
         if (attr.GetPreValue() == null)
         {
             string newTypeName = attr.GetValueString();
             if (newTypeName != "")
             {
                 _isWatchingData = CustomDefine.AddData(CustomDefineType.SpellCard, newTypeName, "");
             }
         }
         else
         {
             string fromName = attr.GetPreValue().ToString();
             if (fromName != "")
             {
                 if (_isWatchingData)
                 {
                     _isWatchingData = CustomDefine.ModifyDefineName(CustomDefineType.SpellCard, fromName, attr.GetValueString());
                 }
                 else
                 {
                     _isWatchingData = CustomDefine.AddData(CustomDefineType.SpellCard, attr.GetValueString(), "");
                 }
             }
             else
             {
                 string newTypeName = attr.GetValueString();
                 if (newTypeName != "")
                 {
                     _isWatchingData = CustomDefine.AddData(CustomDefineType.SpellCard, newTypeName, "");
                 }
             }
         }
     }
     else // 载入节点数据or设置节点默认值时
     {
         string typeName = GetAttrByIndex(0).GetValueString();
         if (typeName != "")
         {
             _isWatchingData = CustomDefine.AddData(CustomDefineType.SpellCard, typeName, "");
         }
     }
     base.OnAttributeValueChanged(attr);
 }