public void TriggerExplosion() { print("Trigger"); Intro intro = GameObject.FindObjectOfType <Intro>(); CameraShake cameraShakeInstance = GameObject.FindObjectOfType <CameraShake>(); GameManager.Get <SoundManager>().Play(explosionEffect); print("explosion"); GameObject explosion1 = Instantiate(explosionPrefab1, explosionOrigin.transform.position, explosionOrigin.transform.rotation) as GameObject; GameObject explosion2 = Instantiate(explosionPrefab2, explosionOrigin.transform.position, explosionOrigin.transform.rotation) as GameObject; explosion1.transform.SetParent(explosionOrigin); explosion2.transform.SetParent(explosionOrigin); print("shake"); cameraShakeInstance.Shake(shakeIntensity, shakeDecay); foreach (GameObject go in rockWall) { if (!isLandslide) { go.SetActive(false); } else { go.GetComponent <MeshRenderer> ().enabled = false; } } }
public void OpenDoor() { if (batterySlot.HasItem) { Intro intro = GameObject.FindObjectOfType <Intro>(); animator.SetBool("Open", true); } }