Ejemplo n.º 1
0
    // Set one effect on
    public void RandomEffect()
    {
        int rngEffectId = Random.Range(0, Effects.Count);

        StartDistortion();

        while (true)
        {
            rngEffectId = Random.Range(0, Effects.Count);

            if (Effects.IndexOf(CurrentEffect) == rngEffectId)
            {
                var nextID = Effects.IndexOf(CurrentEffect) + 1;
                rngEffectId = nextID == Effects.Count ? 0 : nextID;
            }

            if (Random.value < Effects[rngEffectId].chance)
            {
                break;
            }
        }

        Debug.Log(Effects[rngEffectId].chance);


        CurrentEffect = Effects[rngEffectId];

        CurrentEffect.StartEffect();
        StartCoroutine(EffectWai(randomInterval / 2));
    }
Ejemplo n.º 2
0
    public void NextPickUpEffect()
    {
        int pickUpCount = Random.Range(0, PickUpEffects.Count - 1);

        CurrentPickupEffect = PickUpEffects[pickUpCount];
        CurrentPickupEffect.StartEffect();
        StartCoroutine(PickUpEffectWai(5));
    }
Ejemplo n.º 3
0
        public IBoostEffect CreateBoostBuff(int boostType, int last, int point, int percent, params int[] buffIds)
        {
            var boost = new BoostEffect(RootSkill, buffIds, (EnumBoostType)boostType, false, false, false);

            boost.Point   = point;
            boost.Percent = percent;
            boost.Last    = last;
            boost.TimeEnd = (short)last;
            boost.Repeat  = 0;
            boost.Recycle = false;
            return(boost);
        }
Ejemplo n.º 4
0
    public void NextEffect()
    {
        if (CurrentEffect != null)
        {
            CurrentEffect.EndEffect();

            var nextID = Effects.IndexOf(CurrentEffect) + 1;
            Debug.Log(nextID);
            EffectId = nextID == Effects.Count ? 0 : nextID;
        }



        CurrentEffect = Effects[EffectId];

        CurrentEffect.StartEffect();
    }