//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)); }
void Start() { DontDestroyOnLoad(this.gameObject); mcRef = GameObject.Find("MasterController").GetComponent <MasterControllerScript> (); currentLevel = mcRef.currentLocation; //ds = GameObject.Find ("MasterController").GetComponent<MasterControllerScript> ().getStorage (); }
// 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(); } }
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; }
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); } }
// 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]); } } }
new public void Start() { if (started) { return; } started = true; if (isDark) { spawnControl = GameObject.Find("ShadowSpawnController").GetComponent <ShadowSpawnController> (); } master = GameObject.Find("MasterController").GetComponent <MasterControllerScript> (); level = GameObject.Find("LevelController").GetComponent <LevelControllerScript> (); ds = master.getStorage(); camManager = GameObject.Find("CameraLerp").GetComponent <CameraManager> (); player = GameObject.Find("Player").GetComponent <PlayerScript> (); opacity = 0.0f; state = MirrorState.deactivated; glowMat = glow.GetComponent <Renderer> ().material; light.color = new Color(color.r, color.g, color.b, 1.0f); light.intensity = 0.0f; elapsedTime = 0.0f; mat = objectWithMaterial.GetComponent <Renderer> ().material; mat.SetColor("_EmissionColor", new Color(0, 0, 0, 0)); glowMat.SetColor("_TintColor", new Color(0, 0, 0, 0)); autopilotState = PlayerAutopilotState.idle; string lvl = level.locationName.Substring(0, 6); bool depleted = ds.retrieveBoolValue(lvl + MirrorColor + "MirrorDepleted"); if (depleted) { interactEnabled = false; animAux.Broken(); state = MirrorState.deactivated; } else { bool activated = ds.retrieveBoolValue(level.locationName + MirrorColor + "MirrorActivated"); if (activated) { state = MirrorState.activated; } //activate (); } }
// Use this for initialization new void Start() { opacity = 1.0f; img = this.GetComponent <RawImage> (); img.enabled = false; state = 0; MasterControllerScript mc = GameObject.Find("MasterController").GetComponent <MasterControllerScript> (); DataStorage ds = mc.getStorage(); if (ds.retrieveBoolValue("IsChangingPlanes")) { ds.storeBoolValue("IsChangingPlanes", false); _wm_startXfade(); } }
// Use this for initialization new void Start() { disabledAnswers = new List <int> (); currentParent = bubbleContainerRef; currentSpeaker = SpeakerPosition.right; // NPC #1 positionChanged = true; topBarStatus = BarStatus.hidden; typeHereTransparency = 0.0f; targetTypeHereTransparency = 0.0f; //leftImageRef.enabled = false; //rightImageRef.enabled = false; setMiniature(null, null, 0); setMiniature(null, null, 1); bottomPanelStatus = BarStatus.hidden; topBarRef.GetComponent <RectTransform> ().transform.localPosition = new Vector3(0, HiddenTopY, 0); bottomPanelRef.GetComponent <RectTransform> ().transform.localPosition = new Vector3(0, HiddenBottomY, 0); //nextBubbleY = 20.0f; nextTextY = 180.0f; verticalScroll = 0.0f; targetScroll = 0.0f; maxScroll = 0.0f; blobColor = new Vector4(1.0f, 1.0f, 1.0f, 1.0f); originalPosition = this.transform.position; answerElements = new List <GameObject> (); sayElements = new List <GameObject> (); elements = sayElements; clear(); masterController = GameObject.Find("MasterController").GetComponent <MasterControllerScript> (); ds = masterController.getStorage(); base.Start(); }
void Start() { mc = GameObject.Find("MasterController").GetComponent <MasterControllerScript> (); ds = mc.getStorage(); levelName = ds.retrieveStringValue("CurrentLevel"); setLevel(0, -1); deployedScale = this.transform.localScale.x; this.transform.localPosition = new Vector3(0, 0, 0); radius = minRadius; status = warriorIconState.unfolding; angle = Index * 2.0f * 3.1416f / ((float)numberOfElements); opacity = targetOpacity = 1.0f; this.gameObject.GetComponent <Image>().color = new Vector4(1, 1, 1, opacity * globalOpacity); }