Пример #1
0
 void Start()
 {
     PersonController = GameObject.Find("System");
     NamesList        = PersonController.GetComponent <PasswordList>();
     NamesList.PasswordListResource();
     Cooldown  = 5;
     MCooldown = 0.5f;
     MoveMod   = 25;
 }
Пример #2
0
    void DoMyWindow(int WindowID)
    {
        if (CloseButton.Contains(Event.current.mousePosition))
        {
            if (GUI.Button(new Rect(CloseButton), "X", com.Skin [GameControl.control.GUIID].customStyles [0]))
            {
                show = false;
            }
        }

        if (Matched == true)
        {
            execute = false;
            pl.PasswordWords.RemoveRange(0, pl.PasswordWords.Count);
            GUI.Label(new Rect(20, 20, 100, 24), "Matched Word");
            CurrentWord = GUI.TextField(new Rect(20, 40, 100, 24), CurrentWord);
        }

        if (execute == false)
        {
            if (!ExecuteButton.Contains(Event.current.mousePosition))
            {
                GUI.backgroundColor = com.colors[Customize.cust.ButtonColorInt];
                GUI.contentColor    = com.colors[Customize.cust.FontColorInt];
                GUI.Button(new Rect(ExecuteButton), "Execute", com.Skin [GameControl.control.GUIID].customStyles [1]);
            }
            else
            {
                if (GUI.Button(new Rect(ExecuteButton), "Execute", com.Skin [GameControl.control.GUIID].customStyles [0]))
                {
                    Matched = false;
                    if (pl.PasswordWords.Count <= 0)
                    {
                        pl.PasswordListResource();
                        StartingCount = pl.PasswordWords.Count;
                        execute       = true;
                    }
                    else
                    {
                        StartingCount = pl.PasswordWords.Count;
                        execute       = true;
                    }
                }
            }
        }
        else
        {
            GUI.backgroundColor = com.colors[Customize.cust.ButtonColorInt];
            GUI.contentColor    = com.colors[Customize.cust.FontColorInt];

            percentage = CurrentCount / StartingCount * 100;
            float CountUpWords = CurrentCount - StartingCount;
            //GUI.Label (new Rect (10, 20, 100, 24),"" +  percentage.ToString("F2") + "%");
            //GUI.Label (new Rect (10, 20, 100, 24),"" +  CurrentCount + "/" + StartingCount);
            GUI.Label(new Rect(-4, 20, 100, 24), "" + CountUpWords + "/" + StartingCount);
            for (int i = 0; i < pl.PasswordWords.Count; i++)
            {
                CurrentCount = pl.PasswordWords.Count;
                GUI.Label(new Rect(2, 40 + 20 * i, 100, 24), pl.PasswordWords [i]);
                CurrentWord = pl.PasswordWords[0].Trim();
            }
        }

        if (!CloseButton.Contains(Event.current.mousePosition))
        {
            GUI.backgroundColor = com.colors[Customize.cust.ButtonColorInt];
            GUI.contentColor    = com.colors[Customize.cust.FontColorInt];
            if (GUI.Button(new Rect(CloseButton), "X", com.Skin [GameControl.control.GUIID].customStyles [1]))
            {
                show = false;
            }
        }

        GUI.DragWindow(new Rect(1, 1, 124, 21));
        GUI.Box(new Rect(1, 1, 124, 21), "Dictionary Cracker");
    }