void FixedUpdate() { //Destroy the object if life is lower than 0 if (lifeScript.GetLife() <= 0) { for (int i = 0; i < numberOfPoints; i++) { GameObject point = poolPoint.GetBullet(); point.transform.position = new Vector2(Random.Range(transform.position.x - pointSpawnRadius, transform.position.x + pointSpawnRadius), Random.Range(transform.position.y - pointSpawnRadius, transform.position.y + pointSpawnRadius)); point.SetActive(true); } particlesContainer.transform.SetParent(null); SoundManager.instance.Play(SoundManager.clip.enemyDeath); if (!Application.isEditor) { VibrationController.Vibrate(50); } if (dropUpgrade) { Instantiate(upgradeObject, transform.position, Quaternion.identity); } Destroy(gameObject); } //Rotate the object rotateObject.transform.Rotate(Vector3.forward * Time.deltaTime * rotationSpeed); }
void ClickEffect() { SoundManager.instance.Play(SoundManager.clip.ButtonClick); if (!Application.isEditor) { VibrationController.Vibrate(50); } }
public void Continue() { SoundManager.instance.Play(SoundManager.clip.ButtonClick); if (!Application.isEditor) { VibrationController.Vibrate(50); } StartCoroutine(FadeIn()); }
public List <VibrationTypeClass> VibrationType = new List <VibrationTypeClass>(); //List of vibration private void Awake() { Instance = this; //setup the bnvib foreach (VibrationTypeClass item in VibrationType) { item.vibFile = Resources.Load <TextAsset>(item.VibrationT.ToString() + ".bnvib").bytes; } }
private void Explode() { Instantiate(m_ExplosionEffect, transform.position, Quaternion.identity); VibrationController.Vibrate(200); Messenger.Broadcast(GameEvent.INEDIBLE_ITEM_PICKUP); Destroy(gameObject); }
public void RegisterAudio() { float volume = slider.value; float vibration = (130 * volume); if (!Application.isEditor) { VibrationController.Vibrate((long)vibration); } if (volume >= 0) { xmlSystem.dataBase.firstDB[1].value = volume; xmlSystem.Save(); } }
// private void OnCollisionEnter(Collision collision) { if (collision.gameObject.CompareTag("ground")) { jump = true; if (attack) { attack = false; GameObject vib = Instantiate(prefab, transform.position - new Vector3(0, 0.5f, 0), transform.rotation) as GameObject; VibrationController temp = vib.GetComponent <VibrationController>(); temp.Create(vib_scale, vib_vel); } } if (collision.gameObject.CompareTag("Player")) { if (attack && collision.gameObject.transform.position.y < transform.position.y) { attack = false; collision.gameObject.GetComponent <PlayerController>().HP -= 1; collision.gameObject.GetComponent <hpController>().HPchange(); audioSource.PlayOneShot(audioSource.clip); } } }