Ejemplo n.º 1
0
        /// <summary>
        /// 读取工程
        /// </summary>
        /// <param name="projFile">工程文件</param>
        public void LoadProject(string projFile)
        {
            FileInfo fileinf = new FileInfo(projFile);

            Halation.projectFolder  = fileinf.DirectoryName;
            Halation.project        = (ProjectPackage)FileManager.Unserialization(projFile);
            Halation.project.Config = new ConfigPackage();
            var lconfig = FileManager.LoadConfigData(Halation.projectFolder + "\\YuriConfig.dat");

            foreach (var configKVP in lconfig)
            {
                Halation.SetValueByName <ConfigPackage>(Halation.project.Config, configKVP.Item1, configKVP.Item2,
                                                        configKVP.Item3);
            }
            Halation.projectName = Halation.project.Config.GameProjName;
            foreach (var sc in Halation.project.GetScene())
            {
                HalationInvoker.AddScene(sc.sceneName);
                foreach (var fc in sc.GetFunc())
                {
                    HalationInvoker.AddScene(fc.functionCallName);
                }
            }
            this.RefreshProjectTree("main");
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 增加一个场景
 /// </summary>
 /// <param name="scenario">场景名</param>
 /// <returns>操作成功与否</returns>
 public bool AddScene(string scenario)
 {
     if (this.sceneDict.ContainsKey(scenario))
     {
         return(false);
     }
     sceneDict.Add(scenario, new ScenePackage(scenario));
     HalationInvoker.AddScene(scenario);
     return(true);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 增加一个函数
        /// </summary>
        /// <param name="funcName">函数名</param>
        /// <param name="argv">形参列表</param>
        /// <returns>操作成功与否</returns>
        public bool AddFunction(string funcName, List <string> argv)
        {
            if (this.funcList.Find(x => x.functionName == funcName) != null)
            {
                return(false);
            }
            var nf = new FunctionPackage(funcName, this, argv);

            this.funcList.Add(nf);
            HalationInvoker.AddScene(nf.functionCallName);
            return(true);
        }