WriteLine() public method

public WriteLine ( string format ) : void
format string
return void
コード例 #1
0
ファイル: UFButton.cs プロジェクト: hidakas/uForms
 public override void WriteNativeCodeByRect(CodeBuilder builder)
 {
     builder.WriteLine("if(GUI.Button(DrawRects.{0}, DrawContents.{1}))", this.Name, this.Name);
     builder.WriteLine("{");
     builder.WriteLine("");
     builder.WriteLine("}");
 }
コード例 #2
0
 public override void WriteNativeCodeByRect(CodeBuilder builder)
 {
     builder.WriteLine("if(GUI.Button(DrawRects.{0}, DrawContents.{1}))", this.Name, this.Name);
     builder.WriteLine("{");
     builder.WriteLine("");
     builder.WriteLine("}");
 }
コード例 #3
0
ファイル: UFCanvas.cs プロジェクト: wolfreak99/uForms
 public override void WriteCodeAdditional(CodeBuilder builder)
 {
     this.childList.ForEach(child =>
     {
         builder.WriteLine("// " + child.Name);
         child.WriteCode(builder);
         builder.WriteLine("this." + this.Name + ".Add(this." + child.Name + ");");
     });
 }
コード例 #4
0
ファイル: UFCanvas.cs プロジェクト: hidakas/uForms
 public override void WriteCodeAdditional(CodeBuilder builder)
 {
     this.childList.ForEach(child =>
     {
         builder.WriteLine("// " + child.Name);
         child.WriteCode(builder);
         builder.WriteLine("this." + this.Name + ".Add(this." + child.Name + ");");
     });
 }
コード例 #5
0
ファイル: UFCanvas.cs プロジェクト: wolfreak99/uForms
 public override void WriteNativeCodeByRect(CodeBuilder builder)
 {
     builder.WriteLine("GUI.BeginGroup(DrawRects.{0});", this.Name);
     builder.WriteLine("{");
     ++builder.Indent;
     this.childList.ForEach(child => child.WriteNativeCodeByRect(builder));
     --builder.Indent;
     builder.WriteLine("}");
     builder.WriteLine("GUI.EndGroup();");
 }
コード例 #6
0
ファイル: UFCanvas.cs プロジェクト: hidakas/uForms
 public override void WriteNativeCodeByRect(CodeBuilder builder)
 {
     builder.WriteLine("GUI.BeginGroup(DrawRects.{0});", this.Name);
     builder.WriteLine("{");
     ++builder.Indent;
     this.childList.ForEach(child => child.WriteNativeCodeByRect(builder));
     --builder.Indent;
     builder.WriteLine("}");
     builder.WriteLine("GUI.EndGroup();");
 }
コード例 #7
0
ファイル: UFControl.cs プロジェクト: icansmile/UGUITest
 public void WriteCode(CodeBuilder builder)
 {
     builder.WriteLine("this." + this.Name + " = new " + this.GetType().Name + "();");
     builder.WriteLine("this." + this.Name + ".Text = \"" + this.Text + "\";");
     builder.WriteLine("this." + this.Name + ".Name = \"" + this.Name + "\";");
     builder.WriteLine("this." + this.Name + ".IsEnabled = " + (this.IsEnabled ? "true" : "false") + ";");
     builder.WriteLine("this." + this.Name + ".IsHidden = " + (this.IsHidden ? "true" : "false") + ";");
     builder.WriteLine("this." + this.Name + ".DrawRect = new Rect(" +
                       this.DrawRect.x.ToString() + "f, " +
                       this.DrawRect.y.ToString() + "f, " +
                       this.DrawRect.width.ToString() + "f, " +
                       this.DrawRect.height.ToString() + "f);");
     WriteCodeAdditional(builder);
 }
