void HandleStatUsageEvent(StatUsageTriggerEvent sute) { PlayerSkill skill = mPlayerSkills.GetPlayerSkill(sute.Skill); if (skill.Level < skill.Max) { skill.Uses++; // TODO (James): Come up with a better leveling curve if (skill.Uses >= skill.Level * 10) { skill.Level++; } } }
protected override void HandleItemCollisionEnter(Collision col) { Debug.Log(col.gameObject.name); if (col != null) { StatUsageTriggerEvent sute = new StatUsageTriggerEvent(skillType); SEEventManager.Instance.TriggerEvent(sute); Debug.Log("Collision enter with: " + col.gameObject.name); PhysicalObject physObj = col.gameObject.GetComponent <PhysicalObject>(); if (physObj != null) { float resistance = physObj.GetPhysicalResistanceByImpactType(sImpactType); // Do something here I dunno. Some random thoughts. Apply damage? I dunno. We'd need to apply the strength to a tree or something. Debug.Log("Collision object had a resistance of: " + resistance); Debug.Log("Strength of this object is: " + sImpactStrength); } } }