private void Start() { player = GameObject.FindWithTag(Constants.TAG_PLAYER); playerScript = player.GetComponent <PlayerScript>(); abilityUIManager = GameObject.Find(Constants.GAMEOBJECT_NAME_CANVAS).GetComponent <AbilityUIManager>(); modifiers = new List <Modifier>(); Setup(); }
// Start is called before the first frame update void Start() { velocity = Vector3.zero; health = healthMax; invulnerable = false; gold = 0; walls = new List <GameObject>(); modifierAdds = new List <Item>(); abilityUIManager = GameObject.Find(Constants.GAMEOBJECT_NAME_CANVAS).GetComponent <AbilityUIManager>(); abilities[0] = gameObject.AddComponent <Ability_MagicBlast>(); abilities[0].abilitySlot = 0; abilityUIManager.UpdateHealth(health, healthMax); }
public void LevelUp() { if (AbilityLevel > 0 && AbilityLevel < MaxLevel) { AbilityLevel++; LevelUpExtraStats(); LevelUpAbilityStats(); LevelUpBuffsAndDebuffs(); AbilityUIManager abilityUIManager = champion.AbilityUIManager; if (UsesResource && resourceCost == 0) { UsesResource = false; if (abilityUIManager) { abilityUIManager.SetAbilityCost(ID, resourceCost); } } if (baseCooldownPerLevel != 0) { if (affectedByCooldownReduction) { SetCooldownForAbilityAffectedByCooldownReduction(); } else { SetCooldownForAbilityUnaffectedByCooldownReduction(); } } if (UsesResource && abilityUIManager) { abilityUIManager.SetAbilityCost(ID, resourceCost); abilityUIManager.UpdateAbilityHasEnoughResource(ID, !IsEnabled || IsBlocked || IsOnCooldown || resourceCost <= champion.StatsManager.Resource.GetCurrentValue()); } } else if (AbilityLevel == 0) { AbilityLevel++; EnableAbility(); EnableAbilityPassive(); } }