// --- public FlagInfo(ZoneControlFlag flag) { Flag = flag; transform = Flag.transform; UpdateDistance(); CoroutineActive = false; }
//------------------------------------------------------------------------------------------------------------------ SpawnZoneButton GetSpawnZoneButton(ZoneControlFlag inSpawnZone) { int num = m_SpawnButtons != null ? m_SpawnButtons.Length : 0; while (num-- > 0) { SpawnZoneButton btn = m_SpawnButtons[num]; if ((btn != null) && (btn.Zone == inSpawnZone)) { return(btn); } } return(null); }
//-------------------------------------------------------------------------------------------------------------- public SpawnZoneButton(GUIBase_Widget inRootWidget, ZoneControlFlag inZoneControl, int inZoneIndex, SetSpawnZoneIndex inDelegate) { m_Button = inRootWidget.transform.GetChildComponent <GUIBase_Button>("Button"); if (m_Button != null) { m_Button.RegisterTouchDelegate2(OnSelect); m_Zone = inZoneControl; m_ZoneIndex = inZoneIndex; m_SetSpawnIndex = inDelegate; m_Label = inRootWidget.transform.GetChildComponent <GUIBase_Label>("Label"); m_Sprite = inRootWidget.transform.GetChildComponent <GUIBase_Sprite>("Sprite_Selected"); if (m_Sprite != null) { m_Sprite.Widget.Show(false, true); } } }
void InitZoneButtons() { GameZoneZoneControl gz = null; if (Mission.Instance != null) { gz = Mission.Instance.GameZone as GameZoneZoneControl; } // initialize spawn zone buttons... List <ZoneControlFlag> spawnZones = (gz != null) ? gz.Zones : null; for (int i = 0; i < m_SpawnButtons.Length; i++) { int zoneIndex = i; string buttonName = "MapSpawn_" + (i + 1) + "_Button"; GUIBase_Button button = Parent.transform.GetChildComponent <GUIBase_Button>(buttonName); ZoneControlFlag zone = (spawnZones != null && i < spawnZones.Count && spawnZones[i] != null) ? spawnZones[i] : null; m_SpawnButtons[i] = new SpawnZoneButtonEx(button, buttonName, zoneIndex, zone, SetSpawnIndex); } UpdateZoneButtons(m_SelectedTeam, m_SpawnZoneIndex); }
// private string dbgName; public SpawnZoneButtonEx(GUIBase_Button inButton, string inZoneName, int inZoneIndex, ZoneControlFlag inZoneControl, SetSpawnZoneIndexDelegate inDelegate) { m_Button = inButton; m_Zone = inZoneControl; m_ZoneIndex = inZoneIndex; m_SetSpawnIndex = inDelegate; // dbgName = inZoneName; if (m_Button != null) { m_Button.RegisterTouchDelegate2(OnSelect); // Capa: temporary ?!? solution GUIBase_Label label = m_Button.transform.GetChildComponent <GUIBase_Label>("Spawn_Label"); if (label != null) { label.SetNewText(ButtonLabels[m_ZoneIndex]); } } }
// --- public FlagInfo(ZoneControlFlag flag) { Flag = flag; UpdateDistance(); }