コード例 #1
0
    void Start()
    {
        words = new string[100] {
            "child", "style", "shake", "alive", "axion", "wreck", "cause", "pupil", "cheat", "watch",
            "jelly", "clock", "quark", "grass", "laser", "jeans", "yacht", "rumor", "fault", "hover",
            "sheet", "aware", "shell", "jolly", "giant", "vague", "image", "acute", "arena", "visit",
            "table", "force", "chair", "quick", "suite", "large", "chord", "power", "aloof", "attic",
            "cover", "prize", "trail", "cycle", "sight", "zeros", "glare", "angle", "ranch", "upset",
            "mixer", "drive", "xenon", "water", "venom", "right", "sweet", "gloom", "clash", "abbey",
            "level", "quilt", "climb", "tease", "knock", "fairy", "queen", "zebra", "guide", "south",
            "funny", "proud", "young", "jumpy", "staff", "query", "trunk", "zooms", "smart", "ghost",
            "judge", "yield", "brain", "helix", "small", "noise", "seize", "robot", "stain", "where",
            "world", "shark", "beard", "disco", "yummy", "title", "story", "color", "short", "fresh"
        };

        letterTaps = new string[25] {
            "A", "B", "C", "D", "E",
            "F", "G", "H", "I", "J",
            "L", "M", "N", "O", "P",
            "Q", "R", "S", "T", "U",
            "V", "W", "X", "Y", "Z"
        };

        submission       = new int[10];
        paused           = true;
        submissionString = "";
        serialNum        = KMBombInfoExtensions.GetSerialNumber(bombInfo);

        module.OnActivate      += Activate;
        button.OnInteract      += delegate { ButtonPressed(); return(false); };
        button.OnInteractEnded += ButtonReleased;
    }
コード例 #2
0
    //-----------------------------
    // Failed attempt at making a unique puzzle generator. Anyone reading this can try making a unique puzzle generator and I will implement it. Until then, I will have pre-made puzzles.
    //-----------------------------

    void Start()
    {
        serialNumber       = KMBombInfoExtensions.GetSerialNumber(info);
        module.OnActivate += ActivateModule;

        // First # is button number, Second # is label of button. Label '10' is a blank square.
        puzzleList = new string[, ]
        {
            { "3 2", "11 2", "14 1", "15 0", "21 1" },
            { "1 2", "9 2", "12 4", "15 2", "24 1" },
            { "1 2", "4 1", "20 1", "24 2", "x" },
            { "1 2", "4 2", "23 2", "24 0", "x" },
            { "10 3", "19 1", "22 10", "23 1", "x" },
            { "0 2", "3 2", "14 2", "20 10", "22 1" },
            { "0 2", "12 2", "14 10", "22 10", "x" },
            { "0 2", "4 0", "20 0", "24 2", "x" },
            { "2 3", "14 3", "20 2", "x", "x" },
            { "4 2", "10 10", "12 3", "24 10", "x" },
            { "0 10", "2 0", "7 1", "12 3", "20 1" },
        };

        //The space after each index is nessisary.
        //{" ", " ", " ", " "},
        puzzleSolutions = new string[, ]
        {
            { "1 17 ", "2 8 18 ", "6 12 22 ", "13 23 " },
            { "2 5 13 16 ", "3 6 14 17 ", "7 10 18 21 ", "8 11 19 22 " },
            { "2 6 10 13 17 ", "3 14 ", "15 22 ", "8 12 16 19 23 " },
            { "2 6 10 ", "3 9 ", "15 21 ", "14 18 22 " },
            { "0 3 15 ", "1 4 7 13 16 ", "5 8 11 17 20 ", "9 18 21 " },
            { "1 5 18 ", "2 8 19 ", "10 16 23 ", "13 17 24 " },
            { "1 3 5 15 18 ", "2 4 16 19 ", "8 10 20 23 ", "7 9 11 21 24 " },
            { "1 5 ", "2 8 14 ", "10 16 22 ", "19 23 " },
            { "0 3 7 10 18 ", "1 4 11 17 19 ", "5 12 15 21 23 ", "6 9 13 22 24 " },
            { "0 2 15 17 ", "1 3 9 16 18 ", "5 7 13 20 22 ", "6 14 21 23 " },
            { "5 13 16 ", "6 14 17 ", "10 18 21 ", "11 19 22 " },
        };

        submitedSolution = new string[4];
        currentPuzzle    = new string[25] {
            "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""
        };

        submit.OnInteract += SubmitPressed();

        for (int i = 0; i < buttons.Length; i++)
        {
            buttons[i].OnInteract += ButtonPressed(i);
        }

        for (int i = 0; i < pieceButtons.Length; i++)
        {
            pieceButtons[i].OnInteract += PieceButtonPressed(i);
        }
    }
