Example #1
0
 public static void CloseImmediately(TSSItem item)
 {
     TSSBehaviour.RemoveItem(item);
     item.state = ItemState.closed;
     item.time  = 0;
     DoAllEffects(item, item.time);
     item.stateChgTime = 0;
 }
Example #2
0
 public static void Open(TSSItem item)
 {
     if (item.openDelay == 0 && item.openDuration == 0)
     {
         OpenImmediately(item); return;
     }
     if (item.state == ItemState.opening || item.state == ItemState.opened)
     {
         return;
     }
     item.stateChgTime       = item.openDelay;
     item.stateChgBranchMode = false;
     if (item.parentChainMode && item.parent.brakeChainDelay)
     {
         item.stateChgTime = item.openDelay * (1 - item.time);
     }
     item.state = ItemState.opening;
     TSSBehaviour.AddItem(item);
 }
Example #3
0
 public static void Close(TSSItem item)
 {
     item.loopActivated = false;
     if (item.closeDelay == 0 && item.closeDuration == 0)
     {
         CloseImmediately(item); return;
     }
     if (item.state == ItemState.closing || item.state == ItemState.closed)
     {
         return;
     }
     item.stateChgTime       = item.closeDelay;
     item.stateChgBranchMode = false;
     if (item.parentChainMode && item.parent.brakeChainDelay)
     {
         item.stateChgTime = item.closeDelay * (item.time);
     }
     item.state = ItemState.closing;
     TSSBehaviour.AddItem(item);
 }