private void FixedUpdate() { winScript = FindObjectOfType <WinScript>(); pillSpawnerScript = FindObjectOfType <PillSpawner>(); CalculateScore(); if (Input.GetKey(KeyCode.Q)) { ResetHighScore(); } }
private void OnTriggerEnter(Collider other) { if (lvlName == "Menu") { WinScript ws = GetComponent <WinScript>(); ws.ShowText(true); Cursor.lockState = CursorLockMode.None; Cursor.visible = true; } SceneManager.LoadScene(lvlName); }
// Use this for initialization void Start() { rb = GetComponent <Rigidbody>(); audioSource = GetComponent <AudioSource>(); healthandDamage = GetComponent <HealthandDamage>(); speed = 5; playOnce = false; speedIncrease = false; speedDecrease = false; touchGround = true; displayCount = 0; displayScore = 0; countText.text = displayCount.ToString() + " Diamonds"; scoreText.text = "Score: " + displayScore.ToString(); maxCount = 33; wintriggerObject = GameObject.FindGameObjectWithTag("Win"); winTrigger = wintriggerObject.GetComponent <WinScript>(); }
// Start is called before the first frame update void Start() { instance = this; }
public override void Perform(GameObject theDying) { WinScript winScript = FindObjectOfType <WinScript>(); winScript.Kill(theDying.GetComponent <Rigidbody>()); }
// Ue this for initialization void Start() { GameObject[] pipe; pipe = GameObject.FindGameObjectsWithTag("Pipe"); foreach(GameObject go in pipe) { if(go.collider != collider) { Physics.IgnoreCollision(go.collider, collider); } } sp = GameObject.Find("StartBlock"); ep = GameObject.Find("EndBlock"); wn = sp.GetComponent<WinScript>(); en = ep.GetComponent<WinScript>(); if(pcs != null) { pcs = FindObjectsOfType(typeof(PipeConnectorScript)) as PipeConnectorScript[]; } }
// Use this for initialization void Start() { winCondition = FindObjectOfType <WinScript>(); }