Procházet zdrojové kódy

行为树保存路径增加配置

tanghai před 11 roky
rodič
revize
8bc261c8e3

+ 1 - 0
CSharp/App/Editor/app.config

@@ -28,6 +28,7 @@
 		<add key="Port" value="8888" />
 		<add key="Account" value="egametang@163.com" />
 		<add key="Password" value="163bio1" />
+		<add key="NodePath" value="D:\Source\Demo\battledemo\Assets\Resources\Config\node.bytes" />
 	</appSettings>
 
 

+ 6 - 6
CSharp/App/Modules/Tree/AllTreeView.xaml.cs

@@ -1,10 +1,8 @@
-using System.Collections.Generic;
-using System.ComponentModel.Composition;
+using System.ComponentModel.Composition;
+using System.Configuration;
 using System.Windows;
-using System.Windows.Controls;
 using System.Windows.Input;
 using Infrastructure;
-using Microsoft.Practices.Prism.PubSubEvents;
 
 namespace Modules.Tree
 {
@@ -37,14 +35,16 @@ namespace Modules.Tree
 
         private void MenuItem_Open(object sender, RoutedEventArgs e)
         {
-            this.ViewModel.Open("node.bytes");
+            string nodePath = ConfigurationManager.AppSettings["NodePath"];
+            this.ViewModel.Open(nodePath);
             this.lbTreeRoots.SelectedIndex = -1;
             this.treeView.ViewModel = null;
         }
 
         private void MenuItem_Save(object sender, RoutedEventArgs e)
         {
-            this.ViewModel.Save("node.bytes");
+            string nodePath = ConfigurationManager.AppSettings["NodePath"];
+            this.ViewModel.Save(nodePath);
         }
 
         private void MenuItem_New(object sender, RoutedEventArgs e)

+ 5 - 0
CSharp/App/Modules/Tree/NodeType.cs

@@ -10,8 +10,13 @@
         SelectTarget = 10000,
         Roll = 10001,
         Compare = 10002,
+        InAttackDistance = 10003,
+        InChaseDistance = 10004,
 
         // action节点 20000开始
         CastSpell = 20000,
+        Chase = 20001,
+        Attack = 20002,
+        Patrol = 20003,
     }
 }

+ 1 - 0
CSharp/App/Modules/Tree/Tree.csproj

@@ -75,6 +75,7 @@
     <Reference Include="PresentationFramework" />
     <Reference Include="System" />
     <Reference Include="System.ComponentModel.Composition" />
+    <Reference Include="System.configuration" />
     <Reference Include="System.Core" />
     <Reference Include="System.Data" />
     <Reference Include="System.Drawing" />