public void start() { GenericUpdateData d = TubeSimulate.generic[0].genericUpdateData[idxInUpdateArray]; d.timeLeft = timeToMakeOne; TubeSimulate.generic[0].genericUpdateData[idxInUpdateArray] = d; }
public bool push(ushort itemId) { //Debug.Log("receives " + itemId); for (int i = 0; i < DefaultArraySize; ++i) { if (srcIds[i] == itemId) { srcCurrent[i]++; } } if (allMet() == false) { return(false); } GenericUpdateData d = TubeSimulate.generic[1].genericUpdateData[idxInUpdateArray]; if (d.timeLeft > 0.0f) { return(false); } Debug.Log("converter starts!"); //for (int i = 0; i < DefaultArraySize; ++i) { // srcCurrent[i] = 0; //} startUpdate(); return(true); }
public void startUpdate() { clearCurrent(); GenericUpdateData d = TubeSimulate.generic[1].genericUpdateData[idxInUpdateArray]; d.timeLeft = timeToMakeOne; TubeSimulate.generic[1].genericUpdateData[idxInUpdateArray] = d; }
public void unblock() { GenericUpdateData d = TubeSimulate.generic[1].genericUpdateData[idxInUpdateArray]; if (d.timeLeft >= 0.0f) { return; } }
public void unblock() { GenericUpdateData d = TubeSimulate.generic[0].genericUpdateData[idxInUpdateArray]; if (d.timeLeft <= 0.0f) { start(); } }
// Update is called once per frame void Update() { GenericUpdateData gud = TubeSimulate.generic[1].genericUpdateData[converterId]; timeLeft = gud.timeLeft; ConverterData convDat = TubeSimulate.self.getConverterData(converterId); for (int i = 0; i < current.Length; ++i) { current[i] = convDat.srcCurrent[i]; } }
public void Execute(int index) { GenericUpdateData thisData = dataArray[index]; if (thisData.timeLeft <= 0.0f) { outputOps[index] = 0; } else { thisData.timeLeft -= deltaTime; dataArray[index] = thisData; outputOps[index] = (thisData.timeLeft <= 0.0f) ? (byte)1 : (byte)0; } }