public void OnStart(MetaData.PlayerMetaData senderParam) { // Reset states isChanneling = false; isWinding = false; // Reset timers channel = 0; windup = 0; cooldown = 0; // Check if we are using scriptCooldown if (scriptCooldown) { // if so we will render the baseCooldown obsolete, baseCooldown = 0; // and loop through the effects to find the effect, foreach (var effect in effects) { // that has the highest cooldown and use that as the ability cooldown if (effect != null && effect.stackTimer > baseCooldown) { baseCooldown = effect.stackTimer; } else if (effect == null) { Debug.Log("<color=red>Error ! Effect is null.</color>\n" + "Please add effect to ability."); } } } // error check and pass OnStart method on if (senderParam == null) { Debug.Log("<color=red>Error ! No sender of type 'ObjectMetaData' was found</color>\n" + "You must pass an ability sender at start!"); } else { sender = senderParam; foreach (var effect in effects) { if (effect != null) { effect.OnStart(sender); } else { Debug.Log("<color=red>Error ! Effect is null.</color>\n" + "Please add effect to slot in ability."); } } } }
public void OnStart(MetaData.PlayerMetaData senderParam) { // loop throug every EffectScript foreach (EffectScript effectScript in effectScripts) { // Trigger OnStart and send 'sender' parameter and this container along // This is necessary for future use, such as // playing visual effects on our character effectScript.OnStart(senderParam, this); } // set our own sender variable sender = senderParam; // Set cooldown to 0 for easier testing cooldown = 0; }
public virtual void OnStart(MetaData.PlayerMetaData senderParam, Effect containerParam) { container = containerParam; sender = senderParam; }
private void Start() { sender = GameObject.FindGameObjectWithTag("Player").GetComponent <AbilitySystem.MetaData.PlayerMetaData>(); ability.OnStart(sender); }