コード例 #1
0
        private void Update()
        {
            float num = Time.deltaTime * (1f / this._duration);

            if (this._state < AutomatedDoorSystem.State.Opened)
            {
                this._alpha -= num;
                if (this._alpha <= 0f)
                {
                    this._alpha  = 0f;
                    this._state  = AutomatedDoorSystem.State.Closed;
                    base.enabled = false;
                }
            }
            else
            {
                this._alpha += num;
                if (this._alpha >= 1f)
                {
                    this._alpha  = 1f;
                    this._state  = AutomatedDoorSystem.State.Opened;
                    base.enabled = false;
                }
            }
            this.UpdateDoors();
        }
コード例 #2
0
 private void SetState(AutomatedDoorSystem.State state)
 {
     if (this._state != state)
     {
         this._state = state;
         if (this._stateEvents != null)
         {
             foreach (AutomatedDoorSystem.StateEvent stateEvent in this._stateEvents)
             {
                 if (stateEvent._state == state)
                 {
                     stateEvent._callback.Invoke();
                 }
             }
         }
     }
 }
コード例 #3
0
 private void OnTriggerExit(Collider other)
 {
     if (this._state > AutomatedDoorSystem.State.Closing)
     {
         string[] tags = this._tags;
         for (int i = 0; i < tags.Length; i++)
         {
             string tag = tags[i];
             if (other.CompareTag(tag))
             {
                 this._state  = AutomatedDoorSystem.State.Closing;
                 base.enabled = true;
                 break;
             }
         }
     }
 }