Example #1
0
    // Use this for initialization
    void Start()
    {
        rend                = GetComponent <Renderer>();
        rend.enabled        = true;
        rend.sharedMaterial = material[0];
        audioData           = GetComponent <AudioSource>();

        TextAmmonia.SetActive(false);
        TextCopper.SetActive(false);
        TextLead.SetActive(false);
    }
Example #2
0
    private void OnCollisionEnter(Collision col)
    {
        if (col.gameObject.tag == "CopperSoluble")
        {
            //System.Threading.Thread.Sleep(2000);
            rend.sharedMaterial = material[2];
            col.gameObject.tag  = "CopperUsed";
            TextCopper.SetActive(true);
            audioData.clip = AudioCopper;
            audioData.Play();
            StartCoroutine(ActivationRoutine(TextCopper));
        }

        if (col.gameObject.tag == "LeadInsoluble")
        {
            //System.Threading.Thread.Sleep(2000);
            //rend.sharedMaterial = material[2];
            col.gameObject.tag = "LeadUsed";

            TextLead.SetActive(true);
            audioData.clip = AudioLead;
            audioData.Play();
            StartCoroutine(ActivationRoutine(TextLead));
        }

        if (col.gameObject.tag == "AmmeniaSoluble")
        {
            //System.Threading.Thread.Sleep(2000);
            //rend.sharedMaterial = material[2];
            col.gameObject.tag = "AmmoniaUsed";

            TextAmmonia.SetActive(true);
            audioData.clip = AudioAmmonia;
            audioData.Play();
            StartCoroutine(ActivationRoutine(TextAmmonia));
        }
    }