少年修仙传客户端基础资源
leonard Wu
2018-08-08 a1fd98c6ae0854327472b369f2bc63fc3ad1d897
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MemoryProfilerWindow;
using Treemap;
using UnityEditor;
using UnityEditor.Graphs;
using UnityEngine;
 
namespace Assets.Editor.Treemap
{
    public class Item : IComparable<Item>, ITreemapRenderable
    {
        public Group _group;
        public Rect _position;
        public int _index;
 
        public ThingInMemory _thingInMemory;
 
        public long memorySize { get { return _thingInMemory.size; } }
        public string name { get { return _thingInMemory.caption; } }
        public Color color { get { return _group.color; } }
 
        public Item(ThingInMemory thingInMemory, Group group)
        {
            _thingInMemory = thingInMemory;
            _group = group;
        }
 
        public int CompareTo(Item other)
        {
            return (int)(_group != other._group ? other._group.totalMemorySize - _group.totalMemorySize : other.memorySize - memorySize);
        }
 
        public Color GetColor()
        {
            return _group.color;
        }
 
        public Rect GetPosition()
        {
            return _position;
        }
 
        public string GetLabel()
        {
            string row1 = _group._name;
            string row2 = EditorUtility.FormatBytes(memorySize);
            return row1 + "\n" + row2;
        }
    }
}