// Use this for initialization void Start() { valor = new string[MAXVALUES]; /* load contents from Rosetta */ for (int i = 0; i < MAXVALUES; ++i) { valor [i] = rosetta.retrieveString("ValuesScale" + scaleName + i); } DataStorage ds = mcRef.getStorage(); bool init; init = ds.retrieveBoolValue("ValueScale" + scaleName + "Init"); if (init) // order is extracted from MasterController { for (int i = 0; i < MAXVALUES; ++i) { order [i] = ds.retrieveIntValue("ValueScale" + scaleName + i); } } else // need to initialize { order = new int[MAXVALUES]; for (int i = 0; i < MAXVALUES; ++i) { order [i] = i; ds.storeIntValue("ValueScale" + scaleName + i, i); } } }
void Update() { contador += Time.deltaTime; if (contador > 3 && estado == "") { Initializate(); } if (mcref != null) { started = mcref.getStorage().retrieveBoolValue("ConversationManaDone"); finished = mcref.getStorage().retrieveBoolValue("PozoSabiduriaFinished"); } if ((alert.state == alertImageController.State.Closed) && (estado == "start")) { charGen.startProgram(0); estado = "checked"; } if (!finished && started && estado == "checked") { FadeIn(); } if (finished) { FadeOut(); } }
public static void resetFerfufloAnswers(MasterControllerScript mc) { int completed = 0; int correct = 0; for (int i = 3; i <= 18; ++i) { for (int j = 0; j < sabiasNItems[i - 3]; ++j) { mc.getStorage().storeIntValue("Ferfuflo" + i + "+1" + j, 0); } for (int j = 0; j < ignorantesNItems [i - 3]; ++j) { mc.getStorage().storeIntValue("Ferfuflo" + i + "-1" + j, 0); } } for (int i = 0; i < ids.Length; ++i) { mc.getStorage().storeIntValue("TVFerfuflosTimes" + ids[i], 0); } mc.getStorage().storeIntValue("FerfufloCompleted", 0); mc.getStorage().storeIntValue("FerfufloCorrect", 0); }
// Use this for initialization void Start() { current = grass; aSource = this.GetComponent <AudioSource> (); DontDestroyOnLoad(this.gameObject); ds = mc.getStorage(); }
public void _wm_updatePos(string nameOfObject) { GameObject obj = GameObject.Find(nameOfObject); this.transform.position = obj.transform.position - new Vector3(0, 0, 3); mc.getStorage().storeFloatValue("GoBackSignsX", this.transform.position.x); mc.getStorage().storeFloatValue("GoBackSignsY", this.transform.position.y); mc.getStorage().storeFloatValue("GoBackSignsZ", this.transform.position.z); }
new void Start() { lose = false; fRef = UIFader.GetComponent <UIFaderScript> (); fRef.setFadeValue(0.0f); fRef.Initialize(); fRef.fadeIn(); finished = false; mcRef = GameObject.Find("MasterController").GetComponent <MasterControllerScript> (); if (mcRef != null) { sentenceBits = mcRef.getSentencePieces().ToArray(); } nPieces = sentenceBits.Length; bitGO = new GameObject[nPieces]; actionState = 0; for (int i = 0; i < nPieces; ++i) { bitGO[i] = new GameObject(); SentenceBit newBit; newBit = bitGO [i].AddComponent <SentenceBit> (); newBit.Initialize(); newBit.setText(sentenceBits [i]); newBit.randomizePosition(volumeRadius); newBit.randomizeSpeed(); newBit.setCamera(cam); newBit.order = i; newBit.parent = this; newBit.setPosition(new Vector3(0, 0, 0)); bitGO [i].name = "SentenceBit" + i; } completeSentence = sentenceBits [0]; for (int i = 1; i < sentenceBits.Length; ++i) { completeSentence = completeSentence + " " + sentenceBits [i]; } setText(""); mcRef.getStorage().storeStringValue("ReturnFromActivity", "Well"); mcRef.getStorage().storeIntValue("ActivityResult", 0); isWaitingForActionToComplete = true; }
public void _wm_turnOnLight() { for (int i = 0; i < hiddenThing.Length; ++i) { hiddenThing[i].SetActive(false); } light.intensity = originalIntensity; light.color = originalColor; RenderSettings.ambientLight = ambientColor; state = true; mc.getStorage().storeBoolValue(this.name, false); }
void OnTriggerEnter(Collider other) { // Only the player can pick up things and stuff... if (other.tag != "Player") { return; } if (other.name == "Main Camera") { return; } //Debug.Log ("<color=purple>" + other.name + " entered " + this.name + "</color>"); if (pickable) { MasterControllerScript mcRef = GameObject.Find("MasterController").GetComponent <MasterControllerScript>(); // search for program index for event "onPickup" int i = programIndexFromEventName("onPickup"); if (i != -1) // if successfully found... { startProgram(i); // start the program } if (FlameHeroClass > 0) // if it is a flame, a little ad-hoc solution //string lvl = GameObject.Find("LevelController").GetComponent<LevelControllerScript>().locationName.Substring(0, 6); { string lvl = SceneManager.GetActiveScene().name; mcRef.getStorage().storeStringValue("CurrentLevelFlame", lvl); mcRef.getStorage().storeIntValue("CurrentFlameIndex", FlameHeroClass - 1); mcRef.getStorage().storeIntValue("QAHeroClass" + lvl + (FlameHeroClass - 1), FlameHeroClass - 1); // a little ad-hoc solution // store flame related data in case we have to resurrect the flame mcRef.getStorage().storeStringValue("FlameResurrectionName" + lvl + (FlameHeroClass - 1), this.name); mcRef.getStorage().storeStringValue("FlameResurrectionLocation" + lvl + (FlameHeroClass - 1), lvl); } mcRef.registerPickedUpObject(this.name); } if (!interactEnabled) { return; } int j = programIndexFromEventName("onOverlap"); if (j != -1) { startProgram(j); } }
// Start is called before the first frame update void Start() { mc = FindObjectOfType <MasterControllerScript>(); Vector3 storedPos = new Vector3( mc.getStorage().retrieveFloatValue("GoBackSignsX"), mc.getStorage().retrieveFloatValue("GoBackSignsY"), mc.getStorage().retrieveFloatValue("GoBackSignsZ")); if (storedPos.magnitude > 0.01f) { this.transform.position = storedPos; } }
public void _wm_open() { if (state == DoorState.Closed) { state = DoorState.Opening; } if ((openSound != null) && (level != null)) { level.playSound(openSound); } masterController.getStorage().storeBoolValue("IsDoor" + this.name + "Open", true); }
// Update is called once per frame void Update() { if (mc.getStorage().retrieveStringValue("FollowingChar").Equals("")) { extraNeed = 0; } else { extraNeed = 1; } if ((genteInside > 0) && (genteInside < (elementsNeededForLift + extraNeed))) { for (int i = 0; i < autoDoor.Length; ++i) { autoDoor [i].setAutocloseHijack(true); // if (autoDoor [i].isClosing ()) // autoDoor [i].open (); } } else { for (int i = 0; i < autoDoor.Length; ++i) { autoDoor [i].setAutocloseHijack(false); } } }
void Start() { MasterControllerScript masterController = GameObject.Find("MasterController").GetComponent <MasterControllerScript> (); ds = masterController.getStorage(); locale = masterController.getLocale(); //Borrar luego ds.storeStringValue("TheaterFolder", "Yogi1"); folderToPlay = ds.retrieveStringValue("TheaterFolder"); AudioRosetta aros = GameObject.Find("AudioRosetta").GetComponent <AudioRosetta> (); audio = aros.returnClip("video/" + folderToPlay + "/audio"); if (audio != null) { this.GetComponent <AudioSource> ().PlayOneShot(audio); } string path = "FinalAssets/Textures/Videos/" + folderToPlay + "/0"; t1 = Resources.Load <Texture> (path); path = "FinalAssets/Textures/Videos/" + folderToPlay + "/audio"; clip = Resources.Load <AudioClip> (path); raw1.texture = t1; path = "FinalAssets/Textures/Videos/" + folderToPlay + "/1"; t2 = Resources.Load <Texture> (path); if (t2 != null) { raw2.texture = t2; } else { raw2.color = new Color(0, 0, 0, 1); } even = true; transitioning = false; image = 0; frameScale = 2.2f; scale1 = 2.0f; frameTransform.localScale = new Vector2(1.0f + frameScale, 1.0f + frameScale); imageDuration1 = imageDurationList.duration [0]; if (imageDurationList.duration.Length > 1) { imageDuration2 = imageDurationList.duration [1]; } else { imageDuration2 = 1.0f; } finishActivity = false; }
// Update is called once per frame void Update() { if (www != null) { if (www.isDone) { if (state == 0) { bool res; bool.TryParse(www.text, out res); if (res == true) { mcRef.getStorage().storeBoolValue("UserIsConfirmed", true); mcRef.saveGame(false); mcRef.setActivityFinished(); } else { } www = null; state = 1; } else { finishActivity(); www = null; } } } }
// Use this for initialization new void Start() { mcRef = GameObject.Find("MasterController").GetComponent <MasterControllerScript> (); rosetta = GameObject.Find("Rosetta").GetComponent <Rosetta> (); ds = mcRef.getStorage(); visitNumber = ds.retrieveIntValue("TopFloorVisitNumber"); bank = stringBankCol.getBank(visitNumber); bank.rosetta = rosetta; bank.reset(); int nFloaters; nFloaters = bank.nItems(); floater = new HeavyLevitatingFollower[nFloaters]; for (int i = 0; i < nFloaters; ++i) { Vector3 newPos = player.transform.position; newPos.x -= 5 * i; GameObject newFloater = (GameObject)Instantiate(floaterPrefab, newPos, Quaternion.Euler(0, 0, 0)); floater [i] = newFloater.GetComponent <HeavyLevitatingFollower> (); floater [i].player = player; floater [i].nearRadius = 2.0f + i * 1.0f; floater [i].initialize(); } questionNumber = 0; }
//public float numberOfSecondsToVanish = 0.5f; void Start() { mat = this.GetComponent <Renderer> ().material; mcRef = GameObject.Find("MasterController").GetComponent <MasterControllerScript>(); ds = mcRef.getStorage(); string currentLvl = ds.retrieveStringValue("CurrentLevel").Substring(0, 6); // ds.storeBoolValue (currentLvl + "HasHeroPhilosopher", true); // ds.storeBoolValue (currentLvl + "HasHeroMaster", true); // ds.storeBoolValue (currentLvl + "HasHeroSage", true); // ds.storeBoolValue (currentLvl + "HasHeroYogui", true); if (ds.retrieveBoolValue("Has" + currentLvl + wisdom)) { this.GetComponent <Collider> ().enabled = true; opacity = targetOpacity = 1.0f; opacitySpeed = opacitySpeed * 4; } else { this.GetComponent <Collider> ().enabled = false; opacity = targetOpacity = 0.25f; } mat.SetColor("_Tint", new Color(1, 1, 1, opacity)); }
// Use this for initialization new void Start() { level = GameObject.Find("LevelController").GetComponent <LevelControllerScript> (); master = GameObject.Find("MasterController").GetComponent <MasterControllerScript> (); ds = master.getStorage(); originalPos = this.transform.position; bool isOpen = ds.retrieveBoolValue(PanelID + "isOpen"); if (isOpen) { X = targetX = displacedX; switch (axis) { case FakePanelAxis.x: this.transform.position = new Vector3(originalPos.x + X, originalPos.y, originalPos.z); break; case FakePanelAxis.y: this.transform.position = new Vector3(originalPos.x, originalPos.y + X, originalPos.z); break; case FakePanelAxis.z: this.transform.position = new Vector3(originalPos.x, originalPos.y, originalPos.z + X); break; } } else { X = targetX = 0.0f; } }
void Start() { masterController = GameObject.Find("MasterController").GetComponent <MasterControllerScript> (); ds = masterController.getStorage(); cam = GameObject.Find("CameraLerp").GetComponent <CameraManager> (); level = GameObject.Find("LevelController").GetComponent <LevelControllerScript> (); }
// Update is called once per frame void Update() { if (www != null) { if (www.isDone) { bool res; bool.TryParse(www.text, out res); if (res == true) { masterController.getStorage().storeBoolValue("UserIsConfirmed", true); masterController.saveGame(false); } else { // tough titty } Destroy(this.gameObject); } } else { ++nullFrames; } if (nullFrames >= MaxNullFrames) { Destroy(this.gameObject); } }
// Update is called once per frame new void Update() { if (Input.GetMouseButtonDown(0)) { clickPosition = Input.mousePosition; } if (Input.GetMouseButton(0)) { Vector2 currentPos = Input.mousePosition; deltaY = currentPos.y - clickPosition.y; dialogueController.setScroll(lastScroll + deltaY); } if (Input.GetMouseButtonUp(0)) { lastScroll += deltaY; if (lastScroll > dialogueController.getMaxScroll()) { lastScroll = dialogueController.getMaxScroll(); } if (lastScroll < dialogueController.getMinScroll()) { lastScroll = dialogueController.getMinScroll(); } } if (status == AlphabetState.exitting) { if (!isWaitingForActionToComplete) { if (mcRef == null) { return; } DataStorage ds = mcRef.getStorage(); string returnLevel = ds.retrieveStringValue("ReturnLocation"); if (!returnLevel.Equals("")) { SceneManager.LoadScene(returnLevel); } } } if (scrollbar.gameObject.activeSelf) { float viewportHeight = container.GetComponent <RectTransform> ().rect.height - 106; float maxHeight = conversationList.Count * 100; float scrollvalue = scrollbar.GetComponent <Scrollbar> ().value; float yPos = scrollvalue * (maxHeight - viewportHeight); Vector3 pos = container.transform.position; pos.y = Screen.height / 2 + yPos; container.transform.position = pos; } }
new void Start() { mcRef = GameObject.Find("MasterController").GetComponent <MasterControllerScript> (); done = mcRef.getStorage().retrieveBoolValue(nameKey); isOn = false; angle = targetAngle = offAngle; source = this.GetComponent <AudioSource> (); lever.transform.localRotation = Quaternion.Euler(angle, 0, 0); }
// Use this for initialization new void Start() { fire = this.GetComponent <DigitalRuby.PyroParticles.FireConstantBaseScript> (); masterController = GameObject.Find("MasterController").GetComponent <MasterControllerScript> (); if (masterController.getStorage().retrieveBoolValue("HasFireBeenExtinguised")) { fire.Stop(); } }
// Use this for initialization void Start() { MasterControllerScript mc = GameObject.Find("MasterController").GetComponent <MasterControllerScript> (); if (mc.getStorage().retrieveStringValue("FollowingChar").Equals("")) { Destroy(GameObject.Find("Estudiante")); } }
// Update is called once per frame void Update() { z += speed * Time.deltaTime; this.transform.position = new Vector3(this.transform.position.x, this.transform.position.y, z); if (z > maxZ) { string returnLoc = mc.getStorage().retrieveStringValue("ReturnLocation"); SceneManager.LoadScene(returnLoc); } }
// Use this for initialization void Start() { mc = GameObject.Find("MasterController").GetComponent <MasterControllerScript> (); ds = mc.getStorage(); if (ds.retrieveStringValue("FollowingChar").StartsWith("Duende")) { ds.storeStringValue("FollowingChar", ""); ds.storeIntValue("N4DuendeElegido", 0); } }
public void startFollowingPlayer() { autopilotAbsolute = true; followElapsedTime = 0.0f; followState = FollowState.follow; previousWalkSpeed = walkingSpeed; walkingSpeed = player.modulusSpeed; if (walkingSpeed == 0.0f) { walkingSpeed = player.speed; } if (mcRef == null) { mcRef = GameObject.Find("MasterController").GetComponent <MasterControllerScript> (); } mcRef.getStorage().storeStringValue("FollowingChar", this.name); mcRef.getStorage().storeFloatValue("FollowerRelativeCoordsX", 1.0f); mcRef.getStorage().storeFloatValue("FollowerRelativeCoordsY", 0.0f); mcRef.getStorage().storeFloatValue("FollowerRelativeCoordsZ", -1.0f); }
// Use this for initialization void Start() { mc = GameObject.Find("MasterController").GetComponent <MasterControllerScript> (); for (int i = 0; i < guarda.Length; ++i) { bool clear = mc.getStorage().retrieveBoolValue(prefix + (i + 1) + "Clear"); if (clear) { solveGuardia(i); } } }
public void Refresh() { bool VariableTrue = mc.getStorage().retrieveBoolValue(BoolVariable); if (mode == HOVMode.show) { spriteRenderer.enabled = VariableTrue; } else { spriteRenderer.enabled = !VariableTrue; } }
new void Start() { level = GameObject.Find("LevelController").GetComponent <LevelControllerScript> (); state = DoorState.Closed; isWaitingForActionToComplete = false; angle = -180.0f; audio = this.GetComponent <AudioSource>(); masterController = GameObject.Find("MasterController").GetComponent <MasterControllerScript> (); if (masterController.getStorage().retrieveBoolValue("IsDoor" + this.name + "Open")) { _wm_immediateOpen(); } }
// Use this for initialization void Start() { elapsedTime = 0.0f; rosetta = GameObject.Find("Rosetta").GetComponent <Rosetta> (); tryAgainBank.rosetta = rosetta; tryAgainBank.reset(); t1.text = tryAgainBank.getString(0); t2.text = tryAgainBank.getString(0); mc = GameObject.Find("MasterController").GetComponent <MasterControllerScript> (); ds = mc.getStorage(); aSource = this.GetComponent <AudioSource> (); }
// si está solucionado, matarlo void Start() { mc = GameObject.Find("MasterController").GetComponent <MasterControllerScript> (); DataStorage ds = mc.getStorage(); for (int i = 0; i < duende.Length; ++i) { bool clear = ds.retrieveBoolValue("N4Guardia" + (i + 1) + "Clear"); if (clear) { Destroy(duende [i]); } } }