Esempio n. 1
0
        public void Render(BattleSystem battleSystem, int enemyIndex)
        {
            enemyNameText.text = battleSystem.Monsters[enemyIndex].MonsterName;
            hpScrollbar.size   = battleSystem.MonsterBattleFactors[enemyIndex].healthPoint / (float)battleSystem.MonsterBattleFactors[enemyIndex].maxHealthPoint;
            spScrollbar.size   = battleSystem.MonsterBattleFactors[enemyIndex].skillPoint / (float)battleSystem.MonsterBattleFactors[enemyIndex].maxSkillPoint;

            foreach (Transform child in statusContent)
            {
                Destroy(child.gameObject);
            }
            statusContent.sizeDelta = new Vector2(statusContent.sizeDelta.x, 60 * battleSystem.PlayerSkillEffectStatuses.Count);
            foreach (var status in battleSystem.MonstersSkillEffectStatuses[enemyIndex])
            {
                StatusBlock statusBlock = Instantiate(statusBlockPrefab);
                statusBlock.transform.SetParent(statusContent);
                statusBlock.Initial(status);
            }
        }
Esempio n. 2
0
        public void Render(BattleSystem battleSystem)
        {
            playerNameText.text = battleSystem.Player.Name;
            hpScrollbar.size    = battleSystem.Player.AbilityFactors.HP / (float)battleSystem.Player.AbilityFactors.MaxHP;
            spScrollbar.size    = battleSystem.Player.AbilityFactors.SP / (float)battleSystem.Player.AbilityFactors.MaxSP;

            foreach (Transform child in statusContent)
            {
                Destroy(child.gameObject);
            }
            statusContent.sizeDelta = new Vector2(statusContent.sizeDelta.x, 60 * battleSystem.PlayerSkillEffectStatuses.Count);
            foreach (var status in battleSystem.PlayerSkillEffectStatuses)
            {
                StatusBlock statusBlock = Instantiate(statusBlockPrefab);
                statusBlock.transform.SetParent(statusContent);
                statusBlock.Initial(status);
            }
        }