public SecretColor GetUnlockedColor(List <SecretColor> lockedcolors) { SecretColor checkedColor = AllSecretColors[0]; while (true) { int randint = Random.Range(0, AllSecretColors.Length); checkedColor = AllSecretColors[randint]; bool found = false; for (int k = 0; k < lockedcolors.Count; k++) { if (lockedcolors[k].ColorString == checkedColor.ColorString) { found = true; break; } } if (!found) { break; } } return(checkedColor); }
public void UpdateMe(int index) { Text = myText.GetComponent <TextMeshProUGUI>(); Image = myImage.GetComponent <RawImage>(); myIndex = index; Debug.Log(myIndex); myTip = GameObject.FindWithTag("Player").GetComponent <ColorBubbleInventory>().TipsInventory[myIndex]; Text.SetText(myTip.MyTip); Image.texture = myTip.myTexture; }
public void SetMySecret(SecretColor mysecret) { mySecret = mysecret; myHolder.GetComponent <MeshRenderer>().material = mySecret.Mesh.GetComponent <Renderer>().sharedMaterial; myHolder.GetComponent <MeshFilter>().mesh = mySecret.Mesh.GetComponent <MeshFilter>().sharedMesh; }