public SpringControl(AnchorUI picker) { if (picker == null) { throw new ArgumentException(); } this.picker = picker; TabStop = true; }
void Start() { health = maxHealth; GameObject hpbar = GameObject.Instantiate((GameObject)Resources.Load("HealthbarFriendly")); healthbar = hpbar.GetComponent <AnchorUI>(); healthbar.objectToFollow = this.transform; healthbar.gameObject.transform.SetParent(gameManager.canvas1.transform); }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider?.GetService(typeof(IWindowsFormsEditorService)); if (edSvc != null) { if (anchorUI == null) { anchorUI = new AnchorUI(this); } anchorUI.Start(edSvc, value); edSvc.DropDownControl(anchorUI); value = anchorUI.Value; anchorUI.End(); } return(value); }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if (provider != null) { IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService) provider.GetService(typeof(IWindowsFormsEditorService)); if (edSvc == null) { return value; } if (this.anchorUI == null) { this.anchorUI = new AnchorUI(this); } this.anchorUI.Start(edSvc, value); edSvc.DropDownControl(this.anchorUI); value = this.anchorUI.Value; this.anchorUI.End(); } return value; }
/// <summary> /// Edits the given object value using the editor style provided by GetEditorStyle. /// </summary> public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if (provider == null) { return(value); } if (!(provider.GetService(typeof(IWindowsFormsEditorService)) is IWindowsFormsEditorService edSvc)) { return(value); } if (_anchorUI == null) { _anchorUI = new AnchorUI(this); } _anchorUI.Start(edSvc, value); edSvc.DropDownControl(_anchorUI); value = _anchorUI.Value; _anchorUI.End(); return(value); }
public SpringControl(AnchorUI picker) { this.picker = picker ?? throw new ArgumentException(); TabStop = true; }