Exemplo n.º 1
0
 // -----------------------------------------------------------------------------------
 // Show
 // -----------------------------------------------------------------------------------
 public override void Show()
 {
     titleText.text = DescriptionLibrary.GetName("Hdl_GameOver");
     restartButton.GetComponentInChildren <Text>().text = DescriptionLibrary.GetName("Btn_Restart");
     deathEffect.gameObject.SetActive(Obj.GetPlayer.statistics.Health <= 0);
     base.Show();
 }
Exemplo n.º 2
0
        // -----------------------------------------------------------------------------------
        // Update
        // -----------------------------------------------------------------------------------
        void Update()
        {
            if (template != null)
            {
                float valueNow = -1;
                float valueMod = -1;

                if (index != -1)
                {
                    string stat_name = DescriptionLibrary.GetName(template.description.name);
                    valueNow = player.resistances.resistances[index].Value;
                    valueMod = player.resistances.resistances[index].BonusValue;


                    text.text = stat_name;

                    value.text = valueNow.ToString();

                    if (valueMod > 0)
                    {
                        value.text += " + " + valueMod.ToString();
                    }
                }
                else
                {
                    Debug.LogWarning("Requested Resistance was not found in: " + this.name);
                }
            }
            else
            {
                Debug.LogWarning("You forgot to assign inspector properties to: " + this.name);
            }
        }
Exemplo n.º 3
0
 // -----------------------------------------------------------------------------------
 // Init
 // -----------------------------------------------------------------------------------
 public override void Show()
 {
     newButton.GetComponentInChildren <Text>().text     = DescriptionLibrary.GetName("Btn_NewGame");
     loadButton.GetComponentInChildren <Text>().text    = DescriptionLibrary.GetName("Btn_LoadGame");
     optionsButton.GetComponentInChildren <Text>().text = DescriptionLibrary.GetName("Btn_GameOptions");
     quitButton.GetComponentInChildren <Text>().text    = DescriptionLibrary.GetName("Btn_QuitGame");
     base.Show();
 }
Exemplo n.º 4
0
        // -------------------------------------------------------------------------------
        // Show
        // -------------------------------------------------------------------------------
        public override void Show()
        {
            pauseHeadline.text = DescriptionLibrary.GetName("Hdl_Pause");

            continueButton.GetComponentInChildren <Text>().text = DescriptionLibrary.GetName("Btn_Continue");
            optionsButton.GetComponentInChildren <Text>().text  = DescriptionLibrary.GetName("Btn_GameOptions");
            exitButton.GetComponentInChildren <Text>().text     = DescriptionLibrary.GetName("Btn_QuitGame");
            base.Show();
        }
Exemplo n.º 5
0
        // -----------------------------------------------------------------------------------
        // Show
        // -----------------------------------------------------------------------------------
        public override void Show()
        {
            optionsHeadline.text     = DescriptionLibrary.GetName("Hdl_Options");
            musicVolumeHeadline.text = DescriptionLibrary.GetName("Hdl_MusicVolume");
            soundVolumeHeadline.text = DescriptionLibrary.GetName("Hdl_SoundVolume");

            continueButton.GetComponentInChildren <Text>().text = DescriptionLibrary.GetName("Btn_Confirm");

            languageDropdown.options = LanguageLibrary.GetAllTemplates().Select(
                p => new Dropdown.OptionData(p.name)
                ).ToList();

            base.Show();
        }
Exemplo n.º 6
0
        // -----------------------------------------------------------------------------------
        // Update
        // -----------------------------------------------------------------------------------
        void Update()
        {
            if (IsShown == false)
            {
                return;
            }

            if (template != null)
            {
                text.text = DescriptionLibrary.GetName(template.name);
            }
            else
            {
                Debug.LogWarning("You forgot to assign inspector properties to: " + this.name);
            }
        }
Exemplo n.º 7
0
        // -----------------------------------------------------------------------------------
        // Show
        // -----------------------------------------------------------------------------------
        public override void Show()
        {
            headlineText.text = DescriptionLibrary.GetName("Hdl_SelectClass");
            startButton.GetComponentInChildren <Text>().text  = DescriptionLibrary.GetName("Btn_StartGame");
            cancelButton.GetComponentInChildren <Text>().text = DescriptionLibrary.GetName("Btn_Cancel");

            // fhiz: todo:
            // can't replace (name) with description.getName as it screws assigning the class
            // to the player later on

            classDropdown.options = CharacterClassLibrary.GetAllTemplates().Select(
                p => new Dropdown.OptionData(p.name)
                ).ToList();

            base.Show();
        }
Exemplo n.º 8
0
        // -----------------------------------------------------------------------------------
        // Update
        // -----------------------------------------------------------------------------------
        void Update()
        {
            if (template != null)
            {
                if (IsShown == false)
                {
                    return;
                }

                if (index != -1)
                {
                    if (autoHide && !player.statistics.statistics[index].isActive)
                    {
                        childGameObject.SetActive(false);
                    }
                    else if (autoHide && player.statistics.statistics[index].isActive)
                    {
                        childGameObject.SetActive(true);
                    }

                    string stat_name    = DescriptionLibrary.GetName(template.description.name);
                    float  valueNow     = player.statistics.statistics[index].Value;
                    float  valueMax     = player.statistics.statistics[index].MaxValue;
                    float  valuePercent = player.statistics.statistics[index].PercentValue;

                    slider.value = valuePercent;

                    if (showMax)
                    {
                        text.text = stat_name + ": " + valueNow + "/" + valueMax;
                    }
                    else
                    {
                        text.text = stat_name + ": " + valueNow;
                    }
                }
                else
                {
                    Debug.LogWarning("Requested Statistic was not found in: " + this.name);
                }
            }
            else
            {
                Debug.LogWarning("You forgot to assign inspector properties to: " + this.name);
            }
        }
Exemplo n.º 9
0
        // -----------------------------------------------------------------------------------
        // Update
        // -----------------------------------------------------------------------------------
        void Update()
        {
            if (template != null)
            {
                float valueNow     = -1;
                float valueMod     = -1;
                float valueMax     = -1;
                float valuePercent = 0;

                if (button != null)
                {
                    button.interactable = false;
                }

                if (index_stat != -1)
                {
                    string stat_name = DescriptionLibrary.GetName(template.description.name);
                    valueNow     = player.attributes.attributes[index_stat].Value;
                    valueMod     = player.attributes.attributes[index_stat].BonusValue;
                    valueMax     = player.attributes.attributes[index_stat].MaxValue;
                    valuePercent = player.attributes.attributes[index_stat].PercentValue;

                    if (button != null)
                    {
                        button.interactable = player.statistics.statistics[index_increase].Value > 0 && valueNow < player.attributes.attributes[index_stat].MaxValue;
                    }

                    if (text != null && value == null)
                    {
                        text.text = stat_name + ": " + valueNow.ToString();
                        if (showMod && valueMod > 0)
                        {
                            text.text += " + " + valueMod.ToString();
                        }
                    }
                    else
                    {
                        text.text = stat_name;
                    }

                    if (slider != null)
                    {
                        slider.value = valuePercent;
                    }

                    if (value != null)
                    {
                        value.text = valueNow.ToString();

                        if (showMod && valueMod > 0)
                        {
                            value.text += " + " + valueMod.ToString();
                        }
                    }
                }
                else
                {
                    Debug.LogWarning("Requested Attribute was not found in: " + this.name);
                }
            }
            else
            {
                Debug.LogWarning("You forgot to assign inspector properties to: " + this.name);
            }
        }