public override int GetHashCode() { return(Part1.GetHashCode() ^ Part2.GetHashCode() ^ Part3.GetHashCode() ^ Part4.GetHashCode() ^ Part5.GetHashCode() ^ Part6.GetHashCode()); }
void Start() { var eventSystem = FindObjectOfType <EventSystem>(); eventSystem.pixelDragThreshold = (int)(Screen.width / 50f); Items = new Dictionary <string, UILayout>(); PartTitles = new [] { "Components", "TableView", "ListView", "GridView" }; TypeListView = new ListView { Name = "Type List View", UIRect = new UIRect(20, 0, 240, 720), Adapter = new TypeListAdapter(PartTitles), BackgroundColor = new Color(0, 0, 0, 0.75f), OnItemSelectedListener = (index) => { Debug.Log("Select : " + index); Group.Select(Items[PartTitles[index]]); } }; Group = new UIGroup <UILayout>((layout) => { layout.UIObject.SetActive(true); }, (layout) => { if (layout.UIObject.activeSelf) { layout.UIObject.SetActive(false); } }); // Components UILayout components = new Part1(); components.Name = "Components"; Items.Add(PartTitles[0], components); Group.Add(components); // TableView UILayout tableView = new Part2(); tableView.Name = "Table View"; Items.Add(PartTitles[1], tableView); Group.Add(tableView); // ListView ListView listView = new Part3(); listView.Name = "List View"; TextView textView = new TextView(listView); textView.UIFrame = new UIFrame(0, 0, 1000, 150); textView.TextComponent.alignment = TextAnchor.MiddleCenter; textView.FontSize = 30; textView.Text = "List View Header"; listView.HeaderView = textView; listView.Adapter = new Part3Adapter(); Items.Add(PartTitles[2], listView); Group.Add(listView); // GridView GridView gridView = new Part4(); gridView.Name = "Grid View"; gridView.ItemSize = new Vector2(150, 150); gridView.Adapter = new Part4Adapter(); Items.Add(PartTitles[3], gridView); Group.Add(gridView); }