Create an Effect Controller

Author: 
el_bearduno
el_bearduno's picture
Status: 
Priority: 

Putting this on hold because most of this can be done in a particle system already. 

 

Effect Controller

public struct EffectStruct {
    Effect effect;
    int weight;
}

EffectStruct[] effects;

int minEffectCount;
int maxEffectCount;

float minDelayBetweenEffects;
float maxDelayBetweenEffects;
Vector3 minLocalPosition;
Vector3 maxLocalPosition;
Vector3 minLocalScale;
Vector3 maxLocalScale;
Vector3 minLocalRotation;
Vector3 maxLocalRotation;

bool playInOrder = false;

void PlayAllEffect()
{
    //choose how many effect to play

    // for each effect
    {
        //get delay
        
        //choose effect
        
        StartCoroutine(PlaySingleEffect(effect, delay));
    }
}

IEnumerator PlaySingleEffect(Effect effect, float delay)
{
     yield return new WaitForSeconds(delay);

     effect.Play();
}

    Add new comment

    Basic Editor

    • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
    • Lines and paragraphs break automatically.

    Plain Text

    • No HTML tags allowed.
    • Web page addresses and e-mail addresses turn into links automatically.
    • Lines and paragraphs break automatically.