コード例 #8
0
        public static void ExportCode(string codePath)
        {
            string designerCodePath = codePath.Replace(".cs", ".Designer.cs");

            // export the designer code always.
            {
                #region export the designer code

                CodeBuilder cb = new CodeBuilder();
                cb.WriteLine("using uForms;");
                cb.WriteLine("using UnityEngine;");
                cb.WriteLine("");
                cb.WriteLine("namespace " + current.Namespace);
                cb.WriteLine("{");
                cb.Indent++;
                cb.WriteLine("partial class " + current.ClassName);
                cb.WriteLine("{");
                cb.Indent++;
                cb.WriteLine("#region Auto generated code from uForms.");
                cb.WriteLine("");
                cb.WriteLine("private void InitializeComponent()");
                cb.WriteLine("{");
                cb.Indent++;
                current.Controls.ForEach(child =>
                {
                    cb.WriteLine("// " + child.Name);
                    child.WriteCode(cb);
                    cb.WriteLine("this.Controls.Add(this." + child.Name + ");");
                });
                cb.Indent--;
                cb.WriteLine("}");
                cb.WriteLine("");
                cb.WriteLine("#endregion");
                cb.WriteLine("");
                current.Controls.ForEach(child => child.ForTree(node => node.WriteDefinitionCode(cb)));
                cb.Indent--;
                cb.WriteLine("}");
                cb.Indent--;
                cb.WriteLine("}");
                File.WriteAllText(designerCodePath, cb.GetCode(), new UTF8Encoding(true));

                #endregion
            }

            // export the main code if it doesn't exist.
            if (!File.Exists(codePath))
            {
                #region export the main code

                CodeBuilder cb = new CodeBuilder();
                cb.WriteLine("using uForms;");
                cb.WriteLine("using UnityEngine;");
                cb.WriteLine("using UnityEditor;");
                cb.WriteLine("");
                cb.WriteLine("namespace " + current.Namespace);
                cb.WriteLine("{");
                cb.Indent++;
                cb.WriteLine("public partial class " + current.ClassName + " : UFWindow");
                cb.WriteLine("{");
                cb.Indent++;
                cb.WriteLine("[MenuItem(\"Tools/" + current.ClassName + "\")]");
                cb.WriteLine("public static void OpenWindow()");
                cb.WriteLine("{");
                cb.Indent++;
                cb.WriteLine("GetWindow<" + current.ClassName + ">(\"" + current.ClassName + "\");");
                cb.Indent--;
                cb.WriteLine("}");
                cb.WriteLine("");
                cb.WriteLine("void Awake()");
                cb.WriteLine("{");
                cb.Indent++;
                cb.WriteLine("InitializeComponent();");
                cb.Indent--;
                cb.WriteLine("}");
                cb.Indent--;
                cb.WriteLine("}");
                cb.Indent--;
                cb.WriteLine("}");
                File.WriteAllText(codePath, cb.GetCode(), new UTF8Encoding(true));

                #endregion
            }

            if (codePath.Contains("Assets/"))
            {
                codePath = codePath.Substring(codePath.IndexOf("Assets/"));
                AssetDatabase.ImportAsset(codePath);
            }
            if (designerCodePath.Contains("Assets/"))
            {
                designerCodePath = designerCodePath.Substring(designerCodePath.IndexOf("Assets/"));
                AssetDatabase.ImportAsset(designerCodePath);
            }
        }
コード例 #9
0
ファイル: UFObjectField.cs プロジェクト: hidakas/uForms
 public override void WriteNativeVariableDefinitionCode(CodeBuilder builder)
 {
     builder.WriteLine(string.Format("private UnityEngine.Object {0}Object = null;", this.Name));
 }
