Inheritance: SidePanel
Example #1
0
 private void Awake()
 {
     mainCamera        = Camera.main;
     attackPanelObject = GameObject.FindGameObjectWithTag("AttackPanel");
     attackPanelObject.SetActive(false);
     _attackPannel = attackPanelObject.GetComponent <AttackPanel>();
 }
Example #2
0
    // Method to show attack panel and display description, money and exp rewards in labels
    public void ShowAttackPanel(string country, string description, int moneyReward, int expReward)
    {
        attackPanel.SetActive(true);
        AttackPanel gui = attackPanel.GetComponent <AttackPanel>();

        gui.descriptionText.text = description;
        gui.moneyRewardText.text = "+ £" + moneyReward.ToString();
        gui.expRewardText.text   = "+ " + expReward.ToString();
        GameObject.Find("CountryText").GetComponent <Text>().text = country;
        if (country == "Mehica")
        {
            GameObject.Find("CityText").GetComponent <Text>().text = "City: Chichen Itza   Bonuses: Att+10%, Def+40%";
        }
        else if (country == "Tamoachan")
        {
            GameObject.Find("CityText").GetComponent <Text>().text = "City: Akakor   Bonuses: Att+40%, Def+10%";
        }
        else if (country == "Atlantis")
        {
            GameObject.Find("CityText").GetComponent <Text>().text = "City: Antilla   Bonuses: Att+25%, Def+25%";
        }
        else if (country == "Hesperia")
        {
            GameObject.Find("CityText").GetComponent <Text>().text = "City: Cadiz   Bonuses: Att+10%, Reinforcements x3";
        }
        else if (country == "Alba")
        {
            GameObject.Find("CityText").GetComponent <Text>().text = "City: Camelot   Bonuses: Def+25%, Reinforcements x2";
        }
        else if (country == "Levant")
        {
            GameObject.Find("CityText").GetComponent <Text>().text = "City: Giza   Bonuses: Reinforcements x5";
        }
        else if (country == "Sumeria")
        {
            GameObject.Find("CityText").GetComponent <Text>().text = "City: Babylon   Bonuses: Att+10%, Def+10%, Reinforcements x2";
        }
        else if (country == "Orenia")
        {
            GameObject.Find("CityText").GetComponent <Text>().text = "City: Gobekli Tepe   Bonuses: Def+50%";
        }
        else if (country == "Orientos")
        {
            GameObject.Find("CityText").GetComponent <Text>().text = "City: Dropa   Bonuses: Def+10%, Reinforcements x3";
        }
        else if (country == "East Mu")
        {
            GameObject.Find("CityText").GetComponent <Text>().text = "City: Madjedbebe   Bonuses: Att+50%";
        }
        else
        {
            GameObject.Find("CityText").GetComponent <Text>().text = "City: None";
        }
    }
Example #3
0
 // Use this for initialization
 void Awake()
 {
     Instance        = this;
     m_SlotNumber    = -1;
     MyRectTransform = transform.GetComponent <RectTransform> ();
     SlotsPanel      = transform.Find("SlotSelection").gameObject;
     m_ArmorText     = transform.Find("Report/Armor").GetComponent <Text> ();
     m_ShieldText    = transform.Find("Report/Shield").GetComponent <Text> ();
     m_DamageText    = transform.Find("Report/Damage").GetComponent <Text> ();
     m_DefenceText   = transform.Find("Report/Defence").GetComponent <Text> ();
     m_AccuracyText  = transform.Find("Report/Accuracy").GetComponent <Text> ();
 }
Example #4
0
        public void SwitchToActionMode(AttackPanel panel)
        {
            TacticalController.Deactivate();
            ActionController.Activate();
            ActionInput.Activate();

            ActionController.Initialize(
                panel.UpdateTimeUnits,
                panel.UpdateAmmo,
                panel.UpdateAimAction,
                panel.UpdateReload,
                panel.UpdateFireAction);
        }
    void AssembleGamePanelsAndScripts()
    {
        GameObject mainCanvas = GameObject.Find("UITextCanvas");

        _gamePanels = new List <GamePanel>();
        foreach (MonoBehaviour gamePanel in mainCanvas.GetComponentsInChildren <MonoBehaviour>(true))
        {
            if (gamePanel is GamePanel)
            {
                _gamePanels.Add((GamePanel)gamePanel);
            }
        }

        _attackPanel = mainCanvas.GetComponentInChildren <AttackPanel>(true);
        //_buffPanel = mainCanvas.GetComponentInChildren<OptionsPanel>(true);
    }
Example #6
0
    //Show the attack interface
    public void ShowAttackPanel(string description, int moneyReward, int expReward)
    {
        //Enable the Attack panel
        attackPanel.SetActive(true);
        //Disable the Menu
        DisableMenu();
        //Disable the battalion numbers
        DisableBattalions();
        //Disable Main GUI
        DisableGUI();
        //Disable Attack Phase Gui
        attackPhasePanel.SetActive(false);
        AttackPanel gui = attackPanel.GetComponent <AttackPanel>();

        gui.descriptionText.text = description;
        gui.moneyRewardText.text = "Money Reward: +" + moneyReward.ToString();
        gui.expRewardText.text   = "EXP Reward: +" + expReward.ToString();
        print("Attack Panel Active!");
    }