///<summary> ///set new colors for all material listed in sceneMaterials ///</summary> public void SetSceneMaterialsColor() { ColorPack color_pack = colorManager.getColorComb()[0]; // get new color comb from ColorManager int sizeOfMaterial = sceneMaterials.Length; // lenght of sceneMaterial int indMat = 0; // index of Material in sceneMaterial list int indClr = 0; // index of color in colorComb list mainCamera.backgroundColor = colorManager.getBackgroundColor(); // et color for backGround List <Color32> color_list = color_pack.colors_list; int sizeOfColorPacks = color_list.Count; // number of colors in Color Combination while (indMat < sizeOfMaterial) { //if colors in colorComb finished, set pointer to zero and start over if (indClr >= sizeOfColorPacks) { indClr = 0; } ChangeColorOfMaterial(sceneMaterials[indMat], color_list[indClr]); indMat++; indClr++; } }
public static ColorPack getColorPackFromJson(JSONNode colorPack) { ColorPack newColorPack = new ColorPack(colorPack["name"].Value); for (int i = 0; i < colorPack["colors"].Count; i++) { Color32 color = parseColorFromJson(colorPack["colors"][i]); newColorPack.colors_list.Add(color); } return(newColorPack); }
public void changeUniverse(GameObject universeObj) { UniverseBlock block = universeObj.GetComponent <UniverseBlock>(); ColorPack newColorPack = block.universesColor[Random.Range(0, block.universesColor.Length)]; availableColors = newColorPack.colors; universeBonus = newColorPack.bonus; chooseColor(); pool.standBy(universeObj); block.stop(); StartCoroutine(getAllWhite(true)); StartCoroutine(returnDefaultColors(universeObj)); }
public static Color4 FromArgb(int argb) { ColorPack c = default; c.Argb = argb; return(new Color4( c.R, c.G, c.B, c.A )); }
public static ColorPack[] getColorPacksList() { string dataFromFile = getDataFromLocalFile("color_collection1.txt"); JSONNode data = JSONNode.Parse(dataFromFile); ColorPack[] colorPacks = new ColorPack[data["color_packs"].Count]; for (int i = 0; i < data["color_packs"].Count; i++) { ColorPack newColorPack = getColorPackFromJson(data["color_packs"][i]); colorPacks[i] = newColorPack; } return(colorPacks); }
public GUIColorLookupAttribute(ColorPack uniqueColors) { Main = uniqueColors.Main; Fields = uniqueColors.Fields; }