Esempio n. 1
0
        public void Detach()
        {
            if (!isFitted)
            {
                return;
            }

            MasterAudio.PlaySound3DAtTransform("CarBuilding", partTrigger.transform, 1f, 1f, 0f, "disassemble");
            gameObject.tag   = "PART";
            transform.parent = null;
            if (!destroyRigidbody)
            {
                rb.isKinematic      = false;
                rb.useGravity       = true;
                rb.detectCollisions = true;
            }
            attachmentTrigger.enabled = true;
            isFitted = false;
            StartCoroutine(FixParent(null));
            if (disableColliders && !destroyRigidbody)
            {
                rb.detectCollisions = true;
            }
            StartCoroutine(LateDetach());
            if (boltParent != null)
            {
                boltParent.SetActive(false);
            }
            OnDetach?.Invoke();
            if (boltParent != null && bolts.Length != 0)
            {
                UntightenAllBolts();
            }
        }
Esempio n. 2
0
 protected void RaiseDetachEvent(HealthHaver check)
 {
     if (check == hh && IsAbsorbed())
     {
         OnDetach?.Invoke();
         RaiseChangeEvent();
     }
 }
Esempio n. 3
0
        /// <summary>
        /// 分离  左键弹开自动分离
        /// </summary>
        public void Detach()
        {
            AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this.host);

            if (adornerLayer != null)
            {
                adornerLayer.Remove(this);
                OnDetach?.Invoke(this, this.getEventArgs());
            }
        }
Esempio n. 4
0
 protected void RaiseDetachEvent()
 {
     antiStackOverflow++;
     if (antiStackOverflow >= 500)
     {
         return;
     }
     OnDetach?.Invoke();
     RaiseChangeEvent();
 }
        public virtual void DetachFrom(IDCLEntity entity, System.Type overridenAttachedType = null)
        {
            if (!attachedEntities.Contains(entity))
            {
                return;
            }

            entity.OnRemoved -= OnEntityRemoved;

            System.Type thisType = overridenAttachedType != null ? overridenAttachedType : GetType();
            entity.RemoveSharedComponent(thisType, false);

            attachedEntities.Remove(entity);

            OnDetach?.Invoke(entity);
        }
Esempio n. 6
0
 public void Detach()
 {
     _workerTask.ContinueWith(t =>
     {
         try
         {
             DataTarget.DebuggerInterface.DetachProcesses();
         }
         finally
         {
             try
             {
                 Dispose(true);
                 OnDetach?.Invoke();
             }
             catch { }
         }
     });
 }
Esempio n. 7
0
        public void Detach(OverlayResult overlayDataResult)
        {
            var item = _overlayReferences.Find(p => p.OverlayReferenceId == overlayDataResult.OverlayRef);

            if (item == null)
            {
                return;
            }

            _overlayReferences.Remove(item);

            if (!_overlayReferences.Any())
            {
                _sequenceNumber = 0;
            }

            OnDetach?.Invoke(overlayDataResult);

            item.CloseOverlayReference(overlayDataResult);
        }
 internal void InvokeOnDetach() => OnDetach?.Invoke(this);
Esempio n. 9
0
 protected override bool ReleaseHandle()
 {
     OnDetach?.Invoke();
     return(Kernel.CloseHandle(handle));
 }
Esempio n. 10
0
 protected override void Detach()
 {
     OnDetach?.Invoke(this, new EventArgs());
 }
Esempio n. 11
0
 protected void RaiseOnDetach() => OnDetach?.Invoke(this);