protected override void CreateUI() { const float indent = 12; CView contentView = new CView(this.Width - 2 * indent, this.Height - 2 * indent); contentView.X = indent; contentView.Y = indent; AddSubview(contentView); GUIStyle titleStyle = new GUIStyle(GUI.skin.label); titleStyle.fontSize = 20; CLabel titleLabel = new CLabel("Lunar Plugin for Unity", titleStyle); contentView.AddSubview(titleLabel); CLabel copyrightLabel = new CLabel("(C) 2015 Space Madness", EditorStyles.miniLabel); copyrightLabel.Height += 20; contentView.AddSubview(copyrightLabel); CView buttonsView = new CView(); CButton twitterButton = new CButton("Follow @LunarPlugin", delegate(CButton button) { Application.OpenURL("https://twitter.com/intent/follow?screen_name=LunarPlugin&user_id=2939274198"); }); twitterButton.Width = contentView.Width; buttonsView.AddSubview(twitterButton); CButton facebookButton = new CButton("Facebook Page", delegate(CButton button) { Application.OpenURL("https://www.facebook.com/LunarPlugin"); }); facebookButton.Width = contentView.Width; buttonsView.AddSubview(facebookButton); CButton emailButton = new CButton("Send Email", delegate(CButton button) { Application.OpenURL("mailto:[email protected]?subject=Lunar%20plugin%20feedback&body=Hey%20Alex%2C%0A%0AI%27ve%20just%20checked%20the%20Lunar%20plugin.%20Nice%20job%2C%20man%21%20Still%2C%20there%27s%20some%20stuff%20I%20don%27t%20really%20like.%20For%20example%2C%20...%0A%0AFix%20it%2C%20you%20son%20of%20a%20bitch%2C%20or%20go%20to%20Hell%21%0A%0ASincerely%2C%0A%0AYour%20Lunar%20Plugin%20User"); }); emailButton.Width = contentView.Width; buttonsView.AddSubview(emailButton); buttonsView.ArrangeVert(5); buttonsView.ResizeToFitSubviews(); buttonsView.Height += 20; contentView.AddSubview(buttonsView); contentView.ArrangeVert(); CLabel thanksLabel = new CLabel("Thanks for using Lunar!"); contentView.AddSubview(thanksLabel); thanksLabel.Align(0.5f, 1.0f); }
public void AddSubview(CView view) { m_rootView.AddSubview(view); }