public override void Write(SchemaWriter writer) { if (parameter == null) writer.Append(string.Format("default({0})", ReturnType.FullName)); else parameter.Write(writer); }
public void Compile() { AssetDatabase.SaveAssets(); if (!IsValid()) { throw new InvalidDataException("One or more nodes are invalid."); } var path = Path.ChangeExtension(AssetDatabase.GetAssetPath(this), ".cs"); using (var stream = File.Exists(path) ? File.Open(path, FileMode.Truncate) : File.Create(path)) { using (var writer = new SchemaWriter(stream)) { writer.BeginTypeDeclaration(Name, BaseType.FullName); var functionDeclarations = GetFunctionDeclarations(); for (int i = 0; i < functionDeclarations.Length; i++) { functionDeclarations[i].Write(writer); } writer.EndTypeDeclaration(); } } AssetDatabase.Refresh(); }
public override void Write(SchemaWriter writer) { if (parameter == null) { writer.Append(string.Format("default({0})", ReturnType.FullName)); } else { parameter.Write(writer); } }
public override void Write(SchemaWriter writer) { writer.BeginMethodDeclaration(Name, "void"); for (int i = 0; i < functions.Count; i++) { writer.AppendIndentation(); functions[i].Write(writer); writer.AppendLine(";", false); } writer.EndMethodDeclaration(); }
public override void Write(SchemaWriter writer) { writer.Append(Caller.FullName); writer.Append("." + Name + "("); for (int i = 0; i < Parameters.Length; i++) { Parameters[i].Write(writer); if (i < Parameters.Length - 1) writer.Append(", "); } writer.Append(")"); }
public override void Write(SchemaWriter writer) { caller.Write(writer); writer.Append("." + Name + "("); for (int i = 0; i < Parameters.Length; i++) { Parameters[i].Write(writer); if (i < Parameters.Length - 1) { writer.Append(", "); } } writer.Append(")"); }
public override void Write(SchemaWriter writer) { writer.Append("this"); }
public override void Write(SchemaWriter writer) { writer.Append(Caller.FullName); writer.Append("." + Name); }
public override void Write(SchemaWriter writer) { Caller.Write(writer); writer.Append("." + Name); }
public abstract void Write(SchemaWriter writer);