Commit d75012465bfd3380a6b96d52f7ccd362d8f9604a

Authored by Mateus Lustosa
1 parent f14f5412

Fix about button

Assets/Region.cs
@@ -1,21 +0,0 @@ @@ -1,21 +0,0 @@
1 -using UnityEngine;  
2 -using System.Collections;  
3 -  
4 -public class Region : MonoBehaviour {  
5 -  
6 - public GameObject checkmark;  
7 - private bool active = false;  
8 - private string path = "";  
9 -  
10 - public string Path  
11 - {  
12 - get { return this.path; }  
13 - set { this.path = value; }  
14 - }  
15 -  
16 - public void select(bool selected)  
17 - {  
18 - checkmark.SetActive(selected);  
19 - }  
20 -  
21 -}  
Assets/Region.cs.meta
@@ -1,12 +0,0 @@ @@ -1,12 +0,0 @@
1 -fileFormatVersion: 2  
2 -guid: 473cc1c6d151a554589205d28b0701a7  
3 -timeCreated: 1475266564  
4 -licenseType: Free  
5 -MonoImporter:  
6 - serializedVersion: 2  
7 - defaultReferences: []  
8 - executionOrder: 0  
9 - icon: {instanceID: 0}  
10 - userData:  
11 - assetBundleName:  
12 - assetBundleVariant:  
Assets/RegionSelector.cs
@@ -1,149 +0,0 @@ @@ -1,149 +0,0 @@
1 -using UnityEngine;  
2 -using System.Collections;  
3 -using System.Collections.Generic;  
4 -using UnityEngine.UI;  
5 -using UnityEngine.EventSystems;  
6 -  
7 -public class RegionSelector : MonoBehaviour {  
8 -  
9 - private readonly Dictionary<string, string> regions = new Dictionary<string, string> {  
10 -  
11 - { "Padrão Nacional", "" },  
12 - { "Acre", "/AC" },  
13 - { "Alagoas", "/AL" },  
14 - { "Amapá", "/AP" },  
15 - { "Amazonas", "/AM" },  
16 - { "Bahia", "/BA" },  
17 - { "Ceará", "/CE" },  
18 - { "Distrito Federal", "/DF" },  
19 - { "Espírito Santo", "/ES" },  
20 - { "Goiás", "/GO" },  
21 - { "Maranhão", "/MA" },  
22 - { "Mato Grosso", "/MT" },  
23 - { "Mato Grosso do Sul", "/MS" },  
24 - { "Minas Gerais", "/MG" },  
25 - { "Pará", "/PA" },  
26 - { "Paraíba", "/PB" },  
27 - { "Paraná", "/PR"},  
28 - { "Pernambuco", "/PE" },  
29 - { "Piauí", "/PI" },  
30 - { "Rio de Janeiro", "/RJ" },  
31 - { "Rio Grande do Norte", "/RN" },  
32 - { "Rio Grande do Sul", "/RS" },  
33 - { "Rondônia", "/RO" },  
34 - { "Roraima", "/RR" },  
35 - { "Santa Catarina", "/SC" },  
36 - { "São Paulo", "/SP" },  
37 - { "Sergipe", "/SE" },  
38 - { "Tocantins", "/TO" }  
39 -  
40 - };  
41 -  
42 - public PlayerManager manager;  
43 - public GameObject list;  
44 - public GameObject SampleItem;  
45 -  
46 - private Region activeItem = null;  
47 - private Region selectedItem = null;  
48 -  
49 - void Start ()  
50 - {  
51 - foreach (KeyValuePair<string, string> regionData in regions)  
52 - {  
53 - GameObject item = Instantiate(this.SampleItem) as GameObject;  
54 - item.GetComponentInChildren<Text>().text = regionData.Key;  
55 - item.transform.SetParent(this.list.transform);  
56 - item.GetComponent<Button>().onClick.AddListener(delegate {  
57 - selectItem(EventSystem.current.currentSelectedGameObject.GetComponent<Region>());  
58 - });  
59 -  
60 - Region region = item.GetComponent<Region>();  
61 - region.Path = regionData.Value;  
62 -  
63 - if (this.activeItem == null)  
64 - {  
65 - Debug.Log("Selecting " + item);  
66 - this.activeItem = region;  
67 - this.selectedItem = region;  
68 - region.select(true);  
69 - }  
70 - }  
71 - }  
72 -  
73 - private void selectItem(Region region)  
74 - {  
75 - this.selectedItem.select(false);  
76 - this.selectedItem = region;  
77 - this.selectedItem.select(true);  
78 - }  
79 -  
80 - public void ReselectActiveItem()  
81 - {  
82 - selectItem(this.activeItem);  
83 - }  
84 -  
85 - public void OnDone()  
86 - {  
87 - this.activeItem = this.selectedItem;  
88 - this.manager.setRegion(this.activeItem.Path);  
89 - }  
90 -  
91 -}  
92 -  
93 -/*  
94 -  
95 -void Start ()  
96 - {  
97 - this.group = this.gameObject.GetComponent<ToggleGroup>();  
98 -  
99 - foreach (KeyValuePair<string, string> region in regions)  
100 - {  
101 - GameObject item = Instantiate(this.sampleItem) as GameObject;  
102 - item.GetComponentInChildren<Text>().text = region.Key;  
103 -  
104 - Toggle toggle = item.GetComponentInChildren<Toggle>();  
105 - toggle.group = this.group;  
106 - toggles.Add(toggle);  
107 -  
108 - Debug.Log(region.Key + ": " + (region.Value.Length == 0) + " but " + toggle.isOn);  
109 -  
110 - if (region.Value.Length == 0)  
111 - this.selected = toggle;  
112 -  
113 - item.transform.SetParent(this.list.transform);  
114 - }  
115 -  
116 - foreach (Toggle toggle in this.toggles)  
117 - {  
118 - toggle.isOn = false;  
119 - }  
120 -  
121 - this.selected.isOn = true;  
122 - }  
123 -  
124 - void Update ()  
125 - {  
126 - int i = 0;  
127 - foreach (Toggle toggle in this.toggles)  
128 - {  
129 - Debug.Log("Toggle " + i++ + " : " + toggle.isOn);  
130 - toggle.isOn = false;  
131 - this.group.NotifyToggleOn(toggle);  
132 - }  
133 - }  
134 -  
135 - public void OnSelect()  
136 - {  
137 - if ( ! selected.isOn) {  
138 - foreach (Toggle toggle in group.ActiveToggles())  
139 - {  
140 - if (toggle.isOn)  
141 - {  
142 - this.selected = toggle;  
143 - this.manager.setRegion(this.regions[toggle.GetComponent<Text>().text]);  
144 - }  
145 - }  
146 - }  
147 - }  
148 -  
149 -*/  
Assets/RegionSelector.cs.meta
@@ -1,12 +0,0 @@ @@ -1,12 +0,0 @@
1 -fileFormatVersion: 2  
2 -guid: a6c642c03c1f758439485b2a6623738a  
3 -timeCreated: 1475168432  
4 -licenseType: Free  
5 -MonoImporter:  
6 - serializedVersion: 2  
7 - defaultReferences: []  
8 - executionOrder: 0  
9 - icon: {instanceID: 0}  
10 - userData:  
11 - assetBundleName:  
12 - assetBundleVariant:  
Assets/Scenes/Main.unity
@@ -11349,8 +11349,8 @@ MonoBehaviour: @@ -11349,8 +11349,8 @@ MonoBehaviour:
11349 m_StringArgument: 11349 m_StringArgument:
11350 m_BoolArgument: 0 11350 m_BoolArgument: 0
11351 m_CallState: 2 11351 m_CallState: 2
11352 - - m_Target: {fileID: 1031720610}  
11353 - m_MethodName: fade 11352 + - m_Target: {fileID: 263018771}
  11353 + m_MethodName: SetActive