コード例 #10
0
ファイル: UFProject.cs プロジェクト: hidakas/uForms
        public static void ExportCode(string codePath)
        {
            string designerCodePath = codePath.Replace(".cs",".Designer.cs");

            // export the designer code always.
            {
                #region export the designer code

                CodeBuilder cb = new CodeBuilder();
                cb.WriteLine("using uForms;");
                cb.WriteLine("using UnityEngine;");
                cb.WriteLine("");
                cb.WriteLine("namespace " + current.Namespace);
                cb.WriteLine("{");
                cb.Indent++;
                cb.WriteLine("partial class " + current.ClassName);
                cb.WriteLine("{");
                cb.Indent++;
                cb.WriteLine("#region Auto generated code from uForms.");
                cb.WriteLine("");
                cb.WriteLine("private void InitializeComponent()");
                cb.WriteLine("{");
                cb.Indent++;
                current.Controls.ForEach(child =>
                {
                    cb.WriteLine("// " + child.Name);
                    child.WriteCode(cb);
                    cb.WriteLine("this.Controls.Add(this." + child.Name + ");");
                });
                cb.Indent--;
                cb.WriteLine("}");
                cb.WriteLine("");
                cb.WriteLine("#endregion");
                cb.WriteLine("");
                current.Controls.ForEach(child => child.ForTree(node => node.WriteDefinitionCode(cb)));
                cb.Indent--;
                cb.WriteLine("}");
                cb.Indent--;
                cb.WriteLine("}");
                File.WriteAllText(designerCodePath, cb.GetCode(), new UTF8Encoding(true));

                #endregion
            }

            // export the main code if it doesn't exist.
            if(!File.Exists(codePath))
            {
                #region export the main code

                CodeBuilder cb = new CodeBuilder();
                cb.WriteLine("using uForms;");
                cb.WriteLine("using UnityEngine;");
                cb.WriteLine("using UnityEditor;");
                cb.WriteLine("");
                cb.WriteLine("namespace " + current.Namespace);
                cb.WriteLine("{");
                cb.Indent++;
                cb.WriteLine("public partial class " + current.ClassName + " : UFWindow");
                cb.WriteLine("{");
                cb.Indent++;
                cb.WriteLine("[MenuItem(\"Tools/" + current.ClassName + "\")]");
                cb.WriteLine("public static void OpenWindow()");
                cb.WriteLine("{");
                cb.Indent++;
                cb.WriteLine("GetWindow<" + current.ClassName + ">(\"" + current.ClassName + "\");");
                cb.Indent--;
                cb.WriteLine("}");
                cb.WriteLine("");
                cb.WriteLine("void Awake()");
                cb.WriteLine("{");
                cb.Indent++;
                cb.WriteLine("InitializeComponent();");
                cb.Indent--;
                cb.WriteLine("}");
                cb.Indent--;
                cb.WriteLine("}");
                cb.Indent--;
                cb.WriteLine("}");
                File.WriteAllText(codePath, cb.GetCode(), new UTF8Encoding(true));

                #endregion
            }

            if(codePath.Contains("Assets/"))
            {
                codePath = codePath.Substring(codePath.IndexOf("Assets/"));
                AssetDatabase.ImportAsset(codePath);
            }
            if(designerCodePath.Contains("Assets/"))
            {
                designerCodePath = designerCodePath.Substring(designerCodePath.IndexOf("Assets/"));
                AssetDatabase.ImportAsset(designerCodePath);
            }
        }
コード例 #11
0
ファイル: UFToggle.cs プロジェクト: wolfreak99/uForms
 public override void WriteCodeAdditional(CodeBuilder builder)
 {
     builder.WriteLine("this." + this.Name + ".Checked = " + (this.Checked ? "true" : "false") + ";");
 }
コード例 #12
0
ファイル: UFFloatSlider.cs プロジェクト: hidakas/uForms
 public override void WriteNativeCodeByRect(CodeBuilder builder)
 {
     builder.WriteLine("this.{0}Value = EditorGUI.Slider(DrawRects.{1}, this.{2}Value, {3}Min, {4}Max);",
         this.Name, this.Name, this.Name, this.Name, this.Name);
 }
コード例 #13
0
ファイル: UFFloatSlider.cs プロジェクト: hidakas/uForms
 public override void WriteNativeVariableDefinitionCode(CodeBuilder builder)
 {
     builder.WriteLine("private float {0}Value = {1}f;", this.Name, this.Value);
 }
コード例 #14
0
ファイル: UFToggle.cs プロジェクト: hidakas/uForms
 public override void WriteNativeVariableDefinitionCode(CodeBuilder builder)
 {
     builder.WriteLine("private bool {0}Value = {1};", this.Name, (this.Checked ? "true" : "false"));
 }
コード例 #15
0
ファイル: UFTextField.cs プロジェクト: hidakas/uForms
 public override void WriteNativeVariableDefinitionCode(CodeBuilder builder)
 {
     builder.WriteLine(string.Format("private string {0}Text = \"{1}\";", this.Name, this.Text));
 }
コード例 #16
0
 public override void WriteNativeVariableDefinitionCode(CodeBuilder builder)
 {
     builder.WriteLine(string.Format("private UnityEngine.Object {0}Object = null;", this.Name));
 }
