{"id":1177,"date":"2024-02-01T22:44:19","date_gmt":"2024-02-01T19:14:19","guid":{"rendered":"https:\/\/mabioca.com\/pa\/?p=1177"},"modified":"2024-11-26T13:51:09","modified_gmt":"2024-11-26T10:21:09","slug":"change-the-color-of-the-material-with-button","status":"publish","type":"post","link":"https:\/\/mabioca.com\/pa\/blog\/training\/programming\/change-the-color-of-the-material-with-button\/","title":{"rendered":"\u06f2- \u062a\u063a\u06cc\u06cc\u0631 \u0631\u0646\u06af \u06cc\u06a9 \u0645\u0648\u0636\u0648\u0639 \u0628\u0627 \u062f\u06a9\u0645\u0647"},"content":{"rendered":"\n<div class=\"wp-block-stackable-text stk-block-text stk-block stk-d0864fe\" data-block-id=\"d0864fe\"><p class=\"stk-block-text__text\">\u0627\u06cc\u0646 \u0646\u0648\u0634\u062a\u0647 \u0628\u0647 <a href=\"https:\/\/mabioca.com\/pa\/blog\/training\/programming\/change-the-color-of-the-material\/\" data-type=\"link\" data-id=\"https:\/\/mabioca.com\/pa\/blog\/training\/programming\/change-the-color-of-the-material\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u0646\u0648\u0634\u062a\u0647\u200c\u06cc \u0642\u0628\u0644\u06cc<\/a> \u062f\u0631 \u0645\u0648\u0631\u062f \u062a\u063a\u06cc\u06cc\u0631 \u0631\u0646\u06af \u06cc\u0647 \u0645\u0648\u0636\u0648\u0639 \u0645\u0631\u062a\u0628\u0637\u0647 \u067e\u0633 \u062d\u062a\u0645\u0646 \u0627\u0648\u0644 \u0627\u0648\u0646 \u0631\u0648 \u0628\u062e\u0648\u0646\u06cc\u062f \u0686\u0648\u0646 \u06cc\u0647 \u0686\u06cc\u0632\u0627\u06cc\u06cc \u0631\u0648 \u0627\u0648\u0646\u062c\u0627 \u062a\u0648\u0636\u06cc\u062d \u062f\u0627\u062f\u0645 \u06a9\u0647 \u0627\u06cc\u0646\u062c\u0627 \u0628\u0631\u0627\u06cc \u0627\u06cc\u0646\u06a9\u0647 \u062a\u06a9\u0631\u0627\u0631\u06cc \u0646\u0634\u0647 \u062a\u0648\u0636\u06cc\u062d \u0646\u0645\u06cc\u200c\u062f\u0645. \u06cc\u0647 \u0646\u06a9\u062a\u0647\u200c\u06cc \u062f\u06cc\u06af\u0647 \u0627\u06cc\u0646\u06a9\u0647 \u0646\u0631\u0645 \u0627\u0641\u0632\u0627\u0631 <a href=\"https:\/\/desktop.github.com\/\" data-type=\"link\" data-id=\"https:\/\/desktop.github.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u06af\u06cc\u062a \u0647\u0627\u0628 \u062f\u0633\u06a9\u062a\u0627\u067e<\/a> \u0631\u0648 \u0631\u0648\u06cc \u0633\u06cc\u0633\u062a\u0645 \u062a\u0648\u0646 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u06cc\u062f \u0648 \u0627\u0632 <a href=\"https:\/\/github.com\/mabioca\/Scripts\/tree\/main\" data-type=\"link\" data-id=\"https:\/\/github.com\/mabioca\/Scripts\/tree\/main\" target=\"_blank\" rel=\"noreferrer noopener\">\u0627\u06cc\u0646 \u0644\u06cc\u0646\u06a9<\/a> \u067e\u0631\u0648\u0698\u0647\u200e\u0627\u06cc \u06a9\u0647 \u0627\u06cc\u0646\u062c\u0627 \u062a\u0648\u0636\u06cc\u062d \u0645\u06cc\u062f\u0645 \u0631\u0648 \u062f\u0627\u0646\u0644\u0648\u062f \u06a9\u0646\u06cc\u062f \u06a9\u0647 \u0646\u062a\u06cc\u062c\u0647\u200c\u06cc \u0646\u0647\u0627\u06cc\u06cc \u062a\u0648\u0636\u06cc\u062d\u0627\u062a \u0627\u06cc\u0646\u062c\u0627 \u062f\u0631 \u0641\u0627\u06cc\u0644 \u0635\u062d\u0646\u0647 \u0628\u0647 \u0627\u0633\u0645 ColorChangeWithButtonScript \u062f\u0631 Assets &gt; Scenes \u0630\u062e\u06cc\u0631\u0647 \u0634\u062f\u0647 \u0648 \u062f\u0631 \u0636\u0645\u0646 \u0628\u0631\u0627\u06cc \u062a\u0645\u0631\u06cc\u0646 \u0647\u0645 \u0645\u06cc\u200c\u062a\u0648\u0646\u06cc\u062f \u0627\u0632\u0634 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f.<\/p><\/div>\n\n\n\n<div class=\"wp-block-stackable-text stk-block-text stk-block stk-482b94b\" data-block-id=\"482b94b\"><p class=\"stk-block-text__text\">\u062f\u0631 \u0627\u06cc\u0646 \u0645\u0637\u0644\u0628 \u0647\u0645\u0627\u0646\u0637\u0648\u0631 \u06a9\u0647 \u0627\u0632 \u0639\u0646\u0648\u0627\u0646\u0634 \u0647\u0645 \u062a\u0627 \u062d\u062f\u06cc \u0645\u0634\u062e\u0635\u0647 \u0642\u0631\u0627\u0631\u0647 \u0628\u0627 \u0686\u0646\u062f \u062e\u0637 \u06a9\u062f \u0633\u0627\u062f\u0647 \u06a9\u0627\u0631\u06cc \u06a9\u0646\u06cc\u0645 \u06a9\u0647 \u0628\u0627 \u0641\u0634\u0627\u0631 \u062f\u0627\u062f\u0646 \u06cc\u0647 \u062f\u06a9\u0645\u0647 \u062f\u0631 \u0635\u062d\u0646\u0647 \u0631\u0646\u06af \u0644\u06cc\u0648\u0627\u0646 \u062a\u063a\u06cc\u06cc\u0631 \u06a9\u0646\u0647 \u0648 \u06cc\u0647 \u0642\u0633\u0645\u062a \u0647\u0645 \u0628\u0631\u0627\u06cc \u062a\u0639\u06cc\u06cc\u0646 \u0631\u0646\u06af \u0628\u0633\u0627\u0632\u06cc\u0645 \u06a9\u0647 \u0631\u0646\u06af \u0631\u0648 \u0642\u0628\u0644\u0634 \u0628\u062a\u0648\u0646\u06cc\u0645 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0646\u06cc\u0645.<\/p><\/div>\n\n\n\n<div class=\"wp-block-stackable-text stk-block-text stk-block stk-587933f\" data-block-id=\"587933f\"><p class=\"stk-block-text__text\">\u0627\u06af\u0647 \u0628\u062e\u0648\u0627\u0645 \u0628\u0647 \u062a\u0631\u062a\u06cc\u0628 \u0628\u06af\u0645:<\/p><\/div>\n\n\n\n<div class=\"wp-block-stackable-text stk-block-text stk-block stk-0863d39\" data-block-id=\"0863d39\"><p class=\"stk-block-text__text\">\u06f1- \u062f\u0631 \u0642\u0633\u0645\u062a Assets \u06cc\u0647 \u0633\u06a9\u0631\u06cc\u067e\u062a \u0633\u06cc \u0634\u0627\u0631\u067e \u0628\u0633\u0627\u0632\u06cc\u062f \u0648 \u06cc\u0647 \u0627\u0633\u0645 \u0642\u0627\u0628\u0644 \u062a\u0634\u062e\u06cc\u0635 \u0647\u0645 \u0628\u0631\u0627\u0634 \u062a\u0639\u06cc\u06cc\u0646 \u06a9\u0646\u06cc\u062f \u06a9\u0647 \u0645\u0646 setColorWithButton \u0631\u0648 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0631\u062f\u0645. \u062d\u0627\u0644\u0627 \u0628\u0627 \u062f\u0627\u0628\u0644 \u06a9\u0644\u06cc\u06a9 \u06a9\u0631\u062f\u0646 \u0631\u0648\u06cc \u0633\u06a9\u0631\u06cc\u067e\u062a \u0627\u0648\u0646 \u0631\u0648 \u062f\u0631 \u0648\u06cc\u0698\u0648\u0627\u0644 \u0627\u0633\u062a\u0648\u062f\u06cc\u0648 \u0628\u0627\u0632 \u06a9\u0646\u06cc\u062f<\/p><\/div>\n\n\n\n<div class=\"wp-block-stackable-text stk-block-text stk-block stk-48379d2\" data-block-id=\"48379d2\"><p class=\"stk-block-text__text\">\u06f2- \u0627\u06cc\u0646 \u062f\u0648 \u062e\u0637 \u0631\u0648 \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f. \u062e\u0637 \u0627\u0648\u0644 \u06cc\u0647 \u0645\u062a\u063a\u06cc\u0631 \u0628\u0647 \u0627\u0633\u0645 myTestObject \u0627\u0632 \u0646\u0648\u0639 public \u062a\u0639\u0631\u06cc\u0641 \u0645\u06cc\u200c\u06a9\u0646\u0647 \u06a9\u0647 \u0628\u062a\u0648\u0646\u06cc\u0645 \u062f\u0627\u062e\u0644 \u06cc\u0648\u0646\u06cc\u062a\u06cc \u0645\u062f\u0644 \u0644\u06cc\u0648\u0627\u0646 \u0631\u0648 \u0628\u0647\u0634 \u0648\u0635\u0644 \u06a9\u0646\u06cc\u0645 \u0648 \u0628\u0639\u062f \u0627\u0632 public \u0647\u0645 \u06a9\u0644\u0627\u0633 GameObject \u0631\u0648 \u0622\u0648\u0631\u062f\u06cc\u0645 \u062a\u0627 \u0647\u0645 \u0628\u06af\u06cc\u0645 \u06a9\u0647 \u0686\u06cc\u0632\u06cc \u06a9\u0647 \u0642\u0631\u0627\u0631 \u062f\u0631 \u06cc\u0648\u0646\u06cc\u062a\u06cc \u0628\u0647 \u0627\u06cc\u0646 \u0645\u062a\u063a\u06cc\u0631 \u0648\u0635\u0644 \u0628\u0634\u0647 \u06cc\u0647 GameObject \u0640\u0647 \u0648 \u0647\u0645 \u0628\u062a\u0648\u0646\u06cc\u0645 \u0628\u0647 \u0628\u0639\u0636\u06cc \u0686\u06cc\u0632\u0647\u0627\u06cc \u0645\u0631\u062a\u0628\u0637 \u0628\u0647 \u0645\u062f\u0644 \u062f\u0633\u062a\u0631\u0633\u06cc \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u0647 \u06a9\u0647 \u0628\u0639\u062f\u0646 \u062a\u063a\u06cc\u06cc\u0631 \u0628\u062f\u06cc\u0645.<\/p><\/div>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers cbp-blur-enabled fontFamilyForCodePro\" data-code-block-pro-font-family=\"Code-Pro-Fira-Code\" style=\"font-size:.875rem;font-family:Code-Pro-Fira-Code,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#000000;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class setColorWithButton : MonoBehaviour\n{\n    public GameObject myTestObject;\n    public Color myColor;\n\n    public void myColorChanger()\n    {\n        var myRenderer = myTestObject.GetComponent&lt;Renderer&gt;();\n        myRenderer.material.SetColor(&quot;_Color&quot;, myColor);\n    }\n}\" style=\"color:#000000;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki light-plus\" style=\"background-color: #FFFFFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #AF00DB\">using<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #267F99\">System<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #267F99\">Collections<\/span><span style=\"color: #000000\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #AF00DB\">using<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #267F99\">System<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #267F99\">Collections<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #267F99\">Generic<\/span><span style=\"color: #000000\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #AF00DB\">using<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #267F99\">UnityEngine<\/span><span style=\"color: #000000\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #0000FF\">public<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #0000FF\">class<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #267F99\">setColorWithButton<\/span><span style=\"color: #000000\"> : <\/span><span style=\"color: #267F99\">MonoBehaviour<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">{<\/span><\/span>\n<span class=\"line cbp-no-blur\"><span style=\"color: #000000\">    <\/span><span style=\"color: #0000FF\">public<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #267F99\">GameObject<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #001080\">myTestObject<\/span><span style=\"color: #000000\">;<\/span><\/span>\n<span class=\"line cbp-no-blur\"><span style=\"color: #000000\">    <\/span><span style=\"color: #0000FF\">public<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #267F99\">Color<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #001080\">myColor<\/span><span style=\"color: #000000\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #000000\">    <\/span><span style=\"color: #0000FF\">public<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #0000FF\">void<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #795E26\">myColorChanger<\/span><span style=\"color: #000000\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">    {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">        <\/span><span style=\"color: #0000FF\">var<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #001080\">myRenderer<\/span><span style=\"color: #000000\"> = <\/span><span style=\"color: #001080\">myTestObject<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">GetComponent<\/span><span style=\"color: #000000\">&lt;<\/span><span style=\"color: #267F99\">Renderer<\/span><span style=\"color: #000000\">&gt;();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">        <\/span><span style=\"color: #001080\">myRenderer<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #001080\">material<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">SetColor<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #A31515\">&quot;_Color&quot;<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #001080\">myColor<\/span><span style=\"color: #000000\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">    }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div class=\"wp-block-stackable-text stk-block-text stk-block stk-6891d0a\" data-block-id=\"6891d0a\"><p class=\"stk-block-text__text\">\u062f\u0631 \u062e\u0637 \u0628\u0639\u062f\u06cc \u06cc\u0647 \u0645\u062a\u063a\u06cc\u0631 \u0628\u0647 \u0627\u0633\u0645 myColor \u0628\u0627 \u062f\u0633\u062a\u0631\u0633\u06cc \u0639\u0645\u0648\u0645\u06cc \u062a\u0639\u0631\u06cc\u0641 \u06a9\u0631\u062f\u06cc\u0645 \u06a9\u0647 \u0628\u062a\u0648\u0646\u06cc\u0645 \u062f\u0627\u062e\u0644 \u06cc\u0648\u0646\u06cc\u062a\u06cc \u0628\u0628\u06cc\u0646\u06cc\u0645\u0634. \u06a9\u0627\u0631\u06cc \u0647\u0645 \u06a9\u0647 Color \u0645\u06cc\u200c\u06a9\u0646\u0647 \u0627\u06cc\u0646\u0647 \u06a9\u0647 \u0628\u0647 \u0645\u0627 \u0627\u062c\u0627\u0632\u0647 \u0645\u06cc\u062f\u0647 \u06cc\u0647 \u0631\u0646\u06af \u062f\u0644\u062e\u0648\u0627\u0647 \u0631\u0648 \u062f\u0631 \u06cc\u0648\u0646\u06cc\u062a\u06cc \u0628\u0633\u0627\u0632\u06cc\u0645 \u06a9\u0647 \u0628\u0647\u0634 \u0645\u06cc\u200c\u06af\u0646 Color Constructor \u0648 \u062f\u0631 \u0636\u0645\u0646 \u0631\u0646\u06af \u0631\u0648 \u0647\u0645 \u0628\u0631 \u0627\u0633\u0627\u0633 RGBA \u0630\u062e\u06cc\u0631\u0647 \u0645\u06cc\u200c\u06a9\u0646\u0647 \u06a9\u0647 \u0633\u0647 \u062d\u0631\u0641 \u0627\u0648\u0644 \u0628\u0631\u0627\u06cc \u0642\u0631\u0645\u0632\u060c \u0633\u0628\u0632 \u0648 \u0622\u0628\u06cc\u0647 \u0648 A \u0647\u0645 \u0627\u0648\u0644 \u06a9\u0644\u0645\u0647\u200c\u06cc Alpha \u0633\u062a \u06a9\u0647 \u0645\u06cc\u0632\u0627\u0646 \u0634\u0641\u0627\u0641\u06cc\u062a \u0631\u0648 \u062a\u0639\u06cc\u06cc\u0646 \u0645\u06cc\u200c\u06a9\u0646\u0647.<\/p><\/div>\n\n\n\n<div class=\"wp-block-stackable-text stk-block-text stk-block stk-10d6225\" data-block-id=\"10d6225\"><p class=\"stk-block-text__text\">\u06f3- \u062a\u0627 \u0627\u06cc\u0646\u062c\u0627 \u0631\u0648 \u0630\u062e\u06cc\u0631\u0647 \u06a9\u0646\u06cc\u062f \u0648 \u0628\u0631\u06af\u0631\u062f\u06cc\u062f \u0628\u0647 \u0645\u062d\u06cc\u0637 \u06cc\u0648\u0646\u06cc\u062a\u06cc \u06cc\u0647 GameObject \u0628\u0633\u0627\u0632\u06cc\u062f \u0648 \u0633\u06a9\u0631\u06cc\u067e\u062a \u0631\u0648 \u0628\u0647\u0634 \u0648\u0635\u0644 \u06a9\u0646\u06cc\u062f. \u0645\u06cc\u200c\u0628\u06cc\u0646\u06cc\u062f \u06a9\u0647 \u06cc\u0647 \u0642\u0633\u0645\u062a \u0628\u0631\u0627\u06cc \u0648\u0635\u0644 \u06a9\u0631\u062f\u0646 \u0645\u062f\u0644 \u062f\u0627\u0631\u06cc\u0645 \u0648 \u06cc\u0647 \u0642\u0633\u0645\u062a \u0628\u0631\u0627\u06cc \u062a\u0639\u06cc\u06cc\u0646 \u0631\u0646\u06af<\/p><\/div>\n\n\n\n<div class=\"wp-block-stackable-text stk-block-text stk-block stk-fe0988c\" data-block-id=\"fe0988c\"><p class=\"stk-block-text__text\">\u06f4- \u0645\u062f\u0644 \u0644\u06cc\u0648\u0627\u0646 \u0631\u0648 \u0628\u0647 My Test Object \u0648\u0635\u0644 \u06a9\u0646\u06cc\u062f \u0648 \u0628\u0631\u06af\u0631\u062f\u06cc\u062f \u0648\u06cc\u0698\u0648\u0627\u0644 \u0627\u0633\u062a\u0648\u062f\u06cc\u0648<\/p><\/div>\n\n\n\n<div class=\"wp-block-stackable-image stk-block-image stk-block stk-95f564c\" data-block-id=\"95f564c\"><figure><span class=\"stk-img-wrapper stk-image--shape-stretch stk--has-lightbox\"><img loading=\"lazy\" decoding=\"async\" class=\"stk-img wp-image-1202\" src=\"https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-1.jpg\" width=\"1050\" height=\"472\" srcset=\"https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-1.jpg 1050w, https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-1-300x135.jpg 300w, https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-1-1024x460.jpg 1024w, https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-1-768x345.jpg 768w, https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-1-500x225.jpg 500w, https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-1-800x360.jpg 800w\" sizes=\"auto, (max-width: 1050px) 100vw, 1050px\" \/><\/span><\/figure><\/div>\n\n\n\n<div class=\"wp-block-stackable-text stk-block-text stk-block stk-cbc7a3f\" data-block-id=\"cbc7a3f\"><p class=\"stk-block-text__text\">\u06f5- \u06cc\u0647 \u0645\u062a\u062f public \u0628\u0647 \u0627\u0633\u0645 myColorChanger \u062a\u0639\u0631\u06cc\u0641 \u0645\u06cc\u200c\u06a9\u0646\u06cc\u0645. \u062f\u0631 \u0645\u0648\u0631\u062f \u0645\u062a\u062f <a href=\"https:\/\/mabioca.com\/pa\/blog\/training\/programming\/unity-methods\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u0627\u06cc\u0646\u062c\u0627 \u0631\u0648<\/a> \u0628\u0628\u06cc\u0646\u06cc\u062f \u0648 \u062f\u0631 \u0645\u0648\u0631\u062f void \u0647\u0645 <a href=\"https:\/\/mabioca.com\/pa\/blog\/training\/programming\/change-the-color-of-the-material\/\" data-type=\"link\" data-id=\"https:\/\/mabioca.com\/pa\/blog\/training\/programming\/change-the-color-of-the-material\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u0646\u0648\u0634\u062a\u0647 \u0642\u0628\u0644\u06cc<\/a> \u0631\u0648 \u0628\u062e\u0648\u0646\u06cc\u062f \u0628\u0627 \u0645\u062b\u0627\u0644 \u062a\u0648\u0636\u06cc\u062d \u062f\u0627\u062f\u0645.<\/p><\/div>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers cbp-blur-enabled fontFamilyForCodePro\" data-code-block-pro-font-family=\"Code-Pro-Fira-Code\" style=\"font-size:.875rem;font-family:Code-Pro-Fira-Code,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#000000;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class setColorWithButton : MonoBehaviour\n{\n    public GameObject myTestObject;\n    public Color myColor;\n\n    public void myColorChanger()\n    {\n        var myRenderer = myTestObject.GetComponent&lt;Renderer&gt;();\n        myRenderer.material.SetColor(&quot;_Color&quot;, myColor);\n    }\n}\" style=\"color:#000000;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki light-plus\" style=\"background-color: #FFFFFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #AF00DB\">using<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #267F99\">System<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #267F99\">Collections<\/span><span style=\"color: #000000\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #AF00DB\">using<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #267F99\">System<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #267F99\">Collections<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #267F99\">Generic<\/span><span style=\"color: #000000\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #AF00DB\">using<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #267F99\">UnityEngine<\/span><span style=\"color: #000000\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #0000FF\">public<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #0000FF\">class<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #267F99\">setColorWithButton<\/span><span style=\"color: #000000\"> : <\/span><span style=\"color: #267F99\">MonoBehaviour<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">    <\/span><span style=\"color: #0000FF\">public<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #267F99\">GameObject<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #001080\">myTestObject<\/span><span style=\"color: #000000\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">    <\/span><span style=\"color: #0000FF\">public<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #267F99\">Color<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #001080\">myColor<\/span><span style=\"color: #000000\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line cbp-no-blur\"><span style=\"color: #000000\">    <\/span><span style=\"color: #0000FF\">public<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #0000FF\">void<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #795E26\">myColorChanger<\/span><span style=\"color: #000000\">()<\/span><\/span>\n<span class=\"line cbp-no-blur\"><span style=\"color: #000000\">    {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">        <\/span><span style=\"color: #0000FF\">var<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #001080\">myRenderer<\/span><span style=\"color: #000000\"> = <\/span><span style=\"color: #001080\">myTestObject<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">GetComponent<\/span><span style=\"color: #000000\">&lt;<\/span><span style=\"color: #267F99\">Renderer<\/span><span style=\"color: #000000\">&gt;();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">        <\/span><span style=\"color: #001080\">myRenderer<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #001080\">material<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">SetColor<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #A31515\">&quot;_Color&quot;<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #001080\">myColor<\/span><span style=\"color: #000000\">);<\/span><\/span>\n<span class=\"line cbp-no-blur\"><span style=\"color: #000000\">    }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div class=\"wp-block-stackable-text stk-block-text stk-block stk-4c89c98\" data-block-id=\"4c89c98\"><p class=\"stk-block-text__text\">\u06f6- \u062f\u0648 \u062e\u0637 \u0632\u06cc\u0631 \u0631\u0648 \u0647\u0645 \u0628\u0647 \u0645\u062a\u062f \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f \u06a9\u0647 \u062f\u0642\u06cc\u0642\u0627 \u0647\u0645\u0648\u0646 \u062f\u0648 \u062e\u0637 \u0622\u062e\u0631\u06cc\u0647 \u06a9\u0647 \u062f\u0631 <a href=\"https:\/\/mabioca.com\/pa\/blog\/training\/programming\/change-the-color-of-the-material\/\" data-type=\"link\" data-id=\"https:\/\/mabioca.com\/pa\/blog\/training\/programming\/change-the-color-of-the-material\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u0646\u0648\u0634\u062a\u0647\u200c\u06cc \u0642\u0628\u0644\u06cc<\/a> \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0631\u062f\u06cc\u0645 \u062a\u0648\u0636\u06cc\u062d\u0627\u062a\u0634 \u0647\u0645 \u0647\u0645\u0648\u0646\u062c\u0627\u0633\u062a.<\/p><\/div>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers cbp-blur-enabled fontFamilyForCodePro\" data-code-block-pro-font-family=\"Code-Pro-Fira-Code\" style=\"font-size:.875rem;font-family:Code-Pro-Fira-Code,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#000000;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class setColorWithButton : MonoBehaviour\n{\n    public GameObject myTestObject;\n    public Color myColor;\n\n    public void myColorChanger()\n    {\n        var myRenderer = myTestObject.GetComponent&lt;Renderer&gt;();\n        myRenderer.material.SetColor(&quot;_Color&quot;, myColor);\n    }\n}\" style=\"color:#000000;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki light-plus\" style=\"background-color: #FFFFFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #AF00DB\">using<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #267F99\">System<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #267F99\">Collections<\/span><span style=\"color: #000000\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #AF00DB\">using<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #267F99\">System<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #267F99\">Collections<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #267F99\">Generic<\/span><span style=\"color: #000000\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #AF00DB\">using<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #267F99\">UnityEngine<\/span><span style=\"color: #000000\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #0000FF\">public<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #0000FF\">class<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #267F99\">setColorWithButton<\/span><span style=\"color: #000000\"> : <\/span><span style=\"color: #267F99\">MonoBehaviour<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">    <\/span><span style=\"color: #0000FF\">public<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #267F99\">GameObject<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #001080\">myTestObject<\/span><span style=\"color: #000000\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">    <\/span><span style=\"color: #0000FF\">public<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #267F99\">Color<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #001080\">myColor<\/span><span style=\"color: #000000\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #000000\">    <\/span><span style=\"color: #0000FF\">public<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #0000FF\">void<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #795E26\">myColorChanger<\/span><span style=\"color: #000000\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">    {<\/span><\/span>\n<span class=\"line cbp-no-blur\"><span style=\"color: #000000\">        <\/span><span style=\"color: #0000FF\">var<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #001080\">myRenderer<\/span><span style=\"color: #000000\"> = <\/span><span style=\"color: #001080\">myTestObject<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">GetComponent<\/span><span style=\"color: #000000\">&lt;<\/span><span style=\"color: #267F99\">Renderer<\/span><span style=\"color: #000000\">&gt;();<\/span><\/span>\n<span class=\"line cbp-no-blur\"><span style=\"color: #000000\">        <\/span><span style=\"color: #001080\">myRenderer<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #001080\">material<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">SetColor<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #A31515\">&quot;_Color&quot;<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #001080\">myColor<\/span><span style=\"color: #000000\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">    }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div class=\"wp-block-stackable-text stk-block-text stk-block stk-3bccbd9\" data-block-id=\"3bccbd9\"><p class=\"stk-block-text__text\">\u06f7- \u0641\u0627\u06cc\u0644 \u0631\u0648 \u0630\u062e\u06cc\u0631\u0647 \u06a9\u0646\u06cc\u062f \u0648 \u0628\u0631\u06af\u0631\u062f\u06cc\u062f \u0645\u062d\u06cc\u0637 \u06cc\u0648\u0646\u06cc\u062a\u06cc<\/p><\/div>\n\n\n\n<div class=\"wp-block-stackable-text stk-block-text stk-block stk-73796b3\" data-block-id=\"73796b3\"><p class=\"stk-block-text__text\">\u06f8- \u06cc\u0647 UI &gt; Image \u0628\u0633\u0627\u0632\u06cc\u062f \u06a9\u0647 \u0645\u06cc\u200c\u062e\u0648\u0627\u06cc\u0645 \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u062f\u06a9\u0645\u0647 \u0627\u0632\u0634 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u0645. \u06cc\u0647 \u062a\u0635\u0648\u06cc\u0631 \u0633\u0627\u062f\u0647 \u062f\u0627\u06cc\u0631\u0647\u200c\u0627\u06cc \u0634\u06a9\u0644 \u0647\u0645 \u062f\u0631 \u0641\u0627\u06cc\u0644\u200c\u0647\u0627\u06cc \u067e\u0631\u0648\u0698\u0647 \u0647\u0633\u062a \u06a9\u0647 \u0627\u0648\u0646 \u0631\u0648 \u0628\u06af\u06cc\u0631\u06cc\u062f\u060c \u0628\u06a9\u0634\u06cc\u062f \u0648 \u0628\u0646\u062f\u0627\u0632\u06cc\u062f \u062f\u0631 \u0642\u0633\u0645\u062a Source Image \u062f\u0631 \u067e\u0646\u062c\u0631\u0647\u200c\u06cc Inspector<\/p><\/div>\n\n\n\n<div class=\"wp-block-stackable-text stk-block-text stk-block stk-a8d4eec\" data-block-id=\"a8d4eec\"><p class=\"stk-block-text__text\">\u06f9- \u0647\u0645\u0686\u0646\u0627\u0646 \u06a9\u0647 Image &nbsp;\u0627\u0646\u062a\u062e\u0627\u0628\u0647 \u062f\u0631 \u067e\u0627\u06cc\u06cc\u0646 \u067e\u0646\u062c\u0631\u0647\u200c\u06cc Inspector \u0631\u0648\u06cc \u062f\u06a9\u0645\u0647\u200c\u06cc Add Component \u06a9\u0644\u06cc\u06a9 \u06a9\u0646\u06cc\u062f \u0648 \u06cc\u0647 Button \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f \u0648 \u0628\u0639\u062f \u0631\u0648\u06cc \u0639\u0644\u0627\u0645\u062a + \u062f\u0631 On Click \u06a9\u0644\u06cc\u06a9 \u06a9\u0646\u06cc\u062f<\/p><\/div>\n\n\n\n<div class=\"wp-block-stackable-image stk-block-image stk-block stk-81b521b\" data-block-id=\"81b521b\"><figure><span class=\"stk-img-wrapper stk-image--shape-stretch stk--has-lightbox\"><img loading=\"lazy\" decoding=\"async\" class=\"stk-img wp-image-1204\" src=\"https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-2.jpg\" width=\"1050\" height=\"693\" srcset=\"https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-2.jpg 1050w, https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-2-300x198.jpg 300w, https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-2-1024x676.jpg 1024w, https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-2-768x507.jpg 768w, https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-2-500x330.jpg 500w, https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-2-800x528.jpg 800w\" sizes=\"auto, (max-width: 1050px) 100vw, 1050px\" \/><\/span><\/figure><\/div>\n\n\n\n<div class=\"wp-block-stackable-text stk-block-text stk-block stk-373392e\" data-block-id=\"373392e\"><p class=\"stk-block-text__text\">\u06f1\u06f0- \u062d\u0627\u0644\u0627 GameObject \u0631\u0648 \u0627\u0632 \u067e\u0646\u062c\u0631\u0647\u200c\u06cc Hierarchy \u0628\u06af\u06cc\u0631\u06cc\u062f \u0648 \u0628\u0646\u062f\u0627\u0632\u06cc\u062f \u062f\u0631 \u0642\u0633\u0645\u062a None (Object) \u062a\u0627 \u0648\u0635\u0644 \u0628\u0634\u0647<\/p><\/div>\n\n\n\n<div class=\"wp-block-stackable-text stk-block-text stk-block stk-7168d5a\" data-block-id=\"7168d5a\"><p class=\"stk-block-text__text\">\u06f1\u06f1- \u0631\u0648\u06cc No Function \u06a9\u0644\u06cc\u06a9 \u06a9\u0646\u06cc\u062f \u0648 \u0637\u0628\u0642 \u062a\u0635\u0648\u06cc\u0631 \u0645\u062a\u062f myColorChanger \u0631\u0648 \u0627\u0632 \u06a9\u0644\u0627\u0633 setColorWithButton \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0646\u06cc\u062f<\/p><\/div>\n\n\n\n<div class=\"wp-block-stackable-text stk-block-text stk-block stk-0940a5e\" data-block-id=\"0940a5e\"><p class=\"stk-block-text__text\">\u0628\u0627 \u0627\u06cc\u0646 \u06a9\u0627\u0631 \u0647\u0631 \u0648\u0642\u062a \u0631\u0648\u06cc \u062a\u0635\u0648\u06cc\u0631 \u062f\u06a9\u0645\u0647 \u06a9\u0644\u06cc\u06a9 \u06a9\u0646\u06cc\u062f \u0645\u062a\u062f &nbsp;myColorChanger \u0627\u062c\u0631\u0627 \u0645\u06cc\u0634\u0647 \u06a9\u0647 \u062f\u0627\u062e\u0644 \u0627\u0648\u0646 \u06a9\u062f\u0647\u0627\u06cc\u06cc \u0628\u0631\u0627\u06cc \u062a\u063a\u06cc\u06cc\u0631 \u0631\u0646\u06af \u0645\u062f\u0644\u06cc\u0647 \u06a9\u0647 \u0628\u0647 GameObject \u0648\u0635\u0644 \u06a9\u0631\u062f\u06cc\u0645 \u06a9\u0647 \u0627\u06cc\u0646\u062c\u0627 \u0645\u062f\u0644 \u0644\u06cc\u0648\u0627\u0646\u0647.<\/p><\/div>\n\n\n\n<div class=\"wp-block-stackable-image stk-block-image stk-block stk-4dfe3b9\" data-block-id=\"4dfe3b9\"><figure><span class=\"stk-img-wrapper stk-image--shape-stretch stk--has-lightbox\"><img loading=\"lazy\" decoding=\"async\" class=\"stk-img wp-image-1208\" src=\"https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-4.jpg\" width=\"1050\" height=\"693\" srcset=\"https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-4.jpg 1050w, https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-4-300x198.jpg 300w, https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-4-1024x676.jpg 1024w, https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-4-768x507.jpg 768w, https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-4-500x330.jpg 500w, https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-4-800x528.jpg 800w\" sizes=\"auto, (max-width: 1050px) 100vw, 1050px\" \/><\/span><\/figure><\/div>\n\n\n\n<div class=\"wp-block-stackable-text stk-block-text stk-block stk-b33d18b\" data-block-id=\"b33d18b\"><p class=\"stk-block-text__text\">\u06f1\u06f2- GameObject \u0631\u0648 \u0627\u0632 \u067e\u0646\u062c\u0631\u0647\u200c\u06cc Inspector &nbsp;\u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0646\u06cc\u062f \u0648 \u0627\u0632 \u0637\u0631\u06cc\u0642 My Color \u06cc\u0647 \u0631\u0646\u06af \u062f\u0644\u062e\u0648\u0627\u0647 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0646\u06cc\u062f \u0648 \u0628\u0639\u062f \u062f\u06a9\u0645\u0647\u200c\u06cc play \u0631\u0648 \u0628\u0632\u0646\u06cc\u062f. \u0628\u0639\u062f \u0627\u0632 \u0627\u062c\u0631\u0627 \u0634\u062f\u0646 \u0628\u0627 \u06a9\u0644\u06cc\u06a9 \u0631\u0648\u06cc \u062f\u06a9\u0645\u0647 \u0628\u0627\u06cc\u062f \u0631\u0646\u06af \u0644\u06cc\u0648\u0627\u0646 \u0628\u0647 \u0631\u0646\u06af \u0627\u0646\u062a\u062e\u0627\u0628\u06cc \u062a\u063a\u06cc\u06cc\u0631 \u06a9\u0646\u0647.<\/p><\/div>\n\n\n\n<div class=\"wp-block-stackable-image stk-block-image stk-block stk-02c6319\" data-block-id=\"02c6319\"><style>.stk-02c6319 .stk-img-wrapper img{object-position:50% 49% !important}<\/style><figure><span class=\"stk-img-wrapper stk-image--shape-stretch stk--has-lightbox\"><img loading=\"lazy\" decoding=\"async\" class=\"stk-img wp-image-1209\" src=\"https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-5.jpg\" width=\"1050\" height=\"643\" srcset=\"https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-5.jpg 1050w, https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-5-300x184.jpg 300w, https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-5-1024x627.jpg 1024w, https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-5-768x470.jpg 768w, https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-5-500x306.jpg 500w, https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-5-800x490.jpg 800w\" sizes=\"auto, (max-width: 1050px) 100vw, 1050px\" \/><\/span><\/figure><\/div>\n\n\n\n<div class=\"wp-block-stackable-text stk-block-text stk-block stk-61dbec6\" data-block-id=\"61dbec6\"><p class=\"stk-block-text__text\">\u0627\u06af\u0647 \u0633\u0648\u0627\u0644\u06cc \u062f\u0627\u0634\u062a\u06cc\u062f \u067e\u0627\u06cc\u06cc\u0646 \u0628\u067e\u0631\u0633\u06cc\u062f.<\/p><\/div>\n\n\n\n<div class=\"wp-block-stackable-image stk-block-image has-text-align-left stk-block stk-7e2b782\" data-block-id=\"7e2b782\"><style>.stk-7e2b782 .stk-img-wrapper{width:50px !important}<\/style><figure><a class=\"stk-link\" href=\"https:\/\/mabioca.com\/blog\/scripting\/changing-the-color-of-an-object-using-a-button-in-unity\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"stk-img-wrapper stk-image--shape-stretch\"><img loading=\"lazy\" decoding=\"async\" class=\"stk-img\" src=\"https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2021\/12\/languages.svg\" width=\"50\" height=\"300\"\/><\/span><\/a><\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u0627\u06cc\u0646 \u0646\u0648\u0634\u062a\u0647 \u0628\u0647 \u0646\u0648\u0634\u062a\u0647\u200c\u06cc \u0642\u0628\u0644\u06cc \u062f\u0631 \u0645\u0648\u0631\u062f \u062a\u063a\u06cc\u06cc\u0631 \u0631\u0646\u06af \u06cc\u0647 \u0645\u0648\u0636\u0648\u0639 \u0645\u0631\u062a\u0628\u0637\u0647 \u067e\u0633 \u062d\u062a\u0645\u0646 \u0627\u0648\u0644 \u0627\u0648\u0646 \u0631\u0648 \u0628\u062e\u0648\u0646\u06cc\u062f \u0686\u0648\u0646 \u06cc\u0647 \u0686\u06cc\u0632\u0627\u06cc\u06cc \u0631\u0648 \u0627\u0648\u0646\u062c\u0627 \u062a\u0648\u0636\u06cc\u062d \u062f\u0627\u062f\u0645 \u06a9\u0647 \u0627\u06cc\u0646\u062c\u0627 \u0628\u0631\u0627\u06cc \u0627\u06cc\u0646\u06a9\u0647 \u062a\u06a9\u0631\u0627\u0631\u06cc \u0646\u0634\u0647 \u062a\u0648\u0636\u06cc\u062d \u0646\u0645\u06cc\u200c\u062f\u0645. \u06cc\u0647 \u0646\u06a9\u062a\u0647\u200c\u06cc \u062f\u06cc\u06af\u0647 \u0627\u06cc\u0646\u06a9\u0647 \u0646\u0631\u0645 \u0627\u0641\u0632\u0627\u0631 \u06af\u06cc\u062a \u0647\u0627\u0628 \u062f\u0633\u06a9\u062a\u0627\u067e \u0631\u0648 \u0631\u0648\u06cc \u0633\u06cc\u0633\u062a\u0645 \u062a\u0648\u0646 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u06cc\u062f \u0648 \u0627\u0632 \u0627\u06cc\u0646 \u0644\u06cc\u0646\u06a9 \u067e\u0631\u0648\u0698\u0647\u200e\u0627\u06cc \u06a9\u0647 \u0627\u06cc\u0646\u062c\u0627 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":1353,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_seopress_titles_title":"\u062a\u063a\u06cc\u06cc\u0631 \u0631\u0646\u06af \u06cc\u06a9 \u0645\u0648\u0636\u0648\u0639 \u0628\u0627 \u062f\u06a9\u0645\u0647 \u062f\u0631 \u0633\u06a9\u0631\u06cc\u067e\u062a \u0646\u0648\u06cc\u0633\u06cc \u06cc\u0648\u0646\u06cc\u062a\u06cc","_seopress_titles_desc":"\u062f\u0631 \u0627\u06cc\u0646 \u0646\u0648\u0634\u062a\u0647 \u0642\u0631\u0627\u0631\u0647 \u0628\u0627 \u0686\u0646\u062f \u062e\u0637 \u06a9\u062f \u0633\u0627\u062f\u0647 \u06a9\u0627\u0631\u06cc \u06a9\u0646\u06cc\u0645 \u06a9\u0647 \u0628\u0627 \u0641\u0634\u0627\u0631 \u062f\u0627\u062f\u0646 \u06cc\u0647 \u062f\u06a9\u0645\u0647 \u062f\u0631 \u0635\u062d\u0646\u0647 \u0631\u0646\u06af \u0644\u06cc\u0648\u0627\u0646 \u062a\u063a\u06cc\u06cc\u0631 \u06a9\u0646\u0647 \u0648 \u06cc\u0647 \u0642\u0633\u0645\u062a \u0647\u0645 \u0628\u0631\u0627\u06cc \u062a\u0639\u06cc\u06cc\u0646 \u0631\u0646\u06af \u0628\u0633\u0627\u0632\u06cc\u0645 .","_seopress_robots_index":"","_seopress_robots_follow":"","_seopress_robots_imageindex":"","_seopress_robots_snippet":"","_seopress_robots_primary_cat":"none","_seopress_robots_breadcrumbs":"","_seopress_robots_freeze_modified_date":"","_seopress_robots_custom_modified_date":"","_seopress_robots_canonical":"","_seopress_social_fb_title":"","_seopress_social_fb_desc":"","_seopress_social_fb_img":"https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-FeaturedImge-v1.jpg","_seopress_social_fb_img_attachment_id":1353,"_seopress_social_fb_img_width":700,"_seopress_social_fb_img_height":525,"_seopress_social_twitter_title":"","_seopress_social_twitter_desc":"","_seopress_social_twitter_img":"https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-FeaturedImge-v1.jpg","_seopress_social_twitter_img_attachment_id":1353,"_seopress_social_twitter_img_width":700,"_seopress_social_twitter_img_height":525,"_seopress_redirections_value":"","_seopress_redirections_enabled":"","_seopress_redirections_enabled_regex":"","_seopress_redirections_logged_status":"both","_seopress_redirections_param":"","_seopress_redirections_type":301,"_seopress_analysis_target_kw":"\u06cc\u0648\u0646\u06cc\u062a\u06cc,\u0633\u06cc \u0634\u0627\u0631\u067e,\u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc,C#,\u062a\u063a\u06cc\u06cc\u0631 \u0631\u0646\u06af,color,material","_vp_format_video_url":"","_vp_image_focal_point":[],"footnotes":""},"categories":[237],"tags":[239,238,240,155],"class_list":["post-1177","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming","tag-c","tag-238","tag-240","tag-155"],"blocksy_meta":[],"featured_image_urls_v2":{"full":["https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-FeaturedImge-v1.jpg",700,525,false],"thumbnail":["https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-FeaturedImge-v1-150x150.jpg",150,150,true],"medium":["https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-FeaturedImge-v1-300x225.jpg",300,225,true],"medium_large":["https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-FeaturedImge-v1.jpg",700,525,false],"large":["https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-FeaturedImge-v1.jpg",700,525,false],"1536x1536":["https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-FeaturedImge-v1.jpg",700,525,false],"2048x2048":["https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-FeaturedImge-v1.jpg",700,525,false],"vp_sm":["https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-FeaturedImge-v1-500x375.jpg",500,375,true],"vp_md":["https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-FeaturedImge-v1.jpg",700,525,false],"vp_lg":["https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-FeaturedImge-v1.jpg",700,525,false],"vp_xl":["https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-FeaturedImge-v1.jpg",700,525,false],"vp_sm_popup":["https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-FeaturedImge-v1-500x375.jpg",500,375,true],"vp_md_popup":["https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-FeaturedImge-v1.jpg",700,525,false],"vp_xl_popup":["https:\/\/mabioca.com\/pa\/wp-content\/uploads\/sites\/4\/2024\/02\/Unity-ColorChangeWithButton-FeaturedImge-v1.jpg",700,525,false]},"post_excerpt_stackable_v2":"<p>\u0627\u06cc\u0646 \u0646\u0648\u0634\u062a\u0647 \u0628\u0647 \u0646\u0648\u0634\u062a\u0647\u200c\u06cc \u0642\u0628\u0644\u06cc \u062f\u0631 \u0645\u0648\u0631\u062f \u062a\u063a\u06cc\u06cc\u0631 \u0631\u0646\u06af \u06cc\u0647 \u0645\u0648\u0636\u0648\u0639 \u0645\u0631\u062a\u0628\u0637\u0647 \u067e\u0633 \u062d\u062a\u0645\u0646 \u0627\u0648\u0644 \u0627\u0648\u0646 \u0631\u0648 \u0628\u062e\u0648\u0646\u06cc\u062f \u0686\u0648\u0646 \u06cc\u0647 \u0686\u06cc\u0632\u0627\u06cc\u06cc \u0631\u0648 \u0627\u0648\u0646\u062c\u0627 \u062a\u0648\u0636\u06cc\u062d \u062f\u0627\u062f\u0645 \u06a9\u0647 \u0627\u06cc\u0646\u062c\u0627 \u0628\u0631\u0627\u06cc \u0627\u06cc\u0646\u06a9\u0647 \u062a\u06a9\u0631\u0627\u0631\u06cc \u0646\u0634\u0647 \u062a\u0648\u0636\u06cc\u062d \u0646\u0645\u06cc\u200c\u062f\u0645. \u06cc\u0647 \u0646\u06a9\u062a\u0647\u200c\u06cc \u062f\u06cc\u06af\u0647 \u0627\u06cc\u0646\u06a9\u0647 \u0646\u0631\u0645 \u0627\u0641\u0632\u0627\u0631 \u06af\u06cc\u062a \u0647\u0627\u0628 \u062f\u0633\u06a9\u062a\u0627\u067e \u0631\u0648 \u0631\u0648\u06cc \u0633\u06cc\u0633\u062a\u0645 \u062a\u0648\u0646 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u06cc\u062f \u0648 \u0627\u0632 \u0627\u06cc\u0646 \u0644\u06cc\u0646\u06a9 \u067e\u0631\u0648\u0698\u0647\u200e\u0627\u06cc \u06a9\u0647 \u0627\u06cc\u0646\u062c\u0627 \u062a\u0648\u0636\u06cc\u062d \u0645\u06cc\u062f\u0645 \u0631\u0648 \u062f\u0627\u0646\u0644\u0648\u062f \u06a9\u0646\u06cc\u062f \u06a9\u0647 \u0646\u062a\u06cc\u062c\u0647\u200c\u06cc \u0646\u0647\u0627\u06cc\u06cc \u062a\u0648\u0636\u06cc\u062d\u0627\u062a \u0627\u06cc\u0646\u062c\u0627 \u062f\u0631 \u0641\u0627\u06cc\u0644 \u0635\u062d\u0646\u0647 \u0628\u0647 \u0627\u0633\u0645 ColorChangeWithButtonScript \u062f\u0631 Assets &gt; Scenes \u0630\u062e\u06cc\u0631\u0647 \u0634\u062f\u0647 \u0648 \u062f\u0631 \u0636\u0645\u0646 \u0628\u0631\u0627\u06cc \u062a\u0645\u0631\u06cc\u0646 \u0647\u0645 \u0645\u06cc\u200c\u062a\u0648\u0646\u06cc\u062f \u0627\u0632\u0634 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f. \u062f\u0631 \u0627\u06cc\u0646 \u0645\u0637\u0644\u0628 \u0647\u0645\u0627\u0646\u0637\u0648\u0631 \u06a9\u0647 \u0627\u0632 \u0639\u0646\u0648\u0627\u0646\u0634 \u0647\u0645 \u062a\u0627 \u062d\u062f\u06cc \u0645\u0634\u062e\u0635\u0647 \u0642\u0631\u0627\u0631\u0647 \u0628\u0627&hellip;<\/p>\n","category_list_v2":"<a href=\"https:\/\/mabioca.com\/pa\/blog\/training\/programming\/\" rel=\"category tag\">\u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc<\/a>","author_info_v2":{"name":"\u0631\u0636\u0627\u062e\u0627\u0646\u06cc","url":"https:\/\/mabioca.com\/pa\/author\/behrad\/"},"comments_num_v2":"0 \u062f\u06cc\u062f\u06af\u0627\u0647","_links":{"self":[{"href":"https:\/\/mabioca.com\/pa\/wp-json\/wp\/v2\/posts\/1177","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mabioca.com\/pa\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mabioca.com\/pa\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mabioca.com\/pa\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/mabioca.com\/pa\/wp-json\/wp\/v2\/comments?post=1177"}],"version-history":[{"count":1,"href":"https:\/\/mabioca.com\/pa\/wp-json\/wp\/v2\/posts\/1177\/revisions"}],"predecessor-version":[{"id":1927,"href":"https:\/\/mabioca.com\/pa\/wp-json\/wp\/v2\/posts\/1177\/revisions\/1927"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mabioca.com\/pa\/wp-json\/wp\/v2\/media\/1353"}],"wp:attachment":[{"href":"https:\/\/mabioca.com\/pa\/wp-json\/wp\/v2\/media?parent=1177"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mabioca.com\/pa\/wp-json\/wp\/v2\/categories?post=1177"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mabioca.com\/pa\/wp-json\/wp\/v2\/tags?post=1177"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}