11354 m_Mode: 6 11354 m_Mode: 6
11355 m_Arguments: 11355 m_Arguments:
11356 m_ObjectArgument: {fileID: 0} 11356 m_ObjectArgument: {fileID: 0}
@@ -11360,6 +11360,17 @@ MonoBehaviour: @@ -11360,6 +11360,17 @@ MonoBehaviour:
11360 m_StringArgument: 11360 m_StringArgument:
11361 m_BoolArgument: 1 11361 m_BoolArgument: 1
11362 m_CallState: 2 11362 m_CallState: 2
  11363 + - m_Target: {fileID: 1826236683}
  11364 + m_MethodName: set
  11365 + m_Mode: 6
  11366 + m_Arguments:
  11367 + m_ObjectArgument: {fileID: 0}
  11368 + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
  11369 + m_IntArgument: 0
  11370 + m_FloatArgument: 0
  11371 + m_StringArgument:
  11372 + m_BoolArgument: 0
  11373 + m_CallState: 2
11363 m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, 11374 m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
11364 Culture=neutral, PublicKeyToken=null 11375 Culture=neutral, PublicKeyToken=null
11365 --- !u!114 &1794530659 11376 --- !u!114 &1794530659
Assets/Scripts/Region.cs 0 → 100644
@@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
  1 +using UnityEngine;
  2 +using System.Collections;
  3 +
  4 +public class Region : MonoBehaviour {
  5 +
  6 + public GameObject checkmark;
  7 + private bool active = false;
  8 + private string path = "";
  9 +
  10 + public string Path
  11 + {
  12 + get { return this.path; }
  13 + set { this.path = value; }
  14 + }
  15 +
  16 + public void select(bool selected)
  17 + {
  18 + checkmark.SetActive(selected);
  19 + }
  20 +
  21 +}
