public void Init(CharacterData d, bool monster) { config = CharacterConfigManager.instance.Get(d.configId); data = d; isMonster = monster; speed = d.speed + config.speed; attack = d.attack + config.attack; crit = d.crit + config.crit; critDamge = (d.critDamage + config.critDamage) / 100f; defense = config.defense; hp = d.hp + config.hp; special = d.specialType; maxHp = hp; if (config.skillId1 > 0) { skill = SkillManager.instance.CreateSkill(config.skillId1, this); } if (config.passiveSkillId > 0) { passiveSkill = PassiveSkillManager.instance.CreateSkill(config.passiveSkillId, this); } normalAttackSkill = SkillManager.instance.CreateSkill(config.normalAttackSkillId, this); animation = GetComponentInChildren <Animation>(); }
public void UpdatePassive() { PassiveSkill passive = PlayerManager.m_Instance.GetSelectedUnit().GetPassiveSkill(); if (passive) { m_PassiveName.text = passive.m_StatusName; m_PassiveDescription.text = passive.m_StatusDescription; switch (passive) { case DeathPassive dp: if (dp.m_PassiveStatusEffect.m_RemainingDuration > 0) { m_PassiveStatus.text = $"Currently receiving +{dp.m_PassiveStatusEffect.m_RemainingDuration} bonus damage"; } else { m_PassiveStatus.text = $"{dp.m_StatusName} is inactive"; } break; case PestilencePassive pp: int charges = Mathf.FloorToInt((float)pp.m_CurrentHealResource / pp.m_HealResourceCastCost); m_PassiveStatus.text = $"{charges} {(charges == 1 ? "charge" : "charges")} of Benign Infection remaining"; break; default: m_PassiveStatus.text = string.Empty; break; } SetupSkin(m_PassiveEffect, passive, PlayerManager.m_Instance.GetSelectedUnit()); } m_PassiveEffect.gameObject.SetActive(passive); }
public void ApplyBounus(ObjectController target) { switch (bounus_type) { case BounusType.Stats: switch (stats_bounus.value_type) { case SetStatsField.ValueType.Raw: target.AddMaxStats(stats_bounus.stats_type, stats_bounus.value); break; case SetStatsField.ValueType.Percentage: if ((int)STATSTYPE.DEFENSE <= (int)stats_bounus.stats_type && (int)stats_bounus.stats_type <= (int)STATSTYPE.HASTE) { target.AddMaxStats(stats_bounus.stats_type, (float)System.Math.Round(stats_bounus.value, 1)); } else { target.AddMaxStats(stats_bounus.stats_type, (float)System.Math.Round(stats_bounus.value * target.MaxStats.Get(stats_bounus.stats_type), 0)); } break; } break; case BounusType.Passive: if (target.GetPassive(passive_bounus.GetType()) != null) { return; } CachedPassive = (PassiveSkill)passive_bounus.Instantiate(); CachedPassive.InitSkill(target); target.Passives.Add(CachedPassive); break; } }
public void Modify(BaseSkill skill) { skillName.Value = skill.SkillName; imagePath.Value = skill.IconPath; longDescription.Value = skill.LongDescription; shortDescription.Value = skill.ShortDescription; targetDescription.Value = skill.TargetDescription; skillLevel.Value = skill.SkillLevel.ToString(); nextLevel.Value = skill.NextLevelNeedHeroLevel.ToString(); if (skill is ActiveSkill) { // 主动技能的情况下 ActiveSkill activeSkill = skill as ActiveSkill; hotKey.Value = activeSkill.KeyCode.ToString(); mp.Value = activeSkill.Mp.ToString(); CD.Value = activeSkill.CD.ToString(); spellDistance.Value = activeSkill.SpellDistance.ToString(); } else { // 被动技能的情况下 PassiveSkill passiveSkill = skill as PassiveSkill; hotKey.Value = ""; mp.Value = ""; CD.Value = ""; spellDistance.Value = ""; } }
public PassiveSkill CreateSkill(int skillId, Characer caster) { var skill = new PassiveSkill(skillId, caster); skill.Start(); skills.Add(skill); return(skill); }
public Bounus(Bounus b) { this.bounus_type = b.bounus_type; this.condiction = b.condiction; this.stats_bounus = b.stats_bounus; this.passive_bounus = b.passive_bounus; this.CachedPassive = null; }
public void Present(PassiveSkill passiveSkill) { Present(passiveSkill.Information); upgradeButton.onClick.AddListener(() => { ValidateUpgrade(passiveSkill, passiveSkill.Information.RequiredUpgradeCost); }); }
private void ShowPrep(StatsContainer stats) { if (stats.level == -1) { return; } fullBackground.SetActive(true); attackBackground.SetActive(false); playerNormalObject.SetActive(true); playerForecastObject.SetActive(false); colorBackground.color = new Color(0.2f, 0.2f, 0.5f); characterName.text = stats.charName; portrait.enabled = true; portrait.sprite = stats.portrait; typeIcon.enabled = true; typeIcon.color = (stats.GetWeapon() != null) ? stats.GetWeapon().GetTypeColor() : Color.white; hpText.color = (stats.bHp != 0) ? Color.green : Color.white; atkText.color = (stats.bAtk != 0) ? Color.green : Color.white; spdText.color = (stats.bSpd != 0) ? Color.green : Color.white; defText.color = (stats.bDef != 0) ? Color.green : Color.white; resText.color = (stats.bRes != 0) ? Color.green : Color.white; hpText.text = stats.hp.ToString(); atkText.text = stats.atk.ToString(); spdText.text = stats.spd.ToString(); defText.text = stats.def.ToString(); resText.text = stats.res.ToString(); levelText.text = "Lv: " + stats.level; PassiveSkill passive = stats.GetPassive(SkillSlot.SLOTA); if (passive) { skillA.sprite = passive.baseSkill.icon; } skillA.enabled = (passive != null); passive = stats.GetPassive(SkillSlot.SLOTB); if (passive) { skillB.sprite = passive.baseSkill.icon; } skillB.enabled = (passive != null); passive = stats.GetPassive(SkillSlot.SLOTC); if (passive) { skillC.sprite = passive.baseSkill.icon; } skillC.enabled = (passive != null); wpnName.text = (stats.GetWeapon() != null) ? stats.GetWeapon().skillName : ""; supName.text = (stats.GetSupport() != null) ? stats.GetSupport().skillName : ""; skillName.text = (stats.GetSkill() != null) ? stats.GetSkill().skillName : ""; skillCharge.text = ""; playerStatsObject.SetActive(true); }
void InstantiatePassiveSkills() { passiveSkills[0] = new PassiveSkill("Attack", DataTransferManager.dataHolder.passiveLv[0], "Damage", 0.03f); passiveSkills[1] = new PassiveSkill("Defense", DataTransferManager.dataHolder.passiveLv[1], "Armor", 0.03f); passiveSkills[2] = new PassiveSkill("Magic", DataTransferManager.dataHolder.passiveLv[2], "Spell Power", 0.03f); passiveSkills[3] = new PassiveSkill("Vitality", DataTransferManager.dataHolder.passiveLv[3], "Health", 0.06f); passiveSkills[4] = new PassiveSkill("Energy", DataTransferManager.dataHolder.passiveLv[4], "Mana", 0.06f); SetPlayerInfoToSkills(); }
private void ShowStats(TacticsMove tactics) { StatsContainer stats = tactics.stats; fullBackground.SetActive(true); attackBackground.SetActive(false); playerNormalObject.SetActive(true); playerForecastObject.SetActive(false); colorBackground.color = (tactics.faction == Faction.PLAYER) ? new Color(0.2f, 0.2f, 0.5f) : new Color(0.5f, 0.2f, 0.2f); characterName.text = stats.charName; portrait.enabled = true; portrait.sprite = stats.portrait; typeIcon.enabled = true; typeIcon.color = (stats.GetWeapon() != null) ? stats.GetWeapon().GetTypeColor() : Color.white; hpText.color = (stats.bHp > 0) ? Color.green : (stats.bHp < 0) ? Color.red : Color.white; atkText.color = (stats.bAtk > 0) ? Color.green : (stats.bAtk < 0) ? Color.red : Color.white; spdText.color = (stats.bSpd > 0) ? Color.green : (stats.bSpd < 0) ? Color.red : Color.white; defText.color = (stats.bDef > 0) ? Color.green : (stats.bDef < 0) ? Color.red : Color.white; resText.color = (stats.bRes > 0) ? Color.green : (stats.bRes < 0) ? Color.red : Color.white; hpText.text = tactics.currentHealth + " / " + stats.hp; atkText.text = stats.atk.ToString(); spdText.text = stats.spd.ToString(); defText.text = stats.def.ToString(); resText.text = stats.res.ToString(); levelText.text = "Lv: " + stats.level; PassiveSkill passive = stats.GetPassive(SkillSlot.SLOTA); if (passive) { skillA.sprite = passive.baseSkill.icon; } skillA.enabled = (passive != null); passive = stats.GetPassive(SkillSlot.SLOTB); if (passive) { skillB.sprite = passive.baseSkill.icon; } skillB.enabled = (passive != null); passive = stats.GetPassive(SkillSlot.SLOTC); if (passive) { skillC.sprite = passive.baseSkill.icon; } skillC.enabled = (passive != null); wpnName.text = (stats.GetWeapon() != null) ? stats.GetWeapon().skillName : ""; supName.text = (stats.GetSupport() != null) ? stats.GetSupport().skillName : ""; skillName.text = (stats.GetSkill() != null) ? stats.GetSkill().skillName : ""; skillCharge.text = (stats.GetSkill() != null) ? Mathf.Max(0, stats.GetSkill().maxCharge - tactics.skillCharge).ToString() : ""; playerStatsObject.SetActive(true); }
public BattleEnemy(System.Data.SQLite.SQLiteDataReader data, List <Enemy> enemiesData, List <PassiveSkill> pSkillsData) { Id = Int(data["BattleEnemy_ID"]); Enemy = new Enemy(ReadObj(enemiesData, data["EnemyID"])); Level = Int(data["Level"]); GridPositionZ = Int(data["GridPositionZ"]); GridPositionX = Int(data["GridPositionX"]); HPMultiplier = Int(data["HPMultiplier"]); PassiveSkill1 = ReadObj(pSkillsData, data["PassiveSkill1"]); PassiveSkill2 = ReadObj(pSkillsData, data["PassiveSkill2"]); }
public int RemovePassiveSkill(int listIndex) { if (!ValidListInput(PassiveSkills, listIndex)) { return(-1); } PassiveSkill toRemove = PassiveSkills[listIndex]; RemovePassiveEffects(toRemove); PassiveSkills.RemoveAt(listIndex); return(toRemove.Id); }
////////////////////////////////////////////////////////// //void CalculateBonuses() // //Calculates any bonus stats from learned passive skills// //Called once before loading each stage // ////////////////////////////////////////////////////////// public void CalculateBonuses() { for (int i = 0; i < passiveSkills.Count; i++) { PassiveSkill temp = (PassiveSkill)passiveSkills[i].GetSkill(); skillSTR += temp.bonusSTR; skillINT += temp.bonusINT; skillEND += temp.bonusEND; skillSPR += temp.bonusSPR; skillAGI += temp.bonusAGI; skillLUCK += temp.bonusLUCK; } }
public void DisplaySkill(PassiveSkill skill) { this.skill = skill; nameText.text = "Name: " + skill.name; descText.text = "Skill Description: " + skill.description; if (skill.damage > 0) { damageValue.text = skill.damage.ToString(); } else { damageValue.text = skill.Hp.ToString(); } cost.text = "Skill Cost: " + skill.pointCost; upgradeButton.interactable = !playerstats.unlockedSkills.Contains(skill.name); }
void Start() { //Passive Skills dodgeRoll = new PassiveSkill(1, () => GetComponent <StatsManager>().player.GetComponent <Player>().canDodge = true); speedUp = new PassiveSkill(1, () => GetComponent <StatsManager>().speedRef += 2F); rollSpeedUp = new PassiveSkill(1, () => GetComponent <StatsManager>().rollSpeedRef += 5F); passive3 = new PassiveSkill(1, () => Debug.Log("skill bought")); passive4 = new PassiveSkill(1, () => Debug.Log("skill bought")); passive5 = new PassiveSkill(1, () => Debug.Log("skill bought")); passive6 = new PassiveSkill(1, () => Debug.Log("skill bought")); //Charge Attacks sonicJump = new ActiveSkill(2); boomerangThrow = new ActiveSkill(2); aThirdOne = new ActiveSkill(2); chargeAttacks = new List <ActiveSkill>(); chargeAttacks.Add(sonicJump); chargeAttacks.Add(boomerangThrow); chargeAttacks.Add(aThirdOne); //Dodge Abilities dodge1 = new ActiveSkill(10); dodge2 = new ActiveSkill(10); dodge3 = new ActiveSkill(10); newDodges = new List <ActiveSkill>(); newDodges.Add(dodge1); newDodges.Add(dodge2); newDodges.Add(dodge3); // Add all skills to list allSkills = new List <Skill>(); allSkills.Add(speedUp); allSkills.Add(rollSpeedUp); allSkills.Add(passive3); allSkills.Add(passive4); allSkills.Add(passive5); allSkills.Add(passive6); allSkills.Add(sonicJump); allSkills.Add(boomerangThrow); allSkills.Add(aThirdOne); allSkills.Add(dodge1); allSkills.Add(dodge2); allSkills.Add(dodge3); }
protected void UpdateSkillTreeState() { for (int i = 0; i < Patch.SkillTreeSize; i++) { if (CachedTreeSkills[i].GetType().IsSubclassOf(typeof(ActiveSkill))) { ActiveSkill active = GetActive(CachedTreeSkills[i].GetType()); if (active && PlayerData.SkillTreelvls[i] != 0) { active.InitSkill(GetComponent <ObjectController>(), PlayerData.SkillTreelvls[i]); } else if (active && PlayerData.SkillTreelvls[i] == 0) { Actives.Remove(active); active.Delete(); } else if (active == null && PlayerData.SkillTreelvls[i] != 0) { Skill s = CachedTreeSkills[i].Instantiate(); s.InitSkill(GetComponent <ObjectController>(), PlayerData.SkillTreelvls[i]); Actives.Add((ActiveSkill)s); } } else { PassiveSkill passive = GetPassive(CachedTreeSkills[i].GetType()); if (passive && PlayerData.SkillTreelvls[i] != 0) { passive.InitSkill(GetComponent <ObjectController>(), PlayerData.SkillTreelvls[i]); } else if (passive && PlayerData.SkillTreelvls[i] == 0) { Passives.Remove(passive); passive.Delete(); } else if (passive == null && PlayerData.SkillTreelvls[i] != 0) { Skill s = CachedTreeSkills[i].Instantiate(); s.InitSkill(GetComponent <ObjectController>(), PlayerData.SkillTreelvls[i]); Passives.Add((PassiveSkill)s); } } } }
private string QueryEliteName(ActorRoot inActor) { string text = null; if (inActor == null) { return(text); } ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(inActor.TheActorMeta.ConfigId); if (dataCfgInfoByCurLevelDiff == null) { return(text); } string text2 = UT.Bytes2String(dataCfgInfoByCurLevelDiff.szName); text = text2; if (inActor.SkillControl == null || inActor.SkillControl.talentSystem == null) { return(text); } string text3 = string.Empty; PassiveSkill[] array = inActor.SkillControl.talentSystem.QueryTalents(); if (array != null) { PassiveSkill[] array2 = array; for (int i = 0; i < array2.Length; i++) { PassiveSkill passiveSkill = array2[i]; if (passiveSkill != null && passiveSkill.bShowAsElite) { text3 += passiveSkill.PassiveSkillName; text3 += "之"; } } } if (!string.IsNullOrEmpty(text3)) { text = text3 + text; } return(text); }
// [FMODUnity.EventRef] // public string m_DeathSound = ""; // On startup. void Awake() { m_CurrentHealth = m_StartingHealth; m_CurrentMovement = m_StartingMovement; m_CurrentActionPoints = m_StartingActionPoints; m_Skills = m_LearnedSkills.Select(s => Instantiate(s)).ToList(); m_NavMeshAgent = GetComponent <NavMeshAgent>(); if (m_Passive) { m_PassiveSkill = Instantiate(m_Passive); } // Set all skills to startup stuff, cause scriptable objects don't reset on scene load. // @Grant - this is because you're only meant to use the instantiated versions! foreach (BaseSkill skill in m_LearnedSkills) { skill.Startup(); } }
private static void PassiveSkillC(SQLiteDataReader data) { PassiveSkills[Int(data["PassiveSkill_ID"])] = new PassiveSkill(); }
protected void learnPassiveSkill(PassiveSkill skill){ passiveSkillList.Add (skill); skill.parentController = this; skill.gameCtrl = ctrl; skill.init (); }
public virtual void OnUnitDelPassiveSkill(Unit unit, PassiveSkill skill) { }
/// <summary> /// End the current turn. /// </summary> public void EndCurrentTurn() { if (m_TeamCurrentTurn == Allegiance.Enemy) { m_TeamCurrentTurn = Allegiance.Player; } else if (m_TeamCurrentTurn == Allegiance.Player) { m_TeamCurrentTurn = Allegiance.Enemy; } Debug.Log($"============{m_TeamCurrentTurn} turn============"); UIManager.m_Instance.SwapTurnIndicator(m_TeamCurrentTurn); UIManager.m_Instance.SlideSkills(UIManager.ScreenState.Offscreen); // Play the end turn sound on the camera. //FMODUnity.RuntimeManager.PlayOneShot(m_TurnEndSound, Camera.main.transform.position); foreach (Unit unit in m_TeamCurrentTurn == Allegiance.Player ? UnitsManager.m_Instance.m_PlayerUnits : UnitsManager.m_Instance.m_ActiveEnemyUnits) { unit.SetDealExtraDamage(0); unit.ResetActionPoints(); unit.ResetCurrentMovement(); // Check the passives of all the player units for any that trigger at the start of their turn. PassiveSkill ps = unit.GetPassiveSkill(); if (ps) { if (ps.CheckPrecondition(TriggerType.OnTurnStart)) { ps.TakeEffect(unit); } } // Reduce cooldowns foreach (BaseSkill s in unit.GetSkills()) { s.DecrementCooldown(); } // Deal with inflicted statuses // So using .ToList() creates a compy of the list to iterate through // but continues romoving from the source list. Not particularly // efficient for large lists, but easy enough here. foreach (InflictableStatus status in unit.GetInflictableStatuses().ToList()) { // If returns true, status effect's duration has reached 0, remove the status effect. if (status.DecrementDuration()) { unit.RemoveStatusEffect(status); } // Otherwise do the effect else if (status.CheckPrecondition(TriggerType.OnTurnStart) == true) { status.TakeEffect(unit); } } } }
private static void UpdateNodeText(TreeNode node, PassiveSkill d3Object) { node.Text += $" >> {d3Object.Skill?.Name}"; }
public void RemoveSkill(PassiveSkill skill) { skill.Stop(); skills.Remove(skill); }
public void PopulateSkillList() { ClearList(); int id = 0; StatsContainer cont = clickCharacter.value; CharacterStats stats = characters[clickCharacter.value.statsID]; spText.text = cont.currentSp.ToString(); //Weapons for (int i = 0; i < stats.weapons.Length; i++) { WeaponSkill weapon = stats.weapons[i]; Transform skill = Instantiate(skillTemplate); skill.SetParent(skillListParent); SkillRepresentation rep = skill.GetComponent <SkillRepresentation>(); rep.skillID = id++; rep.type = SkillRepType.WEAPON; rep.typeIcon.color = Color.red; rep.skillName.text = weapon.skillName; rep.description.text = weapon.description; rep.cost = weapon.cost; rep.costText.text = (i <= cont.weaponLevel) ? "Unlocked" : "SP: " + weapon.cost; rep.costText.color = (cont.currentSp < weapon.cost && i == cont.weaponLevel + 1) ? Color.red : Color.black; rep.buttonImage.color = (i <= cont.weaponLevel) ? new Color(0.4f, 0.8f, 0.4f) : (i == cont.weaponLevel + 1) ? Color.white : Color.gray; rep.clickButton.interactable = (i == cont.weaponLevel + 1 && cont.currentSp >= weapon.cost); buttonList.Add(rep); skill.gameObject.SetActive(true); } //Supports for (int i = 0; i < stats.supports.Length; i++) { SupportSkill support = stats.supports[i]; Transform skill = Instantiate(skillTemplate); skill.SetParent(skillListParent); SkillRepresentation rep = skill.GetComponent <SkillRepresentation>(); rep.skillID = id++; rep.type = SkillRepType.SUPPORT; rep.typeIcon.color = Color.cyan; rep.skillName.text = support.skillName; rep.description.text = support.description; rep.cost = support.cost; rep.costText.text = (i <= cont.supportLevel) ? "Unlocked" : "SP: " + support.cost; rep.costText.color = (cont.currentSp < support.cost && i == cont.supportLevel + 1) ? Color.red : Color.black; rep.buttonImage.color = (i <= cont.supportLevel) ? new Color(0.4f, 0.8f, 0.4f) : (i == cont.supportLevel + 1) ? Color.white : Color.gray; rep.clickButton.interactable = (i == cont.supportLevel + 1 && cont.currentSp >= support.cost); buttonList.Add(rep); skill.gameObject.SetActive(true); } //Skills for (int i = 0; i < stats.skills.Length; i++) { SkillSkill skill = stats.skills[i]; Transform skillTransform = Instantiate(skillTemplate); skillTransform.SetParent(skillListParent); SkillRepresentation rep = skillTransform.GetComponent <SkillRepresentation>(); rep.skillID = id++; rep.type = SkillRepType.SKILL; rep.typeIcon.color = Color.magenta; rep.skillName.text = skill.skillName; rep.description.text = skill.description; rep.cost = skill.cost; rep.costText.text = (i <= cont.skillLevel) ? "Unlocked" : "SP: " + skill.cost; rep.costText.color = (cont.currentSp < skill.cost && i == cont.skillLevel + 1) ? Color.red : Color.black; rep.buttonImage.color = (i <= cont.skillLevel) ? new Color(0.4f, 0.8f, 0.4f) : (i == cont.skillLevel + 1) ? Color.white : Color.gray; rep.clickButton.interactable = (i == cont.skillLevel + 1 && cont.currentSp >= skill.cost); buttonList.Add(rep); skillTransform.gameObject.SetActive(true); } //Skill A for (int i = 0; i < stats.skillsA.Length; i++) { PassiveSkill passive = stats.skillsA[i]; Transform skillTransform = Instantiate(skillTemplate); skillTransform.SetParent(skillListParent); SkillRepresentation rep = skillTransform.GetComponent <SkillRepresentation>(); rep.skillID = id++; rep.type = SkillRepType.SKILLA; rep.typeIcon.color = new Color(1f, 0.5f, 0); rep.typeCharacter.text = "A"; rep.skillName.text = passive.baseSkill.skillName; rep.description.text = passive.baseSkill.description; rep.cost = passive.baseSkill.cost; rep.costText.text = (i <= cont.skillALevel) ? "Unlocked" : "SP: " + passive.baseSkill.cost; rep.costText.color = (cont.currentSp < passive.baseSkill.cost && i == cont.skillALevel + 1) ? Color.red : Color.black; rep.buttonImage.color = (i <= cont.skillALevel) ? new Color(0.4f, 0.8f, 0.4f) : (i == cont.skillALevel + 1) ? Color.white : Color.gray; rep.clickButton.interactable = (i == cont.skillALevel + 1 && cont.currentSp >= passive.baseSkill.cost); buttonList.Add(rep); skillTransform.gameObject.SetActive(true); } //Skill B for (int i = 0; i < stats.skillsB.Length; i++) { PassiveSkill passive = stats.skillsB[i]; Transform skillTransform = Instantiate(skillTemplate); skillTransform.SetParent(skillListParent); SkillRepresentation rep = skillTransform.GetComponent <SkillRepresentation>(); rep.skillID = id++; rep.type = SkillRepType.SKILLB; rep.typeIcon.color = new Color(1f, 0.5f, 0); rep.typeCharacter.text = "B"; rep.skillName.text = passive.baseSkill.skillName; rep.description.text = passive.baseSkill.description; rep.cost = passive.baseSkill.cost; rep.costText.text = (i <= cont.skillBLevel) ? "Unlocked" : "SP: " + passive.baseSkill.cost; rep.costText.color = (cont.currentSp < passive.baseSkill.cost && i == cont.skillBLevel + 1) ? Color.red : Color.black; rep.buttonImage.color = (i <= cont.skillBLevel) ? new Color(0.4f, 0.8f, 0.4f) : (i == cont.skillBLevel + 1) ? Color.white : Color.gray; rep.clickButton.interactable = (i == cont.skillBLevel + 1 && cont.currentSp >= passive.baseSkill.cost); buttonList.Add(rep); skillTransform.gameObject.SetActive(true); } //Skill C for (int i = 0; i < stats.skillsC.Length; i++) { PassiveSkill passive = stats.skillsC[i]; Transform skillTransform = Instantiate(skillTemplate); skillTransform.SetParent(skillListParent); SkillRepresentation rep = skillTransform.GetComponent <SkillRepresentation>(); rep.skillID = id++; rep.type = SkillRepType.SKILLC; rep.typeIcon.color = new Color(1f, 0.5f, 0); rep.typeCharacter.text = "C"; rep.skillName.text = passive.baseSkill.skillName; rep.description.text = passive.baseSkill.description; rep.cost = passive.baseSkill.cost; rep.costText.text = (i <= cont.skillCLevel) ? "Unlocked" : "SP: " + passive.baseSkill.cost; rep.costText.color = (cont.currentSp < passive.baseSkill.cost && i == cont.skillCLevel + 1) ? Color.red : Color.black; rep.buttonImage.color = (i <= cont.skillCLevel) ? new Color(0.4f, 0.8f, 0.4f) : (i == cont.skillCLevel + 1) ? Color.white : Color.gray; rep.clickButton.interactable = (i == cont.skillCLevel + 1 && cont.currentSp >= passive.baseSkill.cost); buttonList.Add(rep); skillTransform.gameObject.SetActive(true); } Debug.Log("Finished populating"); }