예제 #1
0
    public void Awake()
    {
        // Debugging graphs
        var g = DebugView.CreateGraph(EXEC_TIME, "Avg Pathfinding Time", "Seconds Ago", "% of Second Executing", 2 * 60);

        if (g != null)
        {
            g.AutoScale = false;
            g.Scale     = 1f;

            InvokeRepeating("UpdateGraphs", 1f, 1f);
        }
        DebugView.CreateGraph(PENDING, "Pending Path Requests", "Seconds Ago", "Request Count", 2 * 60);

        ToReturn         = new Queue <UnityAction <PathfindingResult, List <PNode> > >();
        ToReturn_Paths   = new Queue <List <PNode> >();
        ToReturn_Results = new Queue <PathfindingResult>();

        // Create the new threads.
        Threads        = new Thread[ThreadCount];
        Watches        = new System.Diagnostics.Stopwatch[ThreadCount];
        Pathers        = new Pathfinding[ThreadCount];
        ExecutionTimes = new long[ThreadCount];

        run = true;
        for (int i = 0; i < ThreadCount; i++)
        {
            Watches[i] = new System.Diagnostics.Stopwatch();
            Pathers[i] = new Pathfinding();
            Threads[i] = new Thread(Run);
            Threads[i].Start(i);
        }

        Debug.Log("Started {0} pathfinding threads.".Form(ThreadCount));
    }
예제 #2
0
    public void Awake()
    {
        instance = this;

        if (GraphMemory)
        {
            DebugView.CreateGraph(MEMORY_USE, "Total Memory", "Seconds Ago", "Megabytes", 2 * 60);
            InvokeRepeating("AddGraphSample", 1f, 1f);
        }
    }
예제 #3
0
    public void Awake()
    {
        Instance = this;

        DebugView.CreateGraph(PROCESSED, "Jobs Processed", "Frame", "Job Count in Frame", 1000);
        var time = DebugView.CreateGraph(TIME, "Jobs Execution Time", "Frame", "Total Job Time in Frame", 1000);

        if (time != null)
        {
            time.MinAutoScale = 10;
        }
        DebugView.CreateGraph(PENDING, "Pending Jobs", "Frame", "Total Pending Jobs", 1000);
    }
예제 #4
0
    public void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
        }
        else
        {
            Destroy(this);
        }

        InvokeRepeating("DrainOne", 0f, DrainInterval);

        DebugView.CreateGraph(POOLED, "Pooled Objects", "Seconds Ago", "Object Count", 120);
        DebugView.CreateGraph(SPAWNED, "Pool Spawned Objects", "Frames Ago", "Spawn Count", 1000).MinAutoScale    = 20;
        DebugView.CreateGraph(BORROWED, "Pool Borrowed Objects", "Frames Ago", "Borrow Count", 1000).MinAutoScale = 20;
    }