private IEnumerator deathFadeIE(PlayerBehaviour2 pB) { brightnessFilterDeath.enabled = true; pB.enabled = false; pB.transform.parent.gameObject.SetActive(false); Color _oldCol = brightnessFilterDeath.color; Color _Col = Color.black; float _timeValue = 0; while (_timeValue < 1) { _timeValue += Time.deltaTime / deathFadeDuration; float _evaluatedTimeValue = deathFadeCurve.Evaluate(_timeValue); _Col.r = Mathf.Lerp(_oldCol.r, endCol.r, _evaluatedTimeValue); _Col.g = Mathf.Lerp(_oldCol.g, endCol.g, _evaluatedTimeValue); _Col.b = Mathf.Lerp(_oldCol.b, endCol.b, _evaluatedTimeValue); _Col.a = Mathf.Lerp(_oldCol.a, endCol.a, _evaluatedTimeValue); brightnessFilterDeath.color = _Col; yield return(null); } deathFadeRoutine = null; SceneManager.LoadScene("Death"); yield return(null); }
public void DeathFade(PlayerBehaviour2 pB) { if (deathFadeRoutine != null) { StopCoroutine(deathFadeRoutine); } StartCoroutine(deathFadeIE(pB)); }
private void OnTriggerEnter2D(Collider2D collision) { PlayerBehaviour2 pB = collision.GetComponent <PlayerBehaviour2>(); if (pB != null) { pB.EnvironmentDamage(); } }
private void OnTriggerEnter2D(Collider2D collision) { PlayerBehaviour2 pB = collision.gameObject.GetComponent <PlayerBehaviour2>(); if (pB != null) { gm.StartCoroutine(gm.ShowUpgradeType(upgradeType)); pB.GotUpgrade(upgradeType); Destroy(gameObject); } }
private void OnTriggerEnter2D(Collider2D collision) { PlayerBehaviour2 pB = collision.gameObject.GetComponent <PlayerBehaviour2>(); if (pB != null && active && !pB.playerNotHittable) { float playerTpDamageOutput = pB.tpDamageOutput; float playerContactDamageOutput = pB.contactDamageOutput; float totalContactDamage = initialContactDamage + playerContactDamageOutput; if (pB.justTP == true) { float projectedHP = HP - playerTpDamageOutput; if (projectedHP > 0) { HP = projectedHP; } else { //pB.teleportJuice += cellRegenAmount; gm.hitEnemy = true; //Debug.Log(cellRegenAmount); pB.CheckCombo(cellRegenAmount); //gm.Freeze(0.08f); gm.EnemyDeath(parentObject); } } else { pB.hitPoints -= damageAmount; pB.StartCoroutine(pB.OnDamage()); gm.healthLossParticles.Clear(); gm.healthLossParticles.Play(); //gm.Freeze(0.2f); if (takesContactDamage) { float projectedHP = HP - totalContactDamage; if (projectedHP > 0) { HP = projectedHP; } else { gm.EnemyDeath(parentObject); } } } } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.tag == "Player") { PlayerBehaviour2 pB = collision.GetComponent <PlayerBehaviour2>(); if (pB != null) { if (roomManager.doorOn && !roomManager.justEntered) { //Debug.Log("Hit Registered"); roomManager.ChangeRoom(this); Debug.LogWarning("Player entered door: " + gameObject); } } } }
void Start() { oM = OptionsManager.instance; gm = GameManager.instance; pB = FindObjectOfType <PlayerBehaviour2>(); mainCamera = FindObjectOfType <Camera>(); localEnemyPrefabs = gm.enemyPrefabs; totalSpawnTime = gm.totalEnemySpawnTime; lastPauzeTime = gm.pauzeAfterLastEnemy; enemySpawnVFX = gm.enemySpawnFX; enemyAfterSpawnVFX = gm.afterEnemySpawnFX; if (topEntrance != null) { topEntrance.SetActive(false); } if (rightEntrance != null) { rightEntrance.SetActive(false); } if (downEntrance != null) { downEntrance.SetActive(false); } if (leftEntrance != null) { leftEntrance.SetActive(false); } enemyShader = Shader.Find("NittShader/ColorCycle"); if (gm.spawnedRooms.Count == 0) { gm.spawnedRooms.Add(gameObject); } }
// Start is called before the first frame update void Start() { pB = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerBehaviour2>(); }
// Start is called before the first frame update void Start() { pS = GetComponent <ParticleSystem>(); shapeM = pS.shape; pB = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerBehaviour2>(); }