2using System.Collections;
41 renderTexture =
new RenderTexture(Screen.width, Screen.height, 24);
42 texture2D =
new Texture2D(Screen.width, Screen.height, TextureFormat.ARGB32, mipChain:
false);
43 pixelBlock =
new Texture2D(16, 16, TextureFormat.ARGB32, mipChain:
false);
63 renderTexture =
new RenderTexture(Screen.width, Screen.height, 24);
71 yield
return new WaitForEndOfFrame();
74 int num = (int)Mathf.Clamp(Input.mousePosition.x, 0f,
texture2D.width);
75 int num2 = (int)Mathf.Clamp(Input.mousePosition.y, 0f,
texture2D.height);
76 Vector2 vector =
new Vector2(num - 8, num2 - 8);
77 Vector2 vector2 =
new Vector2(num + 8, num2 + 8);
78 Vector2 vector3 =
new Vector2(Mathf.Clamp(vector.x, 0f,
texture2D.width - 8), Mathf.Clamp(vector.y, 0f,
texture2D.height - 8));
79 Vector2 vector4 =
new Vector2(Mathf.Clamp(vector2.x, 8f,
texture2D.width), Mathf.Clamp(vector2.y, 8f,
texture2D.height));
80 int blockWidth = (int)vector4.x - (
int)vector3.x;
81 int blockHeight = (int)vector4.y - (
int)vector3.y;
82 Color[] pixels =
texture2D.GetPixels((
int)vector3.x, (int)vector3.y, blockWidth, blockHeight);
83 float num3 = vector3.x - vector.x;
84 float num4 = vector3.y - vector.y;
86 pixelBlock.SetPixels((
int)num3, (int)num4, blockWidth, blockHeight, pixels);
123 UnityEngine.Object.Destroy(
blocker.gameObject);
void ShowEnlargedPixels(Color[] colors)
void ShowDropperMarker(bool value)
void UpdateColorByMousePosition()
void PickColors(Action< Color > onColorPicked, Action onDropCanceled)
IEnumerator EnlargeAreaAroundPointer()
Action< Color > onColorPicked
RenderTexture renderTexture
void UpdateRenderTextureIfNecessary()