Esempio n. 1
0
File: Row.cs Progetto: weiks/q-slots
 internal void OnRefreshLayout(CustomSlot slot, int index)
 {
     this.slot  = slot;
     this.index = index;
     transform.SetParent(slot.layoutRow.transform, false);
     holders = new SymbolHolder[slot.config.reelLength];
 }
Esempio n. 2
0
        internal void Validate(CustomSlot slot)
        {
            this.slot = slot;
            for (int i = 0; i < symbols.Length; i++)
            {
                if (symbols[i] == null)
                {
                    symbols[i] = slot.skin.defaultSymbol;
                }
            }

            if (slot.config.advanced.initialReelPosition != 0)
            {
                if (slot.config.advanced.initialReelPosition < 0)
                {
                    lastSymbol = Random.Range(0, symbols.Length);
                }
                else
                {
                    lastSymbol = slot.config.advanced.initialReelPosition % symbols.Length - 1;
                }
            }

            for (int i = holders.Count - 1; i >= 0; i--)
            {
                holders[i].SetNextItem();
            }
            lastSymbol = holders[0].symbolIndex;
            RefreshRows();
        }
Esempio n. 3
0
            public Sequence Play(SymbolHolder holder, int orderInLine)
            {
                CustomSlot        slot    = holder.reel.slot;
                SlotEffectManager manager = slot.effects;

                Sequence sequence = Util.Sequence();

                if (manager.changeParentOfHitSymbol)
                {
                    Transform oldParent = holder.transform.parent;

                    //	int index = holder.transform.GetSiblingIndex();
                    sequence.OnStart(() => { holder.transform.SetParent(holder.reel.slot.transform); }).OnComplete(() => {
                        holder.transform.SetParent(oldParent);

                        //			holder.transform.SetSiblingIndex(index);
                    });
                }

                if (scale != Vector3.one)
                {
                    sequence.Join(holder.image.transform.DOScale(scale, duration * 0.35f).SetLoops(2, LoopType.Yoyo).SetEase(scaleEase)).SetDelay(delay * orderInLine);
                }
                if (rotation != Vector3.zero)
                {
                    sequence.Join(holder.image.transform.DORotate(rotation, duration * 0.6f, RotateMode.FastBeyond360).SetEase(rotationEase)).SetDelay(delay * orderInLine);
                }

                sequence.Join(holder.HighlightBorder(duration));
                return(sequence);
            }
Esempio n. 4
0
        internal void OnRefreshLayout(CustomSlot slot, int index)
        {
            this.slot  = slot;
            this.index = index;

            transform.SetParent(slot.layoutReel.transform, false);
            symbols = new Symbol[slot.config.symbolsPerReel];
            holders.Clear();
            Util.DestroyChildren <SymbolHolder>(this);
            for (int i = 0; i < slot.config.totalRows; i++)
            {
                holders.Add(Instantiate(slot.skin.symbolHolder).OnRefreshLayout(this, i));
            }

            //re-appy trigger data
            if (index == 0)
            {
                keySpriteName = "unicorn-box";
            }
            else
            {
                keySpriteName = "unicorn-princess2";
            }

            symbolHolders.Add(holders[1]);
            symbolHolders.Add(holders[2]);
            symbolHolders.Add(holders[3]);
        }
Esempio n. 5
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);
            }
Esempio n. 6
0
            public Sequence Play(CustomSlot slot, bool isOut, Action onComplete)
            {
                if (slot.debug.skipIntro || disableTransition)
                {
                    onComplete.Invoke();
                    return(null);
                }
                if (!target)
                {
                    target = slot.transform;
                }
                CanvasGroup cg = target.gameObject.GetComponent <CanvasGroup>();

                if (!cg)
                {
                    cg = target.gameObject.AddComponent <CanvasGroup>();
                }
                cg.alpha          = isOut ? 1 : fade;
                target.localScale = isOut ? Vector3.one : scale;
                Sequence sequence = Util.Sequence(duration + wait, () => {
                    cg.DOFade(isOut ? fade : 1f, duration).SetDelay(wait).SetEase(fadeEase);
                    target.DOScale(isOut ? scale : Vector3.one, duration).SetDelay(wait).SetEase(scaleEase);
                    if (rotation != Vector3.zero)
                    {
                        target.DORotate(rotation, duration, RotateMode.FastBeyond360).SetDelay(wait).SetEase(rotationEase);
                    }
                }).OnComplete(onComplete.Invoke);

                return(sequence);
            }
