Example #1
0
        /// <summary>
        /// Constructs a new <see cref="Nwn2TriggerControl"/> instance.
        /// </summary>
        public Nwn2SlotTrigger(Fitter raiserFitter, string text1, string text2)
        {
            if (raiserFitter == null)
            {
                throw new ArgumentNullException("raiserFitter");
            }

            this.addressFactory = new Nwn2AddressFactory();

            raiserSlot = new BlockSlot("raiser", raiserFitter);
            raiserSlot.BorderThickness = new Thickness(1);
            raiserSlot.Padding         = new Thickness(4);
            raiserSlot.LayoutTransform = scaleTransform;

            InitializeComponent();

            this.text1.Text = text1;
            this.text2.Text = text2;

            raiserSlot.MoveableChanged += delegate
            {
                OnChanged(new EventArgs());
            };

            mainPanel.Children.Insert(1, raiserSlot);
        }
Example #2
0
    private void OnTriggerStay(Collider other)
    {
        if (_tryToConnect)
        {
            if (_connectedSlot != null)
            {
                _connectedSlot.Disconnect(this);
                _connectedSlot = null;
            }

            var slot = other.gameObject.GetComponent <BlockSlot>();
            if (slot == null)
            {
                return;
            }

            slot.Connect(this);
            _connectedSlot = slot;
        }

        _tryToConnect = false;
    }
Example #3
0
 public override bool CompatibleWith(BlockSlot other)
 {
     return(other is Joint);
 }
Example #4
0
 public override bool CompatibleWith(BlockSlot other)
 {
     return(other is FlatSpace);
 }
Example #5
0
 public abstract bool CompatibleWith(BlockSlot other);