Exemplo n.º 1
0
    void Start()
    {
        moduleId = moduleIdCounter++;
        ShuffleColors(false);

        for (var i = 0; i < 10; i++)
        {
            var j = i;

            ModuleButtons[i].OnInteract += delegate() {
                OnButtonPress(j);

                return(false);
            };
        }

        SubmitButton.GetComponent <Renderer>().material.color = new Color32(239, 228, 176, 255);
        SubmitButton.OnInteract += delegate() {
            OnSubmitPress();

            return(false);
        };

        var lightScalar = transform.lossyScale.x;

        for (var i = 0; i < ModuleLights.Length; i++)
        {
            ModuleLights[i].transform.GetChild(0).GetComponent <Light>().range *= lightScalar;
        }

        serialNum = BombInfo.GetSerialNumber();
        initRules = int.Parse(serialNum.Last().ToString());
        Debug.LogFormat(@"[Ten-Button Color Code #{0}] Starting rule number in stage 1 is: {1}", moduleId, initRules);
        ruleList = new checkRules[4] {
            (x => solColors[x] == solColors[x + 1]),
            (x => solColors[x] == solColors[x + 5]),
            (x => solColors[x] == solColors[x + 1] && solColors[x + 1] == solColors[x + 2]),
            (x => solColors[x] == solColors[x + 1] && solColors[x + 1] == solColors[x + 5] && solColors[x + 5] == solColors[x + 6])
        };

        SetRules();
    }