Assets/Scripts/Region.cs.meta 0 → 100644
@@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
  1 +fileFormatVersion: 2
  2 +guid: 473cc1c6d151a554589205d28b0701a7
  3 +timeCreated: 1475266564
  4 +licenseType: Free
  5 +MonoImporter:
  6 + serializedVersion: 2
  7 + defaultReferences: []
  8 + executionOrder: 0
  9 + icon: {instanceID: 0}
  10 + userData:
  11 + assetBundleName:
  12 + assetBundleVariant:
Assets/Scripts/RegionSelector.cs 0 → 100644
@@ -0,0 +1,149 @@ @@ -0,0 +1,149 @@
  1 +using UnityEngine;
  2 +using System.Collections;
  3 +using System.Collections.Generic;
  4 +using UnityEngine.UI;
  5 +using UnityEngine.EventSystems;
  6 +
  7 +public class RegionSelector : MonoBehaviour {
  8 +
  9 + private readonly Dictionary<string, string> regions = new Dictionary<string, string> {
  10 +
  11 + { "Padrão Nacional", "" },
  12 + { "Acre", "/AC" },
  13 + { "Alagoas", "/AL" },
  14 + { "Amapá", "/AP" },
  15 + { "Amazonas", "/AM" },
  16 + { "Bahia", "/BA" },
  17 + { "Ceará", "/CE" },
  18 + { "Distrito Federal", "/DF" },
  19 + { "Espírito Santo", "/ES" },
  20 + { "Goiás", "/GO" },
  21 + { "Maranhão", "/MA" },
  22 + { "Mato Grosso", "/MT" },
  23 + { "Mato Grosso do Sul", "/MS" },
  24 + { "Minas Gerais", "/MG" },
  25 + { "Pará", "/PA" },
  26 + { "Paraíba", "/PB" },
  27 + { "Paraná", "/PR"},
  28 + { "Pernambuco", "/PE" },
  29 + { "Piauí", "/PI" },
  30 + { "Rio de Janeiro", "/RJ" },
  31 + { "Rio Grande do Norte", "/RN" },
  32 + { "Rio Grande do Sul", "/RS" },
  33 + { "Rondônia", "/RO" },
  34 + { "Roraima", "/RR" },
  35 + { "Santa Catarina", "/SC" },
  36 + { "São Paulo", "/SP" },
  37 + { "Sergipe", "/SE" },
  38 + { "Tocantins", "/TO" }
  39 +
  40 + };
  41 +
  42 + public PlayerManager manager;
  43 + public GameObject list;
  44 + public GameObject SampleItem;
  45 +
  46 + private Region activeItem = null;
  47 + private Region selectedItem = null;
  48 +
  49 + void Start ()
  50 + {
  51 + foreach (KeyValuePair<string, string> regionData in regions)
  52 + {
  53 + GameObject item = Instantiate(this.SampleItem) as GameObject;
  54 + item.GetComponentInChildren<Text>().text = regionData.Key;
  55 + item.transform.SetParent(this.list.transform);
  56 + item.GetComponent<Button>().onClick.AddListener(delegate {
  57 + selectItem(EventSystem.current.currentSelectedGameObject.GetComponent<Region>());
  58 + });
  59 +
  60 + Region region = item.GetComponent<Region>();
  61 + region.Path = regionData.Value;
  62 +
  63 + if (this.activeItem == null)
  64 + {
  65 + Debug.Log("Selecting " + item);
  66 + this.activeItem = region;
  67 + this.selectedItem = region;
  68 + region.select(true);
  69 + }
  70 + }
  71 + }
  72 +
  73 + private void selectItem(Region region)
  74 + {
  75 + this.selectedItem.select(false);
  76 + this.selectedItem = region;
  77 + this.selectedItem.select(true);
  78 + }
  79 +
  80 + public void ReselectActiveItem()
  81 + {
  82 + selectItem(this.activeItem);
  83 + }
  84 +
  85 + public void OnDone()
  86 + {
  87 + this.activeItem = this.selectedItem;
  88 + this.manager.setRegion(this.activeItem.Path);
  89 + }
  90 +
  91 +}
  92 +
  93 +/*
  94 +
  95 +void Start ()
  96 + {
  97 + this.group = this.gameObject.GetComponent<ToggleGroup>();
  98 +
  99 + foreach (KeyValuePair<string, string> region in regions)
  100 + {
  101 + GameObject item = Instantiate(this.sampleItem) as GameObject;
  102 + item.GetComponentInChildren<Text>().text = region.Key;
  103 +
  104 + Toggle toggle = item.GetComponentInChildren<Toggle>();
  105 + toggle.group = this.group;
  106 + toggles.Add(toggle);
  107 +
  108 + Debug.Log(region.Key + ": " + (region.Value.Length == 0) + " but " + toggle.isOn);
  109 +
  110 + if (region.Value.Length == 0)
  111 + this.selected = toggle;
  112 +
  113 + item.transform.SetParent(this.list.transform);
  114 + }
  115 +
  116 + foreach (Toggle toggle in this.toggles)
  117 + {
  118 + toggle.isOn = false;
  119 + }
  120 +
  121 + this.selected.isOn = true;
  122 + }
  123 +
  124 + void Update ()
  125 + {
  126 + int i = 0;
  127 + foreach (Toggle toggle in this.toggles)
  128 + {
  129 + Debug.Log("Toggle " + i++ + " : " + toggle.isOn);
  130 + toggle.isOn = false;
  131 + this.group.NotifyToggleOn(toggle);
  132 + }
  133 + }
  134 +
  135 + public void OnSelect()
  136 + {
  137 + if ( ! selected.isOn) {
  138 + foreach (Toggle toggle in group.ActiveToggles())
  139 + {
  140 + if (toggle.isOn)
  141 + {
  142 + this.selected = toggle;
  143 + this.manager.setRegion(this.regions[toggle.GetComponent<Text>().text]);
  144 + }
  145 + }
  146 + }
  147 + }
  148 +
  149 +*/
