Example #1
0
    public override void Start(BasePerformanceComponentUI componentUI)
    {
        component = (TextPerformanceComponentUI)componentUI;
        component.text.fontSize = 20;

        fpsNextPeriod = Time.realtimeSinceStartup + FPSMeasurePeriod;
    }
 public override void Start(BasePerformanceComponentUI componentUI)
 {
     Profiler.enabled                    = true;
     component                           = (TextPerformanceComponentUI)componentUI;
     component.text.fontSize             = 11;
     component.text.resizeTextForBestFit = true;
 }
    public override void Start(BasePerformanceComponentUI componentUI)
    {
        component = (TextPerformanceComponentUI)componentUI;

        fpsFinishPeriod = Time.realtimeSinceStartup + FPSMeasurePeriod;

        component.ChangeText("Avg: ...");
    }
Example #4
0
    /// <summary>
    /// Clean and Re-Draw
    /// Can be static cause it shouldn't matter.
    /// </summary>
    public static void DirtyUI()
    {
        // Guard
        if (rootObject == null)
        {
            return;
        }

        // Could be improved but its fine
        rootObject.transform.parent.gameObject.SetActive(true);

        // Clear
        foreach (Transform child in rootObject.transform)
        {
            Destroy(child.gameObject);
        }

        // Draw
        // Get new Performance Mode/Group
        currentGroup = PerformanceComponentGroups.groups[CommandSettings.PerformanceHUDMode];

        // Order by ascending using Linq
        if (currentGroup.disableUI == true)
        {
            currentGroup.groupElements = currentGroup.groupElements.OrderBy(c => c.PriorityID()).ToArray();
        }

        // Draw and Begin UI Functionality
        foreach (BasePerformanceComponent element in currentGroup.groupElements)
        {
            BasePerformanceComponentUI go = ((GameObject)Instantiate(Resources.Load(element.NameOfComponent()))).GetComponent <BasePerformanceComponentUI>();
            go.gameObject.transform.SetParent(rootObject.transform);

            element.Start(go);
        }
    }
 /// <summary>
 /// Start Action.
 /// </summary>
 public abstract void Start(BasePerformanceComponentUI componentUI);
 public override void Start(BasePerformanceComponentUI componentUI)
 {
     component = (TextPerformanceComponentUI)componentUI;
 }