示例#1
0
    public override void FreeMultiplier(bool isIncrement)
    {
        isMultiplier = false;

        if (isIncrement)
        {
            var mover = Mover.Create(factory.moverMultiplier, ui.canvas[3].transform, t.position, ui.game.multiplierText, 0.5f, target =>
            {
                if (gameplay.multiplier < Missions.maxMultiplier)
                {
                    gameplay.multiplier++;
                }

                foreach (Stuff cat in Factory.LIVE_STUFF)
                {
                    if (cat != null && cat is CatBasic && (cat as CatBasic).isMultiplier)
                    {
                        (cat as CatBasic).SetMultiplier();
                    }
                }
            });

            mover.multiplierText.text  = rikiImage.multiplierText.text;
            mover.multiplierText.color = rikiImage.multiplierText.color;
        }

        rikiImage.idle.SetActive(true);
        rikiImage.multiplier.SetActive(false);
        rikiImage.multiplierText.gameObject.SetActive(false);
    }
示例#2
0
    public virtual void FreeMultiplier(bool isIncrement)
    {
        isMultiplier = false;
        image.sprite = type.spriteNormal;
        multiplierImage.gameObject.SetActive(false);
        multiplierLightImage.gameObject.SetActive(false);

        if (isIncrement)
        {
            Mover mover = Mover.Create(Game.factory.moverMultiplier, ui.canvas[3].transform, t.position, ui.game.multiplierText, 0.5f, target =>
            {
                if (gameplay.multiplier < Missions.maxMultiplier)
                {
                    gameplay.multiplier++;
                }

                foreach (Stuff cat in Factory.LIVE_STUFF)
                {
                    if (cat != null && cat is CatBasic && (cat as CatBasic).isMultiplier)
                    {
                        (cat as CatBasic).SetMultiplier();
                    }
                }
            });
            mover.multiplierImage.sprite = multiplierImage.sprite;
        }
    }
示例#3
0
    public override void FreeCoin()
    {
        isCoin = false;

        rikiImage.idle.SetActive(true);
        rikiImage.candy.SetActive(false);        // TODO: Кто то обратно включает и получается, что idle не видно

        Mover.Create(ui.game.coinPrefab, ui.canvas[3].transform, t.position, gameplay.level.coinParent, 0.4f, target => { gameplay.GetCoin(); });
    }
示例#4
0
    IEnumerator FlyingCoinsOut(Vector3 from, Transform to, int count, Transform parent, float scale, float shift)
    {
        sound.Play(sound.getCoins);
        UpdateCoins();

        for (int i = 0; i < count; i++)
        {
            Mover.Create(ui.game.coinPrefab, parent, from, to, UnityEngine.Random.Range(0, shift), scale);
            yield return(new WaitForEndOfFrame());
        }
    }
示例#5
0
 IEnumerator FlyingTimers(int count)
 {
     for (int i = 0; i < count; i++)
     {
         Mover.Create(timer, ui.canvas[3].transform, t.position, ui.game.timeImage, UnityEngine.Random.Range(-0.5f, 0.5f), target =>
         {
             gameplay.seconds++;
         });
         yield return(new WaitForEndOfFrame());
     }
 }
示例#6
0
    public override void Activate(Vector2 sourse)
    {
        if (isActivated)
        {
            Debug.LogWarning("CatBasic activated once more");
            return;
        }
        else
        {
            isActivated = true;
        }

        isPicked = false;

        t.SetParent(ui.game.stuffFrontFront, false);

        highlightImage.gameObject.SetActive(false);

        shape.enabled = false;

        if (isCoin)
        {
            FreeCoin();
        }

        if (isMultiplier)
        {
            FreeMultiplier(true);
        }

        if (isHat)
        {
            isHat = false;
            user.newYearHats++;
            Events.newYear.isItemGet = true;
        }

        if (isHeart)
        {
            isHeart = false;
            user.stValentinHearts++;
            Events.stValentin.isItemGet = true;
        }

        if (isBat)
        {
            isBat = false;
            user.halloweenBats++;
            Events.halloween.isItemGet = true;
        }

#if GAF
        if (anim != null)
        {
            anim.clip.play();
        }
#endif
        foreach (CatSlot catSlot in ui.game.catSlots)
        {
            if (catSlot.catItem != null && catSlot.type == type)
            {
                Mover mana = Mover.Create(ui.game.manaPrefab, ui.canvas[3].transform, t.position, catSlot, 0.2f, catSlot.AddMana);
                mana.image.color = type.color;
                break;
            }
        }

        Vector2 force = (t.anchoredPosition - new Vector2(sourse.x * Random.Range(0.8f, 1.2f), sourse.y * Random.Range(0.8f, 1.2f))).normalized;
        rb.AddForce(force * 500);
        rb.gravityScale *= 1.5f;

        if (gameplay.isPlaying)
        {
            factory.CreateCatRandomBasic();
        }

        Invoke("Reset", 2f);
    }
示例#7
0
 public virtual void FreeCoin()
 {
     isCoin       = false;
     image.sprite = type.spriteNormal;
     Mover.Create(ui.game.coinPrefab, ui.canvas[3].transform, t.position, gameplay.level.coinParent, 0.4f, target => { gameplay.GetCoin(); });
 }