public void AddWire(IWire wire) { if (wire == null) { Debug.LogError(string.Format("Error in {0} Wire can't be null.", this)); return; } if (HasWire(wire.Name)) { Debug.LogError(string.Format("Error in {0} Wire '{1}' already registered.", this, wire.Name)); return; } lock (_wires) { _wires.Add(wire.Name, wire); wire.Dispatcher = _dispatcher; wire.Init(); } }