/// <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); }
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; }
public override bool CompatibleWith(BlockSlot other) { return(other is Joint); }
public override bool CompatibleWith(BlockSlot other) { return(other is FlatSpace); }
public abstract bool CompatibleWith(BlockSlot other);