Ejemplo n.º 1
0
 private String exportAsMacro(IScriptExporter exporter)
 {
     String macro = "";
     macro += exporter.beginMacroRegistration();
     foreach (Parameter p in Parameters)
     {
         macro += exporter.registerMacroParameter(p.Name, p.Type, p.Values.ToString(CultureInfo.GetCultureInfo("en-US")));
     }
     macro += exporter.endRegisterMacro();
     macro += exporter.beginMacroBody();
     foreach (GameObject g in m_scriptObjects)
     {
         macro += g.exportScript(exporter);
     }
     macro += exporter.endMacroBody();
     return macro;
 }
Ejemplo n.º 2
0
 public String exportScript(IScriptExporter exporter)
 {
     StringBuilder script = new StringBuilder();
     if (IsMacro)
     {
         script.Append( exporter.beginMacroRegistration());
         foreach (Parameter p in this.Parameters)
         {
             script.Append(exporter.registerMacroParameter(p.Name, p.Type, p.Values.ToString(CultureInfo.GetCultureInfo("en-US"))));
         }
         script.Append(exporter.endMacroRegistration());
         script.Append(exporter.beginMacroBody());
     }
     else
     {
         script.Append(exporter.EntryPoint());
     }
     foreach (GameObject g in m_scriptObjects)
     {
         script.Append(g.exportScript(exporter));
     }
     if (IsMacro)
     {
         script.Append(exporter.endMacroBody());
     }
     else
     {
         script.Append(exporter.End());
     }
     return script.ToString();
 }