public void ApplyAbilities() { for (int i = 0; i < currentAbilities.Length; i++) { try { //Apply jump stats currentMaxJump += currentAbilities[i].Jump; //Add movement speed currentMoveSpeed += currentAbilities[i].Speed; //Add energy currentEnergyCapacity += currentAbilities[i].Energy; //Add damage currentDmg += currentAbilities[i].Damage; //Apply fire resistance if (!currentfireResist) { currentfireResist = currentAbilities[i].FireResitant; } //Apply frost resistance if (!currentfrostResist) { currentfrostResist = currentAbilities[i].FrostResitant; } //If we have a melee ability if (currentAbilities[i].abType == global::abilityType.melee) { //Set melee damage function meleeDmgEvent = CameraController.AddRayEvent("Enemy", MeleeDamage, 15); } //If we have a ranged ability if (currentAbilities[i].abType == global::abilityType.ranged) { //Set melee damage function rangeDmgEvent = CameraController.AddRayEvent("Enemy", RangedDamage, 150); } //If we have a movement ability if (currentAbilities[i].abType == global::abilityType.movement) { } } catch { Debug.Log("Missing some abilites in slots!"); } } }
// Start is called before the first frame update void Start() { //ResetStats(); Player = GameObject.FindGameObjectWithTag("Player"); playerAnim = Player.GetComponentsInChildren <Animator>(); rb = Player.GetComponent <Rigidbody>(); rb.isKinematic = true; ResetStats(); //ApplyAbilities(); //CameraController.AddRayEvent("test", Test); DoorEvent = CameraController.AddRayEvent("doorButton", Door, 20); bananaint = CameraController.AddRayEvent("banana", Banana, 40); }