コード例 #17
0
 public override void WriteNativeCodeByRect(CodeBuilder builder)
 {
     builder.WriteLine(string.Format("this.{0}Object = EditorGUI.ObjectField(DrawRects.{1}, this.{2}Object, typeof(UnityEngine.Object), {3});",
                                     this.Name, this.Name, this.Name, (this.allowSceneObject ? "true" : "false")));
 }
コード例 #18
0
 public override void WriteCodeAdditional(CodeBuilder builder)
 {
     builder.WriteLine("this." + this.Name + ".AllowSceneObject = " + (this.allowSceneObject ? "true" : "false") + ";");
 }
コード例 #19
0
ファイル: UFToggle.cs プロジェクト: hidakas/uForms
 public override void WriteCodeAdditional(CodeBuilder builder)
 {
     builder.WriteLine("this." + this.Name + ".Checked = " + (this.Checked ? "true" : "false") + ";");
 }
コード例 #20
0
        public static void ExportNativeCode(string codePath)
        {
            CodeBuilder cb = new CodeBuilder();

            cb.WriteLine("using UnityEngine;");
            cb.WriteLine("using UnityEditor;");
            cb.WriteLine("");
            cb.WriteLine("namespace " + current.Namespace);
            cb.WriteLine("{");
            cb.Indent++;
            cb.WriteLine("public class " + current.ClassName + " : EditorWindow");
            cb.WriteLine("{");
            cb.Indent++;

            cb.WriteLine("public class DrawRects");
            cb.WriteLine("{");
            cb.Indent++;
            current.Controls.ForEach(child => child.ForTree(node => node.WriteNativeRectDefinitionCode(cb)));
            cb.Indent--;
            cb.WriteLine("}");
            cb.WriteLine("");

            cb.WriteLine("public class DrawContents");
            cb.WriteLine("{");
            cb.Indent++;
            current.Controls.ForEach(child => child.ForTree(node => node.WriteNativeContentDefinitionCode(cb)));
            cb.Indent--;
            cb.WriteLine("}");
            cb.WriteLine("");

            cb.WriteLine("#region Constants");
            cb.WriteLine("");
            current.Controls.ForEach(child => child.ForTree(node => node.WriteNativeConstDefinitionCode(cb)));
            cb.WriteLine("");
            cb.WriteLine("#endregion Constants");
            cb.WriteLine("");

            cb.WriteLine("#region Variables");
            cb.WriteLine("");
            current.Controls.ForEach(child => child.ForTree(node => node.WriteNativeVariableDefinitionCode(cb)));
            cb.WriteLine("");
            cb.WriteLine("#endregion Variables");
            cb.WriteLine("");

            cb.WriteLine("[MenuItem(\"Tools/" + current.ClassName + "\")]");
            cb.WriteLine("public static void OpenWindow()");
            cb.WriteLine("{");
            cb.Indent++;
            cb.WriteLine("GetWindow<" + current.ClassName + ">(\"" + current.ClassName + "\");");
            cb.Indent--;
            cb.WriteLine("}");
            cb.WriteLine("");
            cb.WriteLine("void OnGUI()");
            cb.WriteLine("{");
            cb.Indent++;
            current.Controls.ForEach(child => child.WriteNativeCodeByRect(cb));
            cb.Indent--;
            cb.WriteLine("}");
            cb.Indent--;
            cb.WriteLine("}");
            cb.Indent--;
            cb.WriteLine("}");
            File.WriteAllText(codePath, cb.GetCode(), new UTF8Encoding(true));

            if (codePath.Contains("Assets/"))
            {
                codePath = codePath.Substring(codePath.IndexOf("Assets/"));
                AssetDatabase.ImportAsset(codePath);
            }
        }
コード例 #21
0
ファイル: UFImage.cs プロジェクト: wolfreak99/uForms
 public override void WriteCodeAdditional(CodeBuilder builder)
 {
     builder.WriteLine("this." + this.Name + ".GUID = \"" + this.GUID + "\";");
     builder.WriteLine("this." + this.Name + ".Image = UFUtility.LoadAssetFromGUID<Texture>(\"" + this.GUID + "\");");
 }
コード例 #22
0
ファイル: UFToggle.cs プロジェクト: wolfreak99/uForms
 public override void WriteNativeCodeByRect(CodeBuilder builder)
 {
     builder.WriteLine("this.{0}Value = GUI.Toggle(DrawRects.{1}, this.{2}Value, DrawContents.{3});",
                       this.Name, this.Name, this.Name, this.Name);
 }
