using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using TMPro; public class COLORSET : MonoBehaviour { public static void On() { addcolor("C1", "Image",_G.Color1); addcolor("CT2", "text",_G.Color2); /*//ColorBlock theColor; addcolor("C2", "Image",_G.Color2); addcolor("CT1", "text",_G.Color1); addcolor("CTP1", "textpro",_G.Color1); addcolor("CTP2", "textpro",_G.Color2); addcolor("ct1", "text",_G.Color1); addcolor("ct2", "text",_G.Color2); addcolor("ctp1", "textpro",_G.Color1); addcolor("ctp2", "textpro",_G.Color2); GameObject[] Checkers = GameObject.FindGameObjectsWithTag("checkmark"); foreach (GameObject obj in Checkers) { obj.GetComponent().color = DOIT.CSc(_G.Color2, 255); } GameObject[] Checkers2 = GameObject.FindGameObjectsWithTag("checkmark2"); foreach (GameObject obj in Checkers2) { obj.GetComponent().color = DOIT.CSc(_G.Color2, 255); }*/ } public static void addcolor(string Tag, string P, string Col){ GameObject[] C = GameObject.FindGameObjectsWithTag(Tag); foreach (GameObject obj in C) { if(P=="text")obj.GetComponent().color=DOIT.CSc(Col,255); if(P=="textpro")obj.GetComponent().color=DOIT.CSc(Col,255); if(P=="Image")obj.GetComponent().color=DOIT.CSc(Col,255); } } }