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;
 }