Ejemplo n.º 1
0
        protected virtual void RegisterTarget(IServiceProvider serviceProvider)
        {
            var    provideValueTarget = serviceProvider.GetService(typeof(IProvideValueTarget)) as IProvideValueTarget;
            object target             = provideValueTarget.TargetObject;

            if (target != null)
            {
                TargetProperty = provideValueTarget.TargetProperty;
                TargetObjects.Add(new WeakReference(target));
            }
        }
        protected virtual void AvailableObjectsList_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            ListBox listBox = (ListBox)sender;

            if (listBox.SelectedIndex < 0)
            {
                return;
            }

            ObjectOfAlbertrizal objectOfAlbertrizal = StoredObjects[listBox.SelectedIndex];

            TargetObjects.Add(objectOfAlbertrizal);
            AddedObjectsList.Items.Add(objectOfAlbertrizal);
            ListChanged();
        }
Ejemplo n.º 3
0
 public void AddTargetObject(GameObject gameObject)
 {
     TargetObjects.Add(gameObject);
     _safeDistances.Add(this.HitboxRadius + gameObject.HitboxRadius);
 }