public void playerPress(int buttonId) { if (!generatedSequence.Equals("")) { Debug.Log("Generated seq: " + generatedSequence); char seqChar = generatedSequence.ToCharArray() [matchedButtons]; int seqNum = (int)(seqChar) - (int)('0'); // transform for char to integer if (seqNum == buttonId) { ++matchedButtons; Debug.Log(" ---> match ok"); if (matchedButtons == sequenceLength) { if (unlockProgram != null) { unlockProgram.startProgram(0); matchedButtons = 0; } } } else { matchedButtons = 0; Debug.Log(" ---> match is SHIT"); } } }
void OnTriggerEnter(Collider other) { if (RecoilRemain > 0.0f) { return; } if (!isEnabled) { return; } if (other.tag == "Player") { if (reenableAutocloseOnTrigger) { autocloseEnable = true; // Carlos } if (!permissionVariable.Equals("")) { bool willOpen = false; if (!permissionVariable.Equals("")) { willOpen = level.retrieveBoolValue(permissionVariable); } else { willOpen = true; } if (willOpen) { open(); } else // no permission !! { if (noPermissionProgram_N != null) { noPermissionProgram_N.startProgram(0); // igual para better door 2!!! } } } else { open(); } } else if (other.tag == "NPCAuto") { open(); } }
public void toggleData(int pos) { if (stopOnSuccess && succeded) { return; } data [pos] = !data [pos]; if (checkKey()) { watchMeSucceed = true; if (successProgram_N != null) { successProgram_N.startProgram(0); } } }
/*void OnTriggerEnter(Collider other) { * * if (other.tag == "Player") { * meditationStatus = MeditationStatus.meditating; * player = other.gameObject.GetComponent<PlayerScript> (); * player.meditate (); * } * * }*/ override public void effect() { meditationState = MeditationState.waitingForChispa; player.blockControls(); player.setOrientation(0); if (!dark) { if (effectProgram != null) { effectProgram.startProgram(0); } } else { player.meditate(); } }
public void _wm_toggleAccomplishment(int position) { accomplished [position] = !accomplished [position]; lvl.storeBoolValue(this.name + "Accomplised" + position, accomplished[position]); bool allDone = true; foreach (bool c in accomplished) { if (c == false) { allDone = false; break; } } if (allDone) { //fakePanel._wm_open (); //direction._wm_enable(); //inclination._wm_enable(); //player.blocked = true; //cameraSwitch._wm_switchToCameraName("L3VerdeSecretCamera"); AllDoneProgram.startProgram(0); } }
public void action() { int leverOK = 0; for (int i = 0; i < levers.Length; ++i) { if (levers [i].isActivated()) { ++leverOK; } } if (leverOK == levers.Length) { if ((level != null) && (prizeSound != null)) { level.playSound(prizeSound); if (prizeProgram != null) { prizeProgram.startProgram(0); } } } }
new void Update() { if (autopilotState == PlayerAutopilotState.idle) { } if (autopilotState == PlayerAutopilotState.seeking1) { if (!isWaitingForActionToComplete) { //hGlow.glow (); //player._wa_autopilotTo (this, this.transform.position - new Vector3 (0, 0, 5.02f)); player.setOrientation(4); // looking back autopilotState = PlayerAutopilotState.seeking2; } } if (autopilotState == PlayerAutopilotState.seeking2) { if (!isWaitingForActionToComplete) { if (hGlow != null) { hGlow.glow(); } if (energyBurstPrefab != null) // if mirror is light mirror { HeroReflection.GetComponent <Renderer> ().material.mainTexture = HeroImage; HeroReflection.GetComponent <Renderer> ().enabled = true; HeroReflection.GetComponent <TextureFader> ().fadeIn(); //camManager.moveRelative (new Vector3(0, -0.3f, 8.0f)); player.blockControls(); autopilotState = PlayerAutopilotState.waitingForBurst; GameObject go = (GameObject)Instantiate(energyBurstPrefab, this.gameObject.transform.position, Quaternion.Euler(0, 0, 0)); energyBurst = go.GetComponent <MirrorHeroEnergyBurst> (); energyBurst.mirrorGO = this.gameObject; energyBurst.playerGO = player.gameObject; ParticleSystem s = go.GetComponent <ParticleSystem> (); s.startColor = new Color(color.r, color.g, color.b, 1.0f); energyBurst.initialize(); energyBurst._wm_go(); this.GetComponent <SphereCollider> ().center = Vector3.down * 200; this.state = MirrorState.deactivated; this.interactEnabled = false; deactivate(); substate = 0; //animAux.Break (); not yet } else // if mirror is dark mirror { player.blockControls(); spawnControl.callShadows(this.transform.position); autopilotState = PlayerAutopilotState.seeking3; elapsedTime = 0.0f; } } } if (autopilotState == PlayerAutopilotState.waitingForBurst) { if (substate == 0) { if (energyBurst != null && energyBurst.state > 2) { //player.unblockControls (); Destroy(energyBurst.gameObject); if (hGlow != null) { hGlow.glow(); } camManager.moveToOriginalPosition(); HeroReflection.GetComponent <TextureFader> ().fadeOut(); //autopilotState = PlayerAutopilotState.idle; ++substate; elapsedTime = 0.0f; } } if (substate == 1) { elapsedTime += Time.deltaTime; if (elapsedTime > 2.0f) { ++substate; //HeroReflection.GetComponent<Renderer> ().enabled = false; //this.GetComponent<SphereCollider> ().enabled = false; animAux.Break(); string lvl = level.locationName.Substring(0, 6); ds.storeBoolValue(lvl + MirrorColor + "MirrorDepleted", true); //ds.storeBoolValue ("CurrentLevelHasHero" + HeroType, true); ds.storeBoolValue("Has" + lvl + HeroType, true); ds.storeBoolValue("Has" + lvl + HeroType + (indexHero - 1), true); ds.storeIntValue("Has" + lvl + HeroType, indexHero - 1); elapsedTime = 0.0f; } } if (substate == 2) { elapsedTime += Time.deltaTime; if (elapsedTime > 2.0f) { if (NewHeroProgram != null) { NewHeroProgram.startProgram(0); } else { player.unblockControls(); } autopilotState = PlayerAutopilotState.idle; level.mcRef.saveGame(true); } } } if (autopilotState == PlayerAutopilotState.seeking3) { elapsedTime += Time.deltaTime; if (elapsedTime > 12.0f) { player.enterMirror(); elapsedTime = 0.0f; autopilotState = PlayerAutopilotState.seeking4; } } if (autopilotState == PlayerAutopilotState.seeking4) { elapsedTime += Time.deltaTime; if (elapsedTime > 1.9f && !grabbingFrame) { level.grabFrame(); grabbingFrame = true; } if (elapsedTime > 2.0f) { level.storeStringValue("ReturnLocation", level.locationName); level.storeStringValue("CurrentMirror", level.locationName + "DarkMirrorActivated"); level.storeStringValue("CurrentLevel", level.locationName); level.loadScene("WordFight"); } } if (state == MirrorState.deactivated) { interactEnabled = false; glowMat.SetColor("_TintColor", new Color(0, 0, 0, 0)); } if (state == MirrorState.activating) { elapsedTime += Time.deltaTime; if (elapsedTime > initialDelay) { state = MirrorState.activated; elapsedTime = 0.0f; } } if (state == MirrorState.activated) { elapsedTime += Time.deltaTime; glowMat.SetColor("_TintColor", new Color(color.r, color.g, color.b, opacity * (1.0f + Mathf.Cos(tremoloAngle) / 12.0f))); tremoloAngle += tremoloAngleSpeed * Time.deltaTime; if (opacity < 0.19f) { opacity += opacitySpeed * Time.deltaTime; } light.intensity = 0.5f + 0.5f * Mathf.Sin(elapsedTime * angleSpeed); mat.SetColor("_EmissionColor", color * light.intensity / 8.0f); } }