private void WaitForStageActivatorToActiveThenMoveToNextStage() { if (!activeStageActivator.IsActive()) { return; } isGateOpenedLastTimeCheck = false; //close and seal the gate so that it would not be opened again //DLog.Log("Close gate"); activeGateController.Close(); activeGateController.Seal(); int indexOfActiveStageActivator = stageActivators.IndexOf(activeStageActivator); if (indexOfActiveStageActivator < stageActivators.Count - 1) { activeStageActivator = stageActivators[indexOfActiveStageActivator + 1]; components.Remove(activeStageActivatorComponent); } int indexOfActiveGate = gates.IndexOf(activeGateController); if (indexOfActiveGate < gates.Count - 1) { activeGateController = gates[indexOfActiveGate + 1]; // components.Remove(activeGateComponent); } MoveToNextStage(); }
public void GateLeft() { if (_isPlayerAtGate) { //Debug.Log("yo you left the gate :("); _gateController.Close(); _isPlayerAtGate = false; } }
public IEnumerator GateShouldComeBackToOriginalPositionWhenClosing() { GateController gc = GameObject.Find("RedGate").GetComponent <GateController>(); gc.OpenDirection = Direction.Down; Vector3 startPos = gc.transform.position; gc.Open(); yield return(new WaitForSeconds(waitTime)); gc.Close(); yield return(new WaitForSeconds(waitTime)); Assert.True(gc.transform.position == startPos); }