Пример #1
0
 void Update()
 {
     if (!mechanism.On && mechanism.IsOn())
     {
         if (working)
         {
             SetActivated(true);
         }
     }
     else if (mechanism.On && !mechanism.IsOn())
     {
         SetActivated(false);
     }
 }
Пример #2
0
 void Update()
 {
     sprite.color = mechanism.IsOn() ? Color.green : Color.red;
 }