Esempio n. 1
0
	// Use this for initialization
	void Start () {
		state = new bool[10];
		GameObject runeObject = gameObject.transform.Find ("Rune").gameObject;
		if (runeObject != null) {
			rune = runeObject.GetComponent<Rune> ();
		} 
		GameObject runeObject2 = gameObject.transform.Find ("Candles").gameObject;
		if (runeObject2 != null) {
			candles = runeObject2.GetComponent<Candles> ();
		} 
		changed ();
	}
Esempio n. 2
0
    public static void RandomizeGame() {
        GameState.HadDrink = (GameState.Drink)Random.Range(0, (int)GameState.Drink.NumDrinks);
        GameState.Time = (GameState.TimeOfDay)Random.Range(0, 2);
        GameState.CandleLit = (GameState.Candles)Random.Range(0, 2);

        CorrectSymbols[0] = Random.Range(0, 6);
        CorrectSymbols[1] = Random.Range(CorrectSymbols[0] + 1, 7);
        CorrectSymbols[2] = Random.Range(CorrectSymbols[1] + 1, 8);
        CorrectSymbols[3] = Random.Range(CorrectSymbols[2] + 1, 9);
        CorrectSymbols[4] = Random.Range(CorrectSymbols[3] + 1, 10);

        if (Random.value > 0.5) {
            CorrectSymbols[0] = 0;
            CorrectSymbols[1] = 1;
            CorrectSymbols[2] = Random.Range(2, 8);
            CorrectSymbols[3] = Random.Range(CorrectSymbols[2]+1, 9);
            CorrectSymbols[4] = Random.Range(CorrectSymbols[3]+1, 10);
        } else {
            CorrectSymbols[0] = symbolSolutionD[CorrectSymbols[0]];
            CorrectSymbols[1] = symbolSolutionD[CorrectSymbols[1]];
            CorrectSymbols[2] = symbolSolutionD[CorrectSymbols[2]];
            CorrectSymbols[3] = symbolSolutionD[CorrectSymbols[3]];
            CorrectSymbols[4] = symbolSolutionD[CorrectSymbols[4]];
        }

        ActiveSymbols = CorrectSymbols.OrderBy(x => Random.value).ToArray();
        if (GameState.CandleLit == GameState.Candles.Lit) {
            CorrectSymbols = CorrectSymbols.Reverse().ToArray();
        }
    }