public override void OnActivate(int pinID) { if (pinID != 0) { return; } PlayerData player = MonoSingleton <GameManager> .Instance.Player; UnitData unitDataByUniqueId = player.FindUnitDataByUniqueID((long)GlobalVars.SelectedUnitUniqueID); AbilityData abilityData = unitDataByUniqueId.GetAbilityData((long)GlobalVars.SelectedAbilityUniqueID); if (abilityData.Rank >= abilityData.GetRankCap()) { ((Behaviour)this).set_enabled(false); this.ActivateOutputLinks(2); } if (player.AbilityRankUpCountNum == 0) { ((Behaviour)this).set_enabled(false); this.ActivateOutputLinks(3); } player.RankUpAbility(abilityData); Dictionary <long, int> abilitiesRankUp = GlobalVars.AbilitiesRankUp; if (!abilitiesRankUp.ContainsKey(abilityData.UniqueID)) { abilitiesRankUp[abilityData.UniqueID] = 0; } Dictionary <long, int> dictionary; long uniqueId; (dictionary = abilitiesRankUp)[uniqueId = abilityData.UniqueID] = dictionary[uniqueId] + 1; MonoSingleton <GameManager> .Instance.Player.OnAbilityPowerUp(unitDataByUniqueId.UnitID, abilityData.AbilityID, abilityData.Rank, false); List <string> learningSkillList = abilityData.GetLearningSkillList(abilityData.Rank); if (learningSkillList != null && learningSkillList.Count > 0) { FlowNode_Variable.Set("LEARNING_SKILL", "1"); } ((Behaviour)this).set_enabled(false); this.ActivateOutputLinks(1); }
private void UpdateItemStates() { AbilityData dataOfClass = DataSource.FindDataOfClass <AbilityData>(((Component)this).get_gameObject(), (AbilityData)null); if (dataOfClass == null) { return; } bool flag = dataOfClass.Rank >= dataOfClass.GetRankMaxCap(); if (Object.op_Inequality((Object)this.LabelLevel, (Object)null)) { this.LabelLevel.SetActive(!flag); } if (Object.op_Inequality((Object)this.LabelLevelMax, (Object)null)) { this.LabelLevelMax.SetActive(flag); } if (Object.op_Inequality((Object)this.RankupButton, (Object)null)) { ((Component)this.RankupButton).get_gameObject().SetActive(dataOfClass.Rank < dataOfClass.GetRankCap()); this.RankupButton.set_interactable(true & MonoSingleton <GameManager> .Instance.Player.CheckRankUpAbility(dataOfClass)); } if (!Object.op_Inequality((Object)this.AbilityPoint, (Object)null)) { return; } ((Component)this.AbilityPoint).get_gameObject().SetActive(dataOfClass.Rank < dataOfClass.GetRankCap()); }