Esempio n. 1
0
    private void FixedUpdate()
    {
        winScript         = FindObjectOfType <WinScript>();
        pillSpawnerScript = FindObjectOfType <PillSpawner>();
        CalculateScore();

        if (Input.GetKey(KeyCode.Q))
        {
            ResetHighScore();
        }
    }
Esempio n. 2
0
    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);
    }
Esempio n. 3
0
 // 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>();
 }
Esempio n. 4
0
 // Start is called before the first frame update
 void Start()
 {
     instance = this;
 }
Esempio n. 5
0
    public override void Perform(GameObject theDying)
    {
        WinScript winScript = FindObjectOfType <WinScript>();

        winScript.Kill(theDying.GetComponent <Rigidbody>());
    }
Esempio n. 6
0
    // 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[];
        }
    }
Esempio n. 7
0
 // Use this for initialization
 void Start()
 {
     winCondition = FindObjectOfType <WinScript>();
 }