コード例 #23
0
ファイル: UFLabel.cs プロジェクト: wolfreak99/uForms
 public override void WriteNativeContentDefinitionCode(CodeBuilder builder)
 {
     builder.WriteLine("public static readonly GUIContent {0} = new GUIContent(\"{1}\");",
                       this.Name, this.Text);
 }
コード例 #24
0
ファイル: UFLabel.cs プロジェクト: hidakas/uForms
 public override void WriteNativeContentDefinitionCode(CodeBuilder builder)
 {
     builder.WriteLine("public static readonly GUIContent {0} = new GUIContent(\"{1}\");",
         this.Name, this.Text);
 }
コード例 #25
0
ファイル: UFFloatSlider.cs プロジェクト: hidakas/uForms
 public override void WriteCodeAdditional(CodeBuilder builder)
 {
     builder.WriteLine("this." + this.Name + ".Value = " + this.value.ToString() + "f;");
     builder.WriteLine("this." + this.Name + ".MaxValue = " + this.maxValue.ToString() + "f;");
     builder.WriteLine("this." + this.Name + ".MinValue = " + this.minValue.ToString() + "f;");
 }
コード例 #26
0
ファイル: UFFloatSlider.cs プロジェクト: wolfreak99/uForms
 public override void WriteNativeVariableDefinitionCode(CodeBuilder builder)
 {
     builder.WriteLine("private float {0}Value = {1}f;", this.Name, this.Value);
 }
コード例 #27
0
ファイル: UFFloatSlider.cs プロジェクト: hidakas/uForms
 public override void WriteNativeConstDefinitionCode(CodeBuilder builder)
 {
     builder.WriteLine("public const float {0}Min = {1}f;", this.Name, this.MinValue);
     builder.WriteLine("public const float {0}Max = {1}f;", this.Name, this.MaxValue);
 }
コード例 #28
0
ファイル: UFFloatSlider.cs プロジェクト: wolfreak99/uForms
 public override void WriteCodeAdditional(CodeBuilder builder)
 {
     builder.WriteLine("this." + this.Name + ".Value = " + this.value.ToString() + "f;");
     builder.WriteLine("this." + this.Name + ".MaxValue = " + this.maxValue.ToString() + "f;");
     builder.WriteLine("this." + this.Name + ".MinValue = " + this.minValue.ToString() + "f;");
 }
コード例 #29
0
ファイル: UFProject.cs プロジェクト: hidakas/uForms
        public static void ExportNativeCode(string codePath)
        {
            CodeBuilder cb = new CodeBuilder();
            cb.WriteLine("using UnityEngine;");
            cb.WriteLine("using UnityEditor;");
            cb.WriteLine("");
            cb.WriteLine("namespace " + current.Namespace);
            cb.WriteLine("{");
            cb.Indent++;
            cb.WriteLine("public class " + current.ClassName + " : EditorWindow");
            cb.WriteLine("{");
            cb.Indent++;

            cb.WriteLine("public class DrawRects");
            cb.WriteLine("{");
            cb.Indent++;
            current.Controls.ForEach(child => child.ForTree(node => node.WriteNativeRectDefinitionCode(cb)));
            cb.Indent--;
            cb.WriteLine("}");
            cb.WriteLine("");

            cb.WriteLine("public class DrawContents");
            cb.WriteLine("{");
            cb.Indent++;
            current.Controls.ForEach(child => child.ForTree(node => node.WriteNativeContentDefinitionCode(cb)));
            cb.Indent--;
            cb.WriteLine("}");
            cb.WriteLine("");

            cb.WriteLine("#region Constants");
            cb.WriteLine("");
            current.Controls.ForEach(child => child.ForTree(node => node.WriteNativeConstDefinitionCode(cb)));
            cb.WriteLine("");
            cb.WriteLine("#endregion Constants");
            cb.WriteLine("");

            cb.WriteLine("#region Variables");
            cb.WriteLine("");
            current.Controls.ForEach(child => child.ForTree(node => node.WriteNativeVariableDefinitionCode(cb)));
            cb.WriteLine("");
            cb.WriteLine("#endregion Variables");
            cb.WriteLine("");

            cb.WriteLine("[MenuItem(\"Tools/" + current.ClassName + "\")]");
            cb.WriteLine("public static void OpenWindow()");
            cb.WriteLine("{");
            cb.Indent++;
            cb.WriteLine("GetWindow<" + current.ClassName + ">(\"" + current.ClassName + "\");");
            cb.Indent--;
            cb.WriteLine("}");
            cb.WriteLine("");
            cb.WriteLine("void OnGUI()");
            cb.WriteLine("{");
            cb.Indent++;
            current.Controls.ForEach(child => child.WriteNativeCodeByRect(cb));
            cb.Indent--;
            cb.WriteLine("}");
            cb.Indent--;
            cb.WriteLine("}");
            cb.Indent--;
            cb.WriteLine("}");
            File.WriteAllText(codePath, cb.GetCode(), new UTF8Encoding(true));

            if(codePath.Contains("Assets/"))
            {
                codePath = codePath.Substring(codePath.IndexOf("Assets/"));
                AssetDatabase.ImportAsset(codePath);
            }
        }
