Exemplo n.º 1
0
    void Start()
    {
        m_Animator = GetComponent<Animator>();
        showLock.SetActive(false);

        SFX = GameObject.Find("SFX").GetComponent<sfxPlayer>();
    }
Exemplo n.º 2
0
 void Start()
 {
     SFX = GameObject.Find("SFX").GetComponent<sfxPlayer>();
 }
Exemplo n.º 3
0
    void Start()
    {
        //---------------------------------------------------//
        // set the volume of the sound sphere for this object//
        //---------------------------------------------------//
        if (this.gameObject.CompareTag ("Bottle"))
        {
            maxScale = 15.0f;
            //expireTimer = 1.0f;
        }
        else if (this.gameObject.CompareTag ("Glass"))
        {
            maxScale = 40.0f;
        }
        else if (this.gameObject.CompareTag ("Jar"))
        {
            maxScale = 50.0f;
        }

        expireTimer = defaultExpireTimer;
        timer = defaultTimer;

        playerMovement = GameObject.FindGameObjectWithTag("Player").GetComponent<TemporaryMovement>();

        SFX = GameObject.Find ("SFX").GetComponent<sfxPlayer> ();

        broken = false;

        m_GroundCheckDistance = 0.6f;

        if (originalObject != null && brokenPieces != null)
        {
            originalObject.SetActive(true);
            brokenPieces.SetActive (false);
        }

        if (GetComponent<Rigidbody>() != null)
        {
            rb = GetComponent<Rigidbody>();
        }

        if (GetComponent<Rigidbody>() != null)
        {
            rb = GetComponent<Rigidbody>();
        }
        newSphere = (GameObject)Instantiate (Sphere, this.transform.position, Quaternion.identity);
        newSphere.transform.parent = transform;
        newSphere.SetActive (false);
    }