private openFlap flap; //!< to hold a reference to the flap script on the flaps /** * Use this for initialization */ void Start() { // find the oxygen bar oxygen = GameObject.Find("MouthGUI").GetComponent <OxygenBar>(); // get the script "openFlap" on the flaps flap = transform.parent.gameObject.GetComponent <openFlap>(); }
EsophagusDebugConfig debugConfig; //!< to hold a reference to the mouth debug config /** * Use this for initialization * Finds references and initializes values. */ void Start() { GameObject flaps = GameObject.Find("Flaps"); // find the reference to the flaps flap = flaps.GetComponent <openFlap>(); // find the script on the flaps quaternion = transform.rotation; quaternion.Duration = .5f; debugConfig = GameObject.Find("Debugger").GetComponent <EsophagusDebugConfig>(); // find the reference to the debugger b = GameObject.Find("flap1").GetComponent <BoxCollider> (); }
/** * Use this for initialization * Find references, initialize variables */ void Start() { percent = 1f; // the oxygen bar should start off at 100% previousPercent = percent; GameObject flaps = GameObject.Find("Flaps"); // find the flaps reference flap = flaps.GetComponent <openFlap>(); // get the script from the flaps GameObject debugger = GameObject.Find("Debugger"); // find a reference to the debugger config = debugger.GetComponent <EsophagusDebugConfig>(); // get the script from the debug config }
// Use this for initialization void Start () { flaps = GameObject.Find ("Flaps"); // find the reference to the flaps flap = flaps.GetComponent<openFlap>(); // find the script on the flaps ego = FindObjectOfType(typeof(EsophagusGameOver)) as EsophagusGameOver; startTime = Time.time; timeStamp = Time.time; swipePopupStatus = 0; swipeCount = 0; swipingDown.SetActive (false); swipingUp.SetActive (false); notPaused = true; }
/** * Use this for initialization */ void Start() { // find the reference to the flaps and get the script reference from it epiglottisObject = GameObject.Find("Flaps").GetComponent <openFlap>(); Epiglottis = GameObject.Find("Epiglottis"); EpiglottisClosed = GameObject.Find("EpiglottisClosed"); Uvula = GameObject.Find("Uvula"); UvulaClosed = GameObject.Find("UvulaClosed"); Epiglottis.SetActive(true); EpiglottisClosed.SetActive(false); Uvula.SetActive(true); UvulaClosed.SetActive(false); }
public bool end = false; //!< flag to indicate whether we are at the end of the script /** * Use this for initialization * Verifies the level was loaded correctly and if not reloads it. * Starts loading from script/debugger. */ void Start() { level = null; // set the MouthLoadLevelCounter to null to begin with // find the reference to the mouth debugger debugConfig = GameObject.Find("Debugger").GetComponent <EsophagusDebugConfig>(); if (debugConfig == null) // if we are starting the game directly we need to add debugger { debugConfig = gameObject.AddComponent <EsophagusDebugConfig>() as EsophagusDebugConfig; } // find the background chooser GameObject chooseBackground = GameObject.Find("MouthChooseBackground"); if (chooseBackground != null) // if we did find the background chooser, get the level from it { level = chooseBackground.GetComponent <MouthLoadLevelCounter>(); } else // in this case we started the game load game properly { // this will cause the mouth game to be properly loaded from level 1 PlayerPrefs.SetInt("DesiredMouthLevel", 1); PlayerPrefs.Save(); Application.LoadLevel("LoadLevelMouth"); } // we also need to find the references to the flaps GameObject flaps = GameObject.Find("Flaps"); // find the reference to the flaps flap = flaps.GetComponent <openFlap>(); // get the openFlap script from the flaps if (level != null) // guard for if level was null since this will still execute before the reloading from level 1 { // finally load the script loadScript = new LoadScriptMouth(); // create a new script loader waves = loadScript.loadMouthLevel(level.getLevel()); // load the proper script to the level and store data // begin parsing the data currentWave = 0; // reset the current wave counter to 0 waveDelay = waves[0].startDelay; // get the waveDelay for the current wave waveTime = waves[0].runTime; // get the waveTime for the current wave SpawnInterval = waves[0].foodSpawnInterval; // get the spawnInterval for the current wave speed = waves[0].foodSpeed; // get the foodSpped for the current wave m_TimeSinceLastSpawn = 0f; // reset the time since last spawn to 0 } }
private openFlap flapScript; //!< variable to hold a reference to the script on the flaps /** * Use this for initialization */ void Start() { // find the flaps and get the script reference from them flapScript = GameObject.Find("Flaps").GetComponent <openFlap>(); }
private openFlap flapScript; //!< to hold a reference to the script on the flaps /** * Use this for initialization */ void Start() { flapScript = (openFlap)flaps.GetComponent(typeof(openFlap)); // find the script on the flaps }