コード例 #30
0
ファイル: UFImage.cs プロジェクト: hidakas/uForms
 public override void WriteNativeCodeByRect(CodeBuilder builder)
 {
     builder.WriteLine("GUI.Label(DrawRects.{0}, DrawContents.{1});",
         this.Name, this.Name);
 }
コード例 #31
0
ファイル: UFToggle.cs プロジェクト: wolfreak99/uForms
 public override void WriteNativeVariableDefinitionCode(CodeBuilder builder)
 {
     builder.WriteLine("private bool {0}Value = {1};", this.Name, (this.Checked ? "true" : "false"));
 }
コード例 #32
0
ファイル: UFObjectField.cs プロジェクト: hidakas/uForms
 public override void WriteCodeAdditional(CodeBuilder builder)
 {
     builder.WriteLine("this." + this.Name + ".AllowSceneObject = " + (this.allowSceneObject ? "true" : "false") + ";");
 }
コード例 #33
0
ファイル: UFFloatSlider.cs プロジェクト: wolfreak99/uForms
 public override void WriteNativeConstDefinitionCode(CodeBuilder builder)
 {
     builder.WriteLine("public const float {0}Min = {1}f;", this.Name, this.MinValue);
     builder.WriteLine("public const float {0}Max = {1}f;", this.Name, this.MaxValue);
 }
コード例 #34
0
ファイル: UFToggle.cs プロジェクト: hidakas/uForms
 public override void WriteNativeCodeByRect(CodeBuilder builder)
 {
     builder.WriteLine("this.{0}Value = GUI.Toggle(DrawRects.{1}, this.{2}Value, DrawContents.{3});",
         this.Name, this.Name, this.Name, this.Name);
 }
コード例 #35
0
ファイル: UFFloatSlider.cs プロジェクト: wolfreak99/uForms
 public override void WriteNativeCodeByRect(CodeBuilder builder)
 {
     builder.WriteLine("this.{0}Value = EditorGUI.Slider(DrawRects.{1}, this.{2}Value, {3}Min, {4}Max);",
                       this.Name, this.Name, this.Name, this.Name, this.Name);
 }
コード例 #36
0
ファイル: UFControl.cs プロジェクト: icansmile/UGUITest
 public void WriteDefinitionCode(CodeBuilder builder)
 {
     builder.WriteLine("private " + this.GetType().Name + " " + this.Name + ";");
 }
コード例 #37
0
ファイル: UFImage.cs プロジェクト: hidakas/uForms
 public override void WriteCodeAdditional(CodeBuilder builder)
 {
     builder.WriteLine("this." + this.Name + ".GUID = \"" + this.GUID + "\";");
     builder.WriteLine("this." + this.Name + ".Image = UFUtility.LoadAssetFromGUID<Texture>(\"" + this.GUID + "\");");
 }
コード例 #38
0
ファイル: UFControl.cs プロジェクト: icansmile/UGUITest
 public void WriteNativeRectDefinitionCode(CodeBuilder builder)
 {
     builder.WriteLine("public static readonly Rect {0} = new Rect({1}f, {2}f, {3}f, {4}f);",
                       this.Name, this.DrawRect.x, this.DrawRect.y, this.DrawRect.width, this.DrawRect.height);
 }
