Example #1
0
 public SpringControl(AnchorUI picker)
 {
     if (picker == null)
     {
         throw new ArgumentException();
     }
     this.picker = picker;
     TabStop     = true;
 }
Example #2
0
    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);
    }
Example #3
0
        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;
 }
Example #5
0
        /// <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);
        }
Example #6
0
 public SpringControl(AnchorUI picker)
 {
     this.picker = picker ?? throw new ArgumentException();
     TabStop     = true;
 }