using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using TMPro; using System.Linq; public class COLORSET : MonoBehaviour { public static void On() { addcolor("C1", "Image", _G.Color1); addcolor("C2", "Image", _G.Color2); addcolor("CT1", "text", _G.Color1); addcolor("CT2", "text", _G.Color2); 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); } 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); } } public static void Global() { SoftColorListData softColor = _G.LibrarySoftColors.ElementAt(0).Value; string colsbar = softColor.Bar_Color; byte a_bar = byte.Parse(softColor.Bar_Alpha); _G.colorBar = DOIT.CSc(colsbar, a_bar); string colsbutton = softColor.Button_Color; byte a_button = byte.Parse(softColor.Button_Alpha); _G.colorButton = DOIT.CSc(colsbutton, a_button); _G.Color1 = colsbutton; string colsIcon = softColor.Icon_Color; byte a_Icon = byte.Parse(softColor.Icon_Alpha); _G.colorIcon = DOIT.CSc(colsIcon, a_Icon); _G.Color2 = colsIcon; string colsText = softColor.Text_Color; byte a_Text = byte.Parse(softColor.Text_Alpha); _G.colorText = DOIT.CSc(colsText, a_Text); string colsBG = softColor.Background_Color; byte a_BG = byte.Parse(softColor.Background_Alpha); _G.colorBG = DOIT.CSc(colsBG, a_BG); } }