private void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.name.Contains("Player")) { camera.ResetClamp(clampSet); if (respawnList) { RespawnHelper.RespawnList(); } } }
void Update() { if (currentCooldown >= 0) { currentCooldown -= Time.deltaTime; } if (resLight) { var currIn = resLight.intensity; resLight.intensity = Mathf.Clamp(Mathf.Sin(Time.time * 1.3f), 0, 1); } if (hc.isDead) { if (this.gameObject.name.Contains("Copper") || this.gameObject.name.Contains("Silicon")) { SFXHelper.PlayEffect(SFXs.BreakRock); } if (this.gameObject.name.Contains("Algae")) { SFXHelper.PlayEffect(SFXs.BreakAlgae); } var drops = Random.Range(minAmount, maxAmount); for (int i = 0; i < drops; i++) { Instantiate(resource.droppable, this.transform.position, Quaternion.identity); } this.gameObject.SetActive(false); if (respawneable) { RespawnHelper.AddToRestore(this.gameObject); } } }