Ejemplo n.º 1
0
    public void OnAddFormationClick()
    {
        Formation newFormation = new Formation();

        // newFormation.CallSign = callSignDropDown.options[callSignDropDown.value].text;
        newFormation.formationName = formationName.text;
        newFormation.Color         = colorDropDown.options[colorDropDown.value].text;
        newFormation.Short         = shortFormation.text;
        currentFormation           = newFormation;

        if (SideAToggle.isOn)
        {
            sideA.Add(currentFormation);
            tabControlA.AddTab(currentFormation.formationName); //Replaced by formation name
            currentTab = tabControlA.tabs[tabControlA.tabs.Count - 1];
        }

        if (SideBToggle.isOn)
        {
            sideB.Add(currentFormation);
            tabControlB.AddTab(currentFormation.formationName); //Replaced by formation name
            currentTab = tabControlB.tabs[tabControlB.tabs.Count - 1];
        }
        // GameObject headings = Instantiate(headingPrefab, currentTab.tabContent.GetChild(0).GetChild(0).GetChild(0));
        ActivatePilotButton();
    }
Ejemplo n.º 2
0
    private void PopulateFormationInformation(List <List <Formation> > mSidesFormation)
    {
        string[] side = { "SideA", "SideB" };
        int      i    = 0;

        foreach (List <Formation> formations in mSidesFormation)
        {
            Debug.Log(side[i]);
            foreach (Formation formationInSide in formations)
            {
                if (side[i].Equals("SideA"))
                {
                    //tabControlA.AddTab(formationInSide.CallSign);
                    currentTab = tabControlA.tabs[tabControlA.tabs.Count - 1];
                }
                else
                {
                    // tabControlB.AddTab(formationInSide.CallSign);
                    currentTab = tabControlB.tabs[tabControlB.tabs.Count - 1];
                }

                Debug.Log(formationInSide.CallSign);
                foreach (Aircraft air in formationInSide.airCrafts)
                {
                    // Debug.Log(air.TailID);
                    SpawnAircraftRow(air.ACType, air.PilotName, air.TailID, air.StartTime, air.EndTime, air.CallSign, air.ShortN);
                    aircraftAdded = true;
                }
                ActivatePilotButton();
            }
            i = (i + 1) % 2;
        }
        Debug.Log("End Display");
    }
Ejemplo n.º 3
0
    public void ChangeCurrentFormation()
    {
        string name       = EventSystem.current.currentSelectedGameObject.transform.GetChild(0).GetComponent <Text>().text;
        string parentName = GetSuperParentName(EventSystem.current.currentSelectedGameObject.transform);

        if (parentName.Contains("ControlA"))
        {
            TabControl.TabData tabDataA = tabControlA.FindTab(name);
            if (tabDataA != null)
            {
                string formationCallsign = tabDataA.tabTitle;
                foreach (Formation formation in sideA)
                {
                    if (formation.CallSign.Equals(formationCallsign))
                    {
                        currentFormation = formation;
                    }
                }
            }
        }
        else if (parentName.Contains("ControlB"))
        {
            TabControl.TabData tabDataB = tabControlB.FindTab(name);
            if (tabControlB != null)
            {
                string formationCallsign = tabDataB.tabTitle;
                foreach (Formation formation in sideB)
                {
                    if (formation.CallSign.Equals(formationCallsign))
                    {
                        currentFormation = formation;
                    }
                }
            }
        }
    }