Esempio n. 7
0
 internal void Validate(CustomSlot slot)
 {
     this.slot = slot;
     symbols   = GetComponentsInChildren <Symbol>();
     foreach (Symbol symbol in symbols)
     {
         symbol.Validate();
     }
 }
Esempio n. 8
0
        public HashSet <List <SymbolHolder> > allHitHolders = new HashSet <List <SymbolHolder> >();   // For alternativeLineCheck to determine whether if a win is already made for a chain

        internal void Validate(CustomSlot slot)
        {
            this.slot = slot;
            lines     = GetComponentsInChildren <Line>();
            Array.Sort(lines);
            foreach (Line line in lines)
            {
                line.Validate(this);
            }
        }
Esempio n. 9
0
        internal void Validate(CustomSlot slot)
        {
            this.slot = slot;

            //         DatabaseReference reference = SetFirebase();
            //         FetchSymbols(reference);

            foreach (Symbol symbol in symbols)
            {
                symbol.Validate();
            }
            SetWeights();
        }
Esempio n. 10
0
 internal void OnRefreshLayout(CustomSlot slot, int index)
 {
     this.slot  = slot;
     this.index = index;
     transform.SetParent(slot.layoutReel.transform, false);
     symbols = new Symbol[slot.config.symbolsPerReel];
     holders.Clear();
     Util.DestroyChildren <SymbolHolder>(this);
     for (int i = 0; i < slot.config.totalRows; i++)
     {
         holders.Add(Instantiate(slot.skin.symbolHolder).OnRefreshLayout(this, i));
     }
 }
 protected bool FindCustomSlot()
 {
     if (Selection.activeGameObject)
     {
         CustomSlot slotInTree = Selection.activeGameObject.GetComponentInParent <CustomSlot>();
         if (slotInTree)
         {
             slot = slotInTree;
         }
     }
     if (!slot)
     {
         EditorGUILayout.LabelField("Please select a hierarchy tree CustomSlot exists.");
         return(false);
     }
     return(true);
 }
Esempio n. 12
0
 public void Init(Symbol symbol, CustomSlot slot, PayTableGen gen)
 {
     this.slot        = slot;
     imageMain.sprite = symbol.sprite;
     int[] pays = symbol.pays;
     if (symbol.payType == Symbol.PayType.Normal)
     {
         for (int i = 0; i < slot.reels.Length; i++)
         {
             if (i >= pays.Length)
             {
                 break;
             }
             if (pays[i] == 0)
             {
                 continue;
             }
             Text chain  = Util.InstantiateAt <Text>(textChain, layout.transform);
             Text payout = Util.InstantiateAt <Text>(textPayout, layout.transform);
             chain.text  = "" + (i + 1);
             payout.text = "" + symbol.GetPayAmount(i + 1);
         }
     }
     else
     {
         Text chain = Util.InstantiateAt <Text>(textChain, layout.transform);
         if (symbol.payType == Symbol.PayType.FreesSpin)
         {
             chain.text = gen.setting.textForFreeSpin;
         }
         if (symbol.payType == Symbol.PayType.Bonus)
         {
             chain.text = gen.setting.textForBonus;
         }
         if (symbol.payType == Symbol.PayType.Custom)
         {
             chain.text = gen.setting.textForCustom;
         }
     }
     textChain.gameObject.SetActive(false);
     textPayout.gameObject.SetActive(false);
 }
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();
            CustomSlot t = target as CustomSlot;

            GUILayout.Space(20);
            if (GUILayout.Button("Refresh Layout"))
            {
                t.layout.Refresh();
                EditorUtility.SetDirty(t);
            }
            if (GUILayout.Button("Open SymbolGen Window"))
            {
                SymbolGenEditorWindow window = EditorWindow.GetWindow <SymbolGenEditorWindow>("SymbolGen");
                window.slot = t;
            }
            if (GUILayout.Button("Open Quick Tool Window"))
            {
                ShortcutToolEditorWindow window = EditorWindow.GetWindow <ShortcutToolEditorWindow>("Quick Tool");
                window.slot = t;
            }
        }
Esempio n. 14
0
 public GameInfo(CustomSlot slot)
 {
     this.slot = slot;
 }
Esempio n. 15
0
 public HitInfo(CustomSlot slot, Line line = null, Symbol symbol = null)
 {
     this.slot      = slot;
     this.line      = line;
     this.hitSymbol = symbol;
 }