public void OnTriggerEnter(Collider other) { TimeObject to = other.GetComponent <TimeObject>(); if (to != null) { to.Kill(GameManager.time); } }
private void OnTriggerEnter(Collider other) { if (GameManager.instance.state == GameState.CARD_SELECT) { StartDeath(); } TimeObject to = other.GetComponent <TimeObject>(); if (to != null) { to.Kill(GameManager.time); } }
private void OnTriggerEnter(Collider other) { //if (other.gameObject.layer == LayerMask.NameToLayer("EnemyBullet")) return; TimeObject to = other.GetComponent <TimeObject>(); to.Kill(GameManager.time); int preHitCount = currentLivingTentavles; hp--; lastHitAt = GameManager.time; if (currentLivingTentavles != preHitCount) { Debug.Log("killing tentacle " + nextDeadTent); nextDeadTent = Mathf.Clamp(nextDeadTent, 0, tentColor.Length - 1); tentColor[nextDeadTent].material.SetFloat("_Decay", lastHitAt); tentDepth[nextDeadTent].material.SetFloat("_Decay", lastHitAt); nextDeadTent++; } damageStack.Push(new KeyValuePair <float, float>(GameManager.time, 1)); if (hp <= 0) { Debug.Log("Killed the boss!"); if (GameManager.instance.state == GameState.SIMULATE_PLAY) { GameManager.ChangeState(GameState.END); isdying = true; for (int x = 0; x < headMats.Length; x++) { headMats[x].SetFloat("_Decay", GameManager.time + 1); } timeOfDeath = GameManager.time; } Kill(GameManager.time); //renderObjects.SetActive(false); } }