public void SetModifier(MutationController.PlayerMutation playerMutation, MutationController.BulletMutation bulletMutation) { print("Player mutation " + playerMutation.lifeModifier + " - " + playerMutation.speedModifier + " - " + playerMutation.cadencyModifier); life = Mathf.Clamp(life + playerMutation.lifeModifier, minLife, maxLife); maxSpeed = Mathf.Clamp(maxSpeed + playerMutation.speedModifier, minSpeed, maxMSpeed); cadency = Mathf.Clamp(cadency + playerMutation.cadencyModifier, minCadency, maxCadency); print("Bullet mutation " + bulletMutation.bulletDamageModifier + " - " + bulletMutation.bulletRangeModifier + " - " + bulletMutation.bulletSpeedModificer); this.bulletMutation.bulletDamageModifier += bulletMutation.bulletDamageModifier; this.bulletMutation.bulletRangeModifier += bulletMutation.bulletRangeModifier; this.bulletMutation.bulletSpeedModificer += bulletMutation.bulletSpeedModificer; }
private void Init() { bulletMutation = new MutationController.BulletMutation(); current_life = life; int player_respawns = GameControllerManager.getGameControllerManager().getPlayerRespawns(); playerName = GameControllerManager.getGameControllerManager().getRandomPlayerName(); int rangeValue = Random.Range(1, 3); GameObject hat = new GameObject(); switch (rangeValue) { case 1: hat = Instantiate(Resources.Load("BoxHat") as GameObject); break; case 2: hat = Instantiate(Resources.Load("PyramidHat") as GameObject); break; case 3: hat = Instantiate(Resources.Load("SphereHat") as GameObject); break; } hat.GetComponent <MeshRenderer>().materials[0].SetColor("_EmissionColor", Color.grey); hat.transform.position = this.transform.position + new Vector3(0, 0.75f, 0); hat.transform.SetParent(this.transform); if (player_respawns > 0) { RandomMutator(); Color finalColor = Color.white; finalColor.r = Random.Range(0f, 1f); finalColor.g = Random.Range(0f, 1f); finalColor.b = Random.Range(0f, 1f); this.transform.GetChild(0).GetChild(1).GetComponent <SkinnedMeshRenderer>().materials[0].SetColor("_EmissionColor", finalColor); hat.GetComponent <MeshRenderer>().materials[0].SetColor("_EmissionColor", finalColor); } }
public void SetMutation(MutationController.BulletMutation bulletMutation) { damage = Mathf.Clamp(damage + bulletMutation.bulletDamageModifier, minDamage, maxDamage); speed = Mathf.Clamp(speed + bulletMutation.bulletSpeedModificer, minSpeed, maxSpeed); range = Mathf.Clamp(range + bulletMutation.bulletRangeModifier, minRange, maxRange); }