コード例 #3
0
    // Use this for initialization
    void Start()
    {
        _id       = idCounter++;
        speciesId = UnityEngine.Random.Range(0, CroppedMats.Length - 1);
        Debug.LogFormat("[Fursona #{0}] Selected species: {1}", _id, NAMES[speciesId]);
        CroppedRenderer.material   = CroppedMats[speciesId];
        HeadRenderer.material      = HeadMats[speciesId];
        EyesRenderer.material      = EyesMats[speciesId];
        FleshRenderer.material     = FleshMats[speciesId];
        PrimaryRenderer.material   = PrimaryMats[speciesId];
        SecondaryRenderer.material = SecondaryMats[speciesId];
        TertiaryRenderer.material  = TertiaryMats[speciesId];
        UpdateColors();
        PhysicalSlider[] Sliders = new PhysicalSlider[] { A1, A2, A3, B1, B2, B3, C1, C2, C3, D1, D2, D3, E1, E2, E3, F1, F2, F3 };
        foreach (PhysicalSlider Slider in Sliders)
        {
            Slider.OnUpdate += UpdateColors;
        }

        KMBombInfo info = GetComponent <KMBombInfo>();
        int        ui   = KMBombInfoExtensions.GetOffIndicators(info).Count();
        int        li   = KMBombInfoExtensions.GetOnIndicators(info).Count();
        int        b    = KMBombInfoExtensions.GetBatteryCount(info);
        int        bh   = KMBombInfoExtensions.GetBatteryHolderCount(info);
        int        p    = KMBombInfoExtensions.GetPortCount(info);
        int        ep   = KMBombInfoExtensions.GetPortPlates(info).Count(sa => sa.Length == 0);
        int        s3   = int.Parse(KMBombInfoExtensions.GetSerialNumber(info)[2].ToString());
        int        s6   = int.Parse(KMBombInfoExtensions.GetSerialNumber(info)[5].ToString());
        int        pp   = KMBombInfoExtensions.GetPortPlates(info).Count();
        int        sl   = KMBombInfoExtensions.GetSerialNumberLetters(info).Count();
        int        sn   = KMBombInfoExtensions.GetSerialNumberNumbers(info).Count();
        int        m    = info.GetModuleIDs().Count;

        int R = -1, G = -1, B = -1, C = -1, M = -1, Y = -1;

        switch (speciesId)
        {
        case 0:
            R = li;
            G = ui;
            B = b;
            C = bh;
            M = p;
            Y = ep;
            break;

        case 1:
            R = s3;
            G = s6;
            B = pp;
            C = sl;
            M = sn;
            Y = m;
            break;

        case 2:
            R = ep;
            G = m;
            B = p;
            C = sn;
            M = bh;
            Y = sl;
            break;

        case 3:
            R = sl;
            G = s3;
            B = bh;
            C = li;
            M = sn;
            Y = s6;
            break;

        case 4:
            R = p;
            G = ui;
            B = m;
            C = pp;
            M = ep;
            Y = b;
            break;

        case 5:
            R = s6;
            G = b;
            B = sn;
            C = ep;
            M = li;
            Y = pp;
            break;

        case 6:
            R = bh;
            G = m;
            B = s3;
            C = ui;
            M = sl;
            Y = p;
            break;

        case 7:
            R = pp;
            G = p;
            B = li;
            C = sl;
            M = ep;
            Y = ui;
            break;

        case 8:
            R = sn;
            G = s3;
            B = b;
            C = m;
            M = s6;
            Y = bh;
            break;

        case 9:
            R = ui;
            G = bh;
            B = ep;
            C = s6;
            M = sl;
            Y = m;
            break;

        case 10:
            R = li;
            G = b;
            B = p;
            C = s3;
            M = pp;
            Y = sn;
            break;

        default:
            break;
        }

        int maxId = 0;

        int[] vals = new int[] { R, G, B, C, M, Y };
        for (int i = 1; i < 6; i++)
        {
            if (vals[i] >= vals[maxId])
            {
                maxId = i;
            }
        }

        TargetEyeColor = maxId;
        Debug.LogFormat("[Fursona #{0}] Eye color: {1}; Head color: {2}", _id, COLORNAMES[maxId], COLORNAMES[(maxId + 3) % 6]);
    }