protected internal override void Draw()
        {
            var pos = new Vector2(Event.current.mousePosition.x, Event.current.mousePosition.y);

            if (!cursorLimits.Contains(pos) || (guiOwner != null && guiOwner.IsActive == false))
            {
                Disable();
                return;
            }

            UnityEngine.GUI.Box(boxPosition, string.Empty, boxStyle);
            scroll = UnityEngine.GUI.BeginScrollView(boxPosition, scroll, viewRect, GUIStyle.none, GUIStyle.none);
            rect.Reset();
            bool wasPressed = false;

            for (int i = 0; i < selections.Length; i++)
            {
                if (UnityEngine.GUI.Button(rect, selections[i], i == refSet.Value ? activeButtonStyle : Style.Button))
                {
                    refSet.Value = i;
                    wasPressed   = true;
                }
                rect.MoveY();
            }
            GUI.EndScrollView();

            if (wasPressed)
            {
                Disable();
                return;
            }
        }
Ejemplo n.º 2
0
        protected override void DrawMainPart()
        {
            rect.Reset();
            GUI.Label(rect, $"Time: {stats.TimeStamp.ToString("F4")}, last kill at {stats.LastKillTime.ToString("F3")}", true);
            GUI.Label(rect, $"Name: {stats.Name}", true);
            GUI.Label(rect, $"Statistics", true);
            GUI.Label(rect, $"Kills: {stats.Kills}. Time for 1 kill: {stats.KillTimeAverage.ToString("F3")}", true);
            GUI.Label(rect, $"Total damage: {stats.TotalDamage}. Average total: {stats.TotalPerKill.ToString("F3")}", true);
            GUI.Label(rect, $"Max danmage: {stats.MaxDamage}", true);

            GUI.Label(rect, $"Misc statistics", true);
            GUI.Label(rect, $"Physics update: {UnityEngine.Mathf.RoundToInt(1f / stats.FixedDeltaTime)}/sec. ({stats.FixedDeltaTime.ToString("F4")} ms)", true);
            GUI.Label(rect, $"Refills. Refills count: {stats.GasRefillsCount}. Last refill at: {stats.LastRefill.ToString("F3")}", true);
            GUI.Label(rect, $"Reloads. Reloads count: {stats.Reloads}. Last reload at: {stats.LastReload.ToString("F3")}", true);
            GUI.Label(rect, $"Hero stats. Name: {stats.Stats.name}", true);
            GUI.Label(rect, $"Spd: {stats.Stats.Spd}, Bla: {stats.Stats.Bla}, Acl {stats.Stats.Acl}, Gas: {stats.Stats.Acl}, Skill: {stats.Stats.skillID}", true);
            GUI.Label(rect, $"Anarchy version: {stats.Version}");
        }