コード例 #1
0
    void addRule()
    {
        int    inputOrOutput = getInputOrOutput();
        int    acceptOrDrop  = getAcceptOrDrop();
        string factionIP     = getFactionIP();

        DataTypes.ProtoPort    protoPort    = getPort();
        DataTypes.FirewallRule firewallRule = new DataTypes.FirewallRule(inputOrOutput, acceptOrDrop, factionIP, protoPort);
        rulesList.Add(firewallRule);
        rulesTextBox.text += firewallRule.ToString() + "\n";
    }
コード例 #2
0
    void addRule()
    {
        if (rulesIndex == 4)
        {
            Debug.Log("This is the max amount of rules needed for this level. HINT: You only need to add one rule.");
            return;
        }
        rulesIndex++;

        int inputOrOutput = getInputOrOutput();
        int acceptOrDrop  = getAcceptOrDrop();

        DataTypes.ProtoPort    protoPort    = getPort();
        DataTypes.FirewallRule firewallRule = new DataTypes.FirewallRule(DataTypes.INPUT, acceptOrDrop, "Amazon (72.21.215.90)", protoPort);
        rulesList.Add(firewallRule);
        RectTransform parent = rulesListView.GetComponent <RectTransform>();

        GameObject      g = new GameObject(firewallRule.getFactionIP() + " | " + (int)firewallRule.getProtoPort() + " | " + firewallRule.getADAsString());
        TextMeshProUGUI t = g.AddComponent <TextMeshProUGUI>();

        t.transform.SetParent(parent);
        t.font = textMeshFont;

        RectTransform rect = t.GetComponent <RectTransform>();

        Debug.Log(rect.sizeDelta);
        t.fontSize     = 35;
        rect.sizeDelta = new Vector2(30, 25);
        t.alignment    = TMPro.TextAlignmentOptions.Midline;
        t.color        = new Color(163.0f / 255.0f, 15.0f / 255.0f, 45.0f / 255.0f);

        g.AddComponent <RulesMouseEnter>();



        Debug.Log(rulesIndex);
        t.text = rulesIndex + "";
    }