Exemplo n.º 1
0
        protected void OnTriggerExit(Collider other)
        {
#if Debug
            print("TriggerExit");
#endif
            ScrewDriver screwDriver = other.GetComponentInParent <ScrewDriver>();
            if (screwDriver && screwDriver.ScrewType == this.ScrewType && IsStarted && !IsFinished)
            {
                ToggleHighlight(false);
            }
        }
Exemplo n.º 2
0
        protected void OnTriggerStay(Collider other)
        {
#if Debug
            //print("TriggerStay");
#endif
            if (currentStep < stepSum)
            {
                ScrewDriver screwDriver = other.GetComponentInParent <ScrewDriver>();
                if (screwDriver && screwDriver.ScrewType == this.ScrewType && screwDriver.InterObject.IsUsing())
                {
                    currentStep++;
                    transform.position = m_originalPos + transform.forward * Mathf.Lerp(0, Depth, (float)currentStep / stepSum);
                }
            }
            if (currentStep >= stepSum)
            {
                // IsFinished = true;
                IsScrewed = true;
                OnFinishSteppedObject(new SteppedObjectEventArgs());
            }
        }