Exemplo n.º 1
0
            public Sequence Play(CustomSlot slot)
            {
                if (introType == IntroType.None)
                {
                    return(null);
                }
                if (isPlayed && playOnlyOnce)
                {
                    return(null);
                }
                isPlayed = true;

                List <SymbolHolder> holders  = slot.GetVisibleHolders();
                Sequence            sequence = DOTween.Sequence();

                switch (introType)
                {
                case IntroType.Demo:
                    sequence.Join(slot.effects.IlluminateLines(duration + holders.Count * delay));
                    foreach (SymbolHolder holder in holders)
                    {
                        sequence.Join(holder.transform.DORotate(rotation, duration * 0.5f, RotateMode.FastBeyond360).SetEase(rotationEase).SetLoops(2, LoopType.Yoyo).SetDelay(delay));
                        sequence.Join(holder.transform.DOPunchScale(new Vector2(1f, 1f), duration, vibrato, elasticity).SetEase(rotationEase).SetDelay(delay));
                    }
                    break;
                }

                slot.AddEvent(wait);
                slot.AddEvent(sequence);
                return(sequence);
            }
Exemplo n.º 2
0
        public bool ProcessHitCheck()
        {
            if (isProcessed)
            {
                return(false);
            }
            isProcessed = true;

            if (line)
            {
                holders = line.GetHoldersOnPath();
                if (holders == null || holders.Length != slot.reels.Length)
                {
                    return(false);
                }
                ParseChains(holders);
            }
            else
            {
                List <SymbolHolder> list = slot.GetVisibleHolders();
                foreach (SymbolHolder holder in list)
                {
                    if (holder.symbol == hitSymbol && hitSymbol.matchType == Symbol.MatchType.Scatter)
                    {
                        hitChains++;
                        hitHolders.Add(holder);
                    }
                }
                holders = hitHolders.ToArray();
                _isHit  = hitChains >= hitSymbol.minChains;
            }

            if (isHit)
            {
                slot.ProcessHit(this);
            }
            return(isHit);
        }