void OnTriggerEnter(Collider collider) { if (collider.tag == "Player") { Gate.Open(); SoundOrigin.PlaySound(ClickSound); } }
private void OnTriggerEnter2D() { sprite.color = activatedColor; linkedGate.Open(); activationSound.Play(); // Once the gate has been triggered to open, the switch can safely be disabled. GetComponent <Collider2D>().enabled = false; }
public void GateEntered() { if (!_isPlayerAtGate) { //Debug.Log("yo you entered the gate to heaven"); _gateController.Open(); _isPlayerAtGate = true; PayGhosts(); } }
private void OpenGate() { if (activeGateController.IsClosed() && !activeGateController.IsSealed()) { //DLog.Log("Open gate"); int indexOfActiveStage = stages.IndexOf(activeStage); NotifyStageCycle(indexOfActiveStage + 1, StageCycle.Clear); activeGateController.Open(); activeGateComponent = new GateComponent(activeGateController); AddComponent(activeGateComponent); } }
public IEnumerator GateShouldOpenUp() { GateController gc = GameObject.Find("RedGate").GetComponent <GateController>(); gc.OpenDirection = Direction.Up; Vector3 startPos = gc.transform.position; Vector3 assumedEndPos = new Vector3(startPos.x, startPos.y, startPos.z + 1); gc.Open(); yield return(new WaitForSeconds(waitTime)); Assert.True(gc.transform.position == assumedEndPos); }
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); }