1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- using System;
- using UnityEngine;
- public class TestColorChange : MonoBehaviour
- {
- private void Start()
- {
- this.m_test_stats = new ColorPalette.Status();
- Renderer component = base.transform.GetComponent<Renderer>();
- Texture2D texture2D = component.material.mainTexture as Texture2D;
- this.m_new_tex = new Texture2D(texture2D.width, texture2D.height, TextureFormat.RGBA32, false, true);
- this.m_bySrcColor = UTY.GetPixelArray(texture2D);
- component.material.mainTexture = this.m_new_tex;
- }
- private void Update()
- {
- this.m_test_stats.base_color.hue = this.main_hue;
- this.m_test_stats.base_color.sat = this.main_sat;
- this.m_test_stats.base_color.brightness = this.main_brightness;
- this.m_test_stats.base_color.contrast = this.main_contrast;
- this.m_test_stats.shadow_color.hue = this.shadow_hue;
- this.m_test_stats.shadow_color.sat = this.shadow_sat;
- this.m_test_stats.shadow_color.brightness = this.shadow_brightness;
- this.m_test_stats.shadow_color.contrast = this.shadow_contrast;
- this.m_test_stats.shadow_threshold = this.shadow_threshold;
- UTY.ConvertColor(this.m_test_stats, this.m_bySrcColor, ref this.m_new_tex);
- this.main_hue = this.m_test_stats.base_color.hue;
- this.main_sat = this.m_test_stats.base_color.sat;
- this.main_brightness = this.m_test_stats.base_color.brightness;
- this.main_contrast = this.m_test_stats.base_color.contrast;
- this.shadow_hue = this.m_test_stats.shadow_color.hue;
- this.shadow_sat = this.m_test_stats.shadow_color.sat;
- this.shadow_brightness = this.m_test_stats.shadow_color.brightness;
- this.shadow_contrast = this.m_test_stats.shadow_color.contrast;
- this.shadow_threshold = this.m_test_stats.shadow_threshold;
- }
- public int main_hue;
- public int main_sat = 128;
- public int main_brightness = 260;
- public int main_contrast = 128;
- public int shadow_threshold = 128;
- public int shadow_hue = 128;
- public int shadow_sat = 128;
- public int shadow_brightness = 260;
- public int shadow_contrast = 128;
- private ColorPalette.Status m_test_stats;
- private byte[] m_bySrcColor;
- private Texture2D m_new_tex;
- }
|