Exemplo n.º 1
0
 protected override void Update()
 {
     base.Update();
     response?.Test(() =>
     {
         if (!Opening)
         {
             Open();
         }
     }, () =>
     {
         if (Opening)
         {
             Close();
         }
     });
 }
Exemplo n.º 2
0
 protected override void Start()
 {
     base.Start();
     @base.localPosition = new Vector3(0.0F, realHeight + 0.1F, 0.0F);
     if (Activator != null)
     {
         response = new SwitchResponse(Activator);
     }
     if (m_DefaultRaised ^ (response != null && response.Test()))
     {
         status = FizzleElevatorStatus.RAISED;
         transform.localPosition = Vector3.zero;
     }
     else
     {
         status = FizzleElevatorStatus.DROPPED;
         transform.localPosition = -transform.up * realHeight;
     }
 }
Exemplo n.º 3
0
        protected override void Update()
        {
            base.Update();
            response?.Test(() =>
            {
                if (!m_DefaultRaised)
                {
                    Raise();
                }
                else
                {
                    Drop();
                }
            }, () =>
            {
                if (!m_DefaultRaised)
                {
                    Drop();
                }
                else
                {
                    Raise();
                }
            });

            if (!isStatic(status))
            {
                PlayLoopSound();
            }

            if (!isStatic(lastStatus) && isStatic(status))
            {
                PlayStopSound();
            }

            lastStatus = status;
        }