Exemplo n.º 1
0
        private void WriteCode(PlayMakerCodeGenerator compiler)
        {
            var parser = new PlayMakerParser(compiler.parserOptions);

            try {
                var fsm       = compiler.fsm as PlayMakerFSM;
                var model     = parser.CreateModel(fsm);
                var generator = new CodeGenerator(compiler.generatorOptions);

                var output = generator.Generate(model, compiler.outputOptions.className);

                string outputFile;
                if (!GetOutputFilePath(compiler, out outputFile))
                {
                    return;
                }

                File.WriteAllText(outputFile, output.code);

                AssetDatabase.Refresh();
            }
            catch (System.Exception e) {
                Debug.LogErrorFormat("PlayMakerCodeGenerator: error writing FSM: {0}", e.ToString());
                return;
            }
        }
Exemplo n.º 2
0
        private void RegenerateDescription(PlayMakerCodeGenerator compiler)
        {
            var parser = new PlayMakerParser(compiler.parserOptions);

            try {
                var fsm   = compiler.fsm as PlayMakerFSM;
                var model = parser.CreateModel(fsm);
                compiler.DebugDescription = Stringify.CreateDescription(model);
            }
            catch (System.Exception e) {
                Debug.LogErrorFormat("PlayMakerStringify, error parsing FSM: {0}", e.ToString());
                return;
            }
        }