Assets/Scripts/RegionSelector.cs.meta 0 → 100644
@@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
  1 +fileFormatVersion: 2
  2 +guid: a6c642c03c1f758439485b2a6623738a
  3 +timeCreated: 1475168432
  4 +licenseType: Free
  5 +MonoImporter:
  6 + serializedVersion: 2
  7 + defaultReferences: []
  8 + executionOrder: 0
  9 + icon: {instanceID: 0}
  10 + userData:
  11 + assetBundleName:
  12 + assetBundleVariant:
ProjectSettings/GraphicsSettings.asset
@@ -39,20 +39,20 @@ GraphicsSettings: @@ -39,20 +39,20 @@ GraphicsSettings:
39 m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 39 m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
40 type: 0} 40 type: 0}
41 m_ShaderSettings_Tier1: 41 m_ShaderSettings_Tier1:
42 - useCascadedShadowMaps: 1  
43 - standardShaderQuality: 2  
44 - useReflectionProbeBoxProjection: 1  
45 - useReflectionProbeBlending: 1 42 + useCascadedShadowMaps: 0
  43 + standardShaderQuality: 0
  44 + useReflectionProbeBoxProjection: 0
  45 + useReflectionProbeBlending: 0
46 m_ShaderSettings_Tier2: 46 m_ShaderSettings_Tier2:
47 - useCascadedShadowMaps: 1  
48 - standardShaderQuality: 2  
49 - useReflectionProbeBoxProjection: 1  
50 - useReflectionProbeBlending: 1 47 + useCascadedShadowMaps: 0
  48 + standardShaderQuality: 1
  49 + useReflectionProbeBoxProjection: 0
  50 + useReflectionProbeBlending: 0
51 m_ShaderSettings_Tier3: 51 m_ShaderSettings_Tier3:
52 - useCascadedShadowMaps: 1  
53 - standardShaderQuality: 2  
54 - useReflectionProbeBoxProjection: 1  
55 - useReflectionProbeBlending: 1 52 + useCascadedShadowMaps: 0
  53 + standardShaderQuality: 1
  54 + useReflectionProbeBoxProjection: 0
  55 + useReflectionProbeBlending: 0
56 m_BuildTargetShaderSettings: [] 56 m_BuildTargetShaderSettings: []
57 m_LightmapStripping: 0 57 m_LightmapStripping: 0
58 m_FogStripping: 0 58 m_FogStripping: 0