From 1aeb815836d84ecfddf761a47862efebbba0ad03 Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期二, 12 二月 2019 21:55:16 +0800
Subject: [PATCH] 3335 配置表读取重构。
---
Core/GameEngine/Model/Config/EffectConfig.cs | 84 +++++++++++++++++++++--------------------
1 files changed, 43 insertions(+), 41 deletions(-)
diff --git a/Core/GameEngine/Model/Config/EffectConfig.cs b/Core/GameEngine/Model/Config/EffectConfig.cs
index f8192a4..1d610b5 100644
--- a/Core/GameEngine/Model/Config/EffectConfig.cs
+++ b/Core/GameEngine/Model/Config/EffectConfig.cs
@@ -1,59 +1,61 @@
-锘�//--------------------------------------------------------
-// [Author]: 绗簩涓栫晫
-// [ Date ]: Monday, June 25, 2018
-//--------------------------------------------------------
-
-using UnityEngine;
-using System;
-
-namespace TableConfig {
-
-
+锘�//--------------------------------------------------------
+// [Author]: 绗簩涓栫晫
+// [ Date ]: Tuesday, February 12, 2019
+//--------------------------------------------------------
+
+using UnityEngine;
+using System;
+
+namespace TableConfig {
+
+
public partial class EffectConfig : ConfigBase {
- public int id { get ; private set ; }
- public string packageName { get ; private set; }
- public string fxName { get ; private set; }
- public int job { get ; private set ; }
- public int audio { get ; private set ; }
- public int stopImmediate { get ; private set ; }
- public int setParent { get ; private set ; }
- public string nodeName { get ; private set; }
-
+ public int id;
+ public string packageName;
+ public string fxName;
+ public int job;
+ public int audio;
+ public int stopImmediate;
+ public int setParent;
+ public string nodeName;
+
public override string getKey()
{
return id.ToString();
- }
-
- public override void Parse() {
+ }
+
+ public override void Parse(string content) {
try
{
- id=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0;
+ var contents = content.Split('\t');
+
+ int.TryParse(contents[0],out id);
- packageName = rawContents[1].Trim();
+ packageName = contents[1];
- fxName = rawContents[2].Trim();
+ fxName = contents[2];
- job=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0;
+ int.TryParse(contents[3],out job);
- audio=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0;
+ int.TryParse(contents[4],out audio);
- stopImmediate=IsNumeric(rawContents[5]) ? int.Parse(rawContents[5]):0;
+ int.TryParse(contents[5],out stopImmediate);
- setParent=IsNumeric(rawContents[6]) ? int.Parse(rawContents[6]):0;
+ int.TryParse(contents[6],out setParent);
- nodeName = rawContents[7].Trim();
+ nodeName = contents[7];
}
catch (Exception ex)
{
DebugEx.Log(ex);
- }
- }
-
- }
-
-}
-
-
-
-
+ }
+ }
+
+ }
+
+}
+
+
+
+
--
Gitblit v1.8.0