public override void StartUsing(GameObject usingObject) { base.StartUsing(usingObject); controllerActions = usingObject.GetComponent <VRTK.VRTK_ControllerActions>(); if (!isUsed) { bool a = AkSoundEngine.GetIsGameObjectActive(this.gameObject); if (!alreadybeenused) { StartCoroutine(vibrations()); AkSoundEngine.PostEvent("answering_machine", this.gameObject); } else { StartCoroutine(vibrations()); AkSoundEngine.PostEvent("answering_machine_2", this.gameObject); } controllerActions.TriggerHapticPulse(0.63f, 0.2f, 0.01f); bool b = AkSoundEngine.GetIsGameObjectActive(this.gameObject); controllerActions.TriggerHapticPulse(0.63f, 0.2f, 0.01f); isUsed = true; alreadybeenused = true; this.gameObject.GetComponentInChildren <blinklight>().usage(isUsed); } }
// Update is called once per frame void Update() { if (playing && !AkSoundEngine.GetIsGameObjectActive(this.gameObject)) { playing = false; } }
// Update is called once per frame void Update() { if (isUsed && !AkSoundEngine.GetIsGameObjectActive(this.gameObject)) { isUsed = false; this.gameObject.GetComponentInChildren <blinklight>().usage(isUsed); } // Debug.Log(isUsed); }