public void setSolutionKey(DropContainerLock solutionLock) { isSolution = true; correctSlot = solutionLock.mySlotNum; for(int i = 0; i < mySymbols.Length; i++) { GameObject g = mySymbols[i]; g.GetComponent<UISprite>().spriteName = keySymbols[solutionLock.symbols[i]]; g.GetComponent<UISprite>().depth = 3; g.GetComponent<UISprite>().color = solutionLock.lockForColors[solutionLock.colors[i]]; } if(manager.minigame.difficulty != MinigameDifficulty.Difficulty.EASY) { myKey.GetComponent<UISprite>().color = solutionLock.lockBackColors[solutionLock.bgcol]; }else { myKey.GetComponent<UISprite>().color = new Color(.868f, .868f, .868f, 1.0f); } disabled = false; }
public void setKey(List<int> symbols, DropContainerLock referenceLock) { bool keyExists = false; do { keyExists = false; isSolution = false; for(int i = 0; i < mySymbols.Length; i++) { GameObject g = mySymbols[i]; g.GetComponent<UISprite>().spriteName = keySymbols[symbols[i]]; g.GetComponent<UISprite>().depth = 3; g.GetComponent<UISprite>().color = referenceLock.lockForColors[Random.Range(0, referenceLock.lockForColors.Length - 1)]; } if(manager.minigame.difficulty != MinigameDifficulty.Difficulty.EASY) { myKey.GetComponent<UISprite>().color = referenceLock.lockBackColors[Random.Range(0, referenceLock.lockBackColors.Length - 1)]; } else { myKey.GetComponent<UISprite>().color = new Color(.868f, .868f, .868f, 1.0f); } disabled = false; foreach(GameObject g in manager.getAllKeysOfLevel()) { if(g.activeSelf) { if(isKeySame(g.GetComponent<DraggableObjectKey>())) { keyExists = true; break; } } } } while(keyExists); }