Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- else if (Input.GetAxis("Horizontal") > 0.5f || Input.GetAxis("Horizontal") < -0.5f || Input.GetAxis("DpadX") > 0.5f || Input.GetAxis("DpadX") < -0.5f || Input.GetKey(KeyCode.RightArrow) || Input.GetKey(KeyCode.LeftArrow))
- {
- this.CalculateValue();
- Material material = this.Student.Cosmetic.HairRenderer.material;
- Material material2 = this.Student.Cosmetic.RightEyeRenderer.material;
- if (this.Selected == 4)
- {
- material.color = new Color(material.color.r + (float)this.Degree * 0.003921569f * (float)this.Value, material.color.g, material.color.b, material.color.a);
- }
- else if (this.Selected == 5)
- {
- material.color = new Color(material.color.r, material.color.g + (float)this.Degree * 0.003921569f * (float)this.Value, material.color.b, material.color.a);
- }
- else if (this.Selected == 6)
- {
- material.color = new Color(material.color.r, material.color.g, material.color.b + (float)this.Degree * 0.003921569f * (float)this.Value, material.color.a);
- }
- else if (this.Selected == 7)
- {
- material2.color = new Color(material2.color.r + (float)this.Degree * 0.003921569f * (float)this.Value, material2.color.g, material2.color.b, material2.color.a);
- }
- else if (this.Selected == 8)
- {
- material2.color = new Color(material2.color.r, material2.color.g + (float)this.Degree * 0.003921569f * (float)this.Value, material2.color.b, material2.color.a);
- }
- else if (this.Selected == 9)
- {
- material2.color = new Color(material2.color.r, material2.color.g, material2.color.b + (float)this.Degree * 0.003921569f * (float)this.Value, material2.color.a);
- }
- this.CapColors();
- this.UpdateLabels();
- }
- private void CapColors()
- {
- Material material = this.Student.Cosmetic.HairRenderer.material;
- if (material.color.r < 0f)
- {
- material.color = new Color(0f, material.color.g, material.color.b, material.color.a);
- }
- if (material.color.g < 0f)
- {
- material.color = new Color(material.color.r, 0f, material.color.b, material.color.a);
- }
- if (material.color.b < 0f)
- {
- material.color = new Color(material.color.r, material.color.g, 0f, material.color.a);
- }
- if (material.color.r > 1f)
- {
- material.color = new Color(1f, material.color.g, material.color.b, material.color.a);
- }
- if (material.color.g > 1f)
- {
- material.color = new Color(material.color.r, 1f, material.color.b, material.color.a);
- }
- if (material.color.b > 1f)
- {
- material.color = new Color(material.color.r, material.color.g, 1f, material.color.a);
- }
- Material material2 = this.Student.Cosmetic.RightEyeRenderer.material;
- if (material2.color.r < 0f)
- {
- material2.color = new Color(0f, material2.color.g, material2.color.b, material2.color.a);
- }
- if (material2.color.g < 0f)
- {
- material2.color = new Color(material2.color.r, 0f, material2.color.b, material2.color.a);
- }
- if (material2.color.b < 0f)
- {
- material2.color = new Color(material2.color.r, material2.color.g, 0f, material2.color.a);
- }
- if (material2.color.r > 1f)
- {
- material2.color = new Color(1f, material2.color.g, material2.color.b, material2.color.a);
- }
- if (material2.color.g > 1f)
- {
- material2.color = new Color(material2.color.r, 1f, material2.color.b, material2.color.a);
- }
- if (material2.color.b > 1f)
- {
- material2.color = new Color(material2.color.r, material2.color.g, 1f, material2.color.a);
- }
- this.Student.Cosmetic.LeftEyeRenderer.material.color = material2.color;
- }
- private void CalculateValue()
- {
- if (Input.GetAxis("Horizontal") > 0.5f || Input.GetAxis("Horizontal") < -0.5f)
- {
- if (Input.GetAxis("Horizontal") > 0.5f)
- {
- this.Value = 1;
- }
- else
- {
- this.Value = -1;
- }
- }
- else if (Input.GetAxis("DpadX") > 0.5f || Input.GetAxis("DpadX") < -0.5f)
- {
- if (Input.GetAxis("DpadX") > 0.5f)
- {
- this.Value = 1;
- }
- else
- {
- this.Value = -1;
- }
- }
- else
- {
- this.Value = ((!Input.GetKey(KeyCode.RightArrow)) ? -1 : 1);
- }
- }
Add Comment
Please, Sign In to add comment