public void SetColors() { ColorDataBase.setEnemyColor(equipppedEnemy); ColorDataBase.setHeroColor(equippedHero); ColorDataBase.setSwordColor(equippedSwordC); //shopEnemyScript.SetMatColors(); enemyLight.color = ColorDataBase.GetEnemyStripAlbedo(); swordSwapper.GetActiveSword().GetComponent <SwordColorScript>().setSwordColor(); damageManagerScript.SetHeroColor(); startMenu.updateUI(); heroLight.color = ColorDataBase.GetHeroAlbedo(); swordSwapper.GetActiveSword().GetComponent <SwordColorScript>().setSwordColor(); swordLight.color = ColorDataBase.GetSwordAlbedo(); swordSwapper.SwapSwords(equippedSwordID); dSwapper.SetDisplaySword(equippedSwordID); hdSwapper.SetDisplaySword(equippedSwordID); }
/** * Takes damage from the mine. Damages player by 15 health. */ public void TakeDamageFromMine() { if (!dead) { int mineDamage = 70; AudioManager.instance.Play("HitSound", Random.Range(0.9f, 1.1f)); health -= mineDamage; healHealth -= mineDamage; damageEffect.Play(); damageLightEffect.Play(); if (ColorDataBase.Vibration()) { Handheld.Vibrate(); } if (ColorDataBase.ScreenShake()) { _cs.TurretShake(); } if (health <= 0) { FindObjectOfType <AudioManager>().Pause("Footsteps"); gameOverState.enabled = true; dead = true; this.GetComponent <PlayerAnimationController>().Die(); } } }
/** * Returns the material back to its default state. */ private void setDefaultMats() { healthIndicator.SetColor("dissolveColor", ColorDataBase.GetCurrentHeroColor()); healthIndicator.SetFloat("edgeWidth", 0.03f); healthIndicator.SetFloat("noiseScale", 120f); healthIndicator.SetFloat("minimumRender", 0.15f); }
public void updateUI() { foreach (Material material in uiButtonMats) { material.EnableKeyword("buttonColor"); material.SetColor("buttonColor", ColorDataBase.GetUIColor()); } }
/** * Sets the color of our muzzle flash particle systems. */ private void SetMuzzleFlash() { // muzzle flash color _leftMain = _leftFlash.main; _leftMain.startColor = ColorDataBase.GetEnemyStripAlbedo(); _rightMain = _rightFlash.main; _rightMain.startColor = ColorDataBase.GetEnemyStripAlbedo(); }
private void Start() { hero = GameObject.FindGameObjectWithTag("Player"); objectToFollow = hero.transform.GetChild(1).transform; mineExplosion = this.GetComponentInChildren <ParticleSystem>(); expModule = mineExplosion.main; expModule.startColor = ColorDataBase.GetEnemyStripAlbedo(); dm = hero.GetComponent <DamageManager>(); }
// Start is called before the first frame update void Start() { canisterColor.SetColor("emissionColor", ColorDataBase.GetCurrentHeroColor()); canisterColor.SetColor("baseColor", ColorDataBase.GetHeroAlbedo()); objectToFollow = GameObject.FindGameObjectWithTag("Player").transform; _am = FindObjectOfType <AudioManager>(); healthCanister = transform.GetChild(0).gameObject; }
public void SetHeroColor() { healthIndicator.SetColor("dissolveColor", ColorDataBase.GetCurrentHeroColor()); lightfxModule = damageLightEffect.main; lightfxModule.startColor = ColorDataBase.GetHeroAlbedo(); healfxModule = healLightFX.main; healfxModule.startColor = ColorDataBase.GetHeroAlbedo(); }
/** * Sets the color of the enemie's mats off spawn. */ public void SetMatColors() { armorMat.SetColor("dissolveColor", ColorDataBase.GetMainEnemyArmorColor()); armorStrip.SetColor("armorEdgeColor", ColorDataBase.GetEnemyArmorStripColor()); armorStrip.SetColor("armorStripAlbedo", ColorDataBase.GetEnemyStripAlbedo()); offSetDissolveMaterial.SetColor("mainColor", ColorDataBase.GetStripDissolveColor()); offSetDissolveMaterial.SetColor("dissolveEdgeColor", ColorDataBase.GetStripDissolveColor()); mineMaterial.SetColor("mineColor", ColorDataBase.GetStripDissolveColor()); mineMaterial.SetColor("mineAlbedo", ColorDataBase.GetMainEnemyArmorColor()); }
private void Start() { bulletMaterial.SetColor("bulletColor", ColorDataBase.GetBulletColor()); bulletTrailMaterial.SetColor("_EmissionColor", ColorDataBase.GetBulletTrail()); rb = this.GetComponent <Rigidbody>(); lifeLengthTimer = Time.time; player = GameObject.FindGameObjectWithTag("Player"); pc = player.GetComponent <PlayerController>(); }
void Start() { hasPlayed(); setUpItemPlayerPrefs(); money = PlayerPrefs.GetInt("money", 0); moneyText.text = "$" + money + ""; moneyText2.text = "$" + money + ""; moneyText3.text = "$" + money + ""; moneyText4.text = "$" + money + ""; heroLight.color = ColorDataBase.GetHeroAlbedo(); enemyLight.color = ColorDataBase.GetEnemyStripAlbedo(); swordLight.color = ColorDataBase.GetSwordAlbedo(); }
/** * Detects collision with the enemy and plays the attack animation * appropiately. * * @param collision The collision we are detecting. */ private void OnCollisionEnter(Collision collision) { if (!dm.isDead() && collision.gameObject.transform.CompareTag("Enemy")) { this.Attack(); elimSinceHeal++; if (ColorDataBase.ScreenShake()) { _cs.AttackShake(); } sCounter.AddAttackScore(streakMultiplier); StartCoroutine(slashSpawner.Slash(this.GetSlashDelay(slashID))); } }
private void Start() { _rb = this.GetComponent <Rigidbody>(); _ac = this.GetComponentInChildren <Animator>(); hero = GameObject.FindGameObjectWithTag("Player"); player = hero.GetComponent <PlayerController>(); objectToFollow = hero.transform.GetChild(1).transform; turretMesh = transform.GetChild(1); explosionfx = this.GetComponentInChildren <ParticleSystem>(); expModule = explosionfx.main; expModule.startColor = ColorDataBase.GetEnemyStripAlbedo(); SetMuzzleFlash(); dm = player.GetComponent <DamageManager>(); }
private void Awake() { if (deletePlayerPrefs) { PlayerPrefs.DeleteAll(); } Enum.TryParse(PlayerPrefs.GetString("EnemyColor", "red"), out ColorDataBase.enemyColorOptions enemyC); ColorDataBase.setEnemyColor(enemyC); Enum.TryParse(PlayerPrefs.GetString("HeroColor", "blue"), out ColorDataBase.heroColorOptions heroC); ColorDataBase.setHeroColor(heroC); Enum.TryParse(PlayerPrefs.GetString("SwordColor", "blue"), out ColorDataBase.heroColorOptions swordC); ColorDataBase.setSwordColor(swordC); equippedHero = heroC; equipppedEnemy = enemyC; equippedSwordC = swordC; equippedSwordID = PlayerPrefs.GetInt("equipped-sword", 0); }
/** * Takes damage from the turret when the player collides with the turret. * The turret then explodes, taking away half the player's health, a * true tragedy. */ public void TakeDamageFromTurret() { health = health / 2; healHealth = healHealth / 2; damageEffect.Play(); damageLightEffect.Play(); AudioManager.instance.Play("HitSound", Random.Range(0.9f, 1.1f)); if (ColorDataBase.Vibration()) { Handheld.Vibrate(); } if (ColorDataBase.ScreenShake()) { _cs.TurretShake(); } // shouldn't ever end the round since it is always going to be half // of the player's health }
private void Start() { _torsoMoveSpeed = 40; _headMoveSpeed = 45; _legMoveSpeed = 30; _moveBackwardDistance = 25; _rb = this.GetComponent <Rigidbody>(); _anim = this.GetComponentInChildren <Animator>(); _muzzleFlash = this.GetComponentInChildren <ParticleSystem>(); playerObject1 = GameObject.FindGameObjectWithTag("Player"); hero1 = playerObject1.GetComponent <PlayerController>(); playerToFollow = playerObject1.transform.GetChild(1).transform; // muzzle flash color _mfMain = _muzzleFlash.main; _mfMain.startColor = ColorDataBase.GetEnemyStripAlbedo(); dm = playerObject1.GetComponent <DamageManager>(); }
public void setSwordColor() { swordEmission = ColorDataBase.GetSwordColor(); swordAlbedo = ColorDataBase.GetSwordAlbedo(); try { bladeSmoke = transform.GetChild(0).GetComponentInChildren < ParticleSystem>().main; bladeSmoke.startColor = swordAlbedo; } catch { } slashMaterial.SetColor("slashColor", swordEmission); bladeColor.SetColor("baseColor", swordAlbedo); bladeColor.SetColor("emissionColor", swordEmission); }
public void PreviewItems() { Item i = itemList[scrollSnap.CurrentPanel]; if (i.type == Item.Type.enemyColor) { ColorDataBase.setEnemyColor(i.enemyColor); shopEnemyScript.SetMatColors(); enemyLight.color = ColorDataBase.GetEnemyStripAlbedo(); } else if (i.type == Item.Type.heroColor) { ColorDataBase.setHeroColor(i.heroColor); swordSwapper.GetActiveSword().GetComponent <SwordColorScript>().setSwordColor(); damageManagerScript.SetHeroColor(); heroLight.color = ColorDataBase.GetHeroAlbedo(); // bladeCoreSwitcher.heroSyncEquipIndex = scrollSnap.CurrentPanel; } else if (i.type == Item.Type.swordColor) { ColorDataBase.setSwordColor(i.heroColor); swordSwapper.GetActiveSword().GetComponent <SwordColorScript>().setSwordColor(); swordLight.color = ColorDataBase.GetSwordAlbedo(); } else if (i.type == Item.Type.swordModel) { swordSwapper.SwapSwords(i.swordID); dSwapper.SetDisplaySword(i.swordID); hdSwapper.SetDisplaySword(i.swordID); } if (nav.exitingShop) { this.SetColors(); } }
private void Start() { _torsoMoveSpeed = 40; _headMoveSpeed = 45; _legMoveSpeed = 30; if (torso == null) { Debug.Log("Did not assign torso in hierarchy"); } if (head == null) { Debug.Log("Did not assign head in hierarchy"); } if (legs == null) { Debug.Log("Did not assign legs in hierarchy"); } _moveBackwardDistance = 17; _rb = this.GetComponent <Rigidbody>(); _anim = this.GetComponentInChildren <Animator>(); _muzzleFlash = this.GetComponentInChildren <ParticleSystem>(); playerObject = GameObject.FindGameObjectWithTag("Player"); player = playerObject.GetComponent <PlayerController>(); objectToFollow = playerObject.transform.GetChild(1).transform; // muzzle flash color _mfMain = _muzzleFlash.main; _mfMain.startColor = ColorDataBase.GetEnemyStripAlbedo(); dm = player.GetComponent <DamageManager>(); }