コード例 #39
0
ファイル: UFImage.cs プロジェクト: hidakas/uForms
 public override void WriteNativeContentDefinitionCode(CodeBuilder builder)
 {
     builder.WriteLine("public static readonly GUIContent {0} = new GUIContent({1});",
         this.Name, "AssetDatabase.LoadAssetAtPath<Texture>(AssetDatabase.GUIDToAssetPath(\"" + this.GUID + "\"))");
 }
コード例 #40
0
ファイル: UFControl.cs プロジェクト: hidakas/uForms
 public void WriteCode(CodeBuilder builder)
 {
     builder.WriteLine("this." + this.Name + " = new " + this.GetType().Name + "();");
     builder.WriteLine("this." + this.Name + ".Text = \"" + this.Text + "\";");
     builder.WriteLine("this." + this.Name + ".Name = \"" + this.Name + "\";");
     builder.WriteLine("this." + this.Name + ".IsEnabled = " + (this.IsEnabled ? "true" : "false") + ";");
     builder.WriteLine("this." + this.Name + ".IsHidden = " + (this.IsHidden ? "true" : "false") + ";");
     builder.WriteLine("this." + this.Name + ".DrawRect = new Rect(" +
         this.DrawRect.x.ToString() + "f, " +
         this.DrawRect.y.ToString() + "f, " +
         this.DrawRect.width.ToString() + "f, " +
         this.DrawRect.height.ToString() + "f);");
     WriteCodeAdditional(builder);
 }
コード例 #41
0
ファイル: UFObjectField.cs プロジェクト: hidakas/uForms
 public override void WriteNativeCodeByRect(CodeBuilder builder)
 {
     builder.WriteLine(string.Format("this.{0}Object = EditorGUI.ObjectField(DrawRects.{1}, this.{2}Object, typeof(UnityEngine.Object), {3});",
         this.Name, this.Name, this.Name, (this.allowSceneObject ? "true" : "false")));
 }
コード例 #42
0
ファイル: UFControl.cs プロジェクト: hidakas/uForms
 public void WriteDefinitionCode(CodeBuilder builder)
 {
     builder.WriteLine("private " + this.GetType().Name + " " + this.Name + ";");
 }
コード例 #43
0
ファイル: UFControl.cs プロジェクト: hidakas/uForms
 public void WriteNativeRectDefinitionCode(CodeBuilder builder)
 {
     builder.WriteLine("public static readonly Rect {0} = new Rect({1}f, {2}f, {3}f, {4}f);",
         this.Name, this.DrawRect.x, this.DrawRect.y, this.DrawRect.width, this.DrawRect.height);
 }
コード例 #44
0
ファイル: UFTextField.cs プロジェクト: icansmile/UGUITest
 public override void WriteNativeVariableDefinitionCode(CodeBuilder builder)
 {
     builder.WriteLine(string.Format("private string {0}Text = \"{1}\";", this.Name, this.Text));
 }
コード例 #45
0
ファイル: UFImage.cs プロジェクト: wolfreak99/uForms
 public override void WriteNativeContentDefinitionCode(CodeBuilder builder)
 {
     builder.WriteLine("public static readonly GUIContent {0} = new GUIContent({1});",
                       this.Name, "AssetDatabase.LoadAssetAtPath<Texture>(AssetDatabase.GUIDToAssetPath(\"" + this.GUID + "\"))");
 }
コード例 #46
0
ファイル: UFTextField.cs プロジェクト: icansmile/UGUITest
 public override void WriteNativeCodeByRect(CodeBuilder builder)
 {
     builder.WriteLine(string.Format("this.{0}Text = EditorGUI.TextField(DrawRects.{1}, this.{2}Text);",
                                     this.Name, this.Name, this.Name));
 }
コード例 #47
0
ファイル: UFLabel.cs プロジェクト: wolfreak99/uForms
 public override void WriteNativeCodeByRect(CodeBuilder builder)
 {
     builder.WriteLine("GUI.Label(DrawRects.{0}, DrawContents.{1});", this.Name, this.Name);
 }
コード例 #48
0
ファイル: UFTextField.cs プロジェクト: hidakas/uForms
 public override void WriteNativeCodeByRect(CodeBuilder builder)
 {
     builder.WriteLine(string.Format("this.{0}Text = EditorGUI.TextField(DrawRects.{1}, this.{2}Text);",
         this.Name, this.Name, this.Name));
 }