Esempio n. 1
0
 public virtual void ReturnToPool()
 {
     //if (_ItemData == null)
     //{
     //    PoolExtension.SetPool(PoolEnums.PoolId.RedPackBox, transform);
     //    return;
     //}
     PoolExtension.SetPool(_ItemData.ItemPoolId, transform);
 }
Esempio n. 2
0
    public override void ReturnToPools()
    {
        base.ReturnToPools();

        PoolExtension.SetPool(EnemyEnums.GetPoolEnemy(_VirusEnemyId), transform);

        direction_left_right = DirectionEnums.DirectionId.None;
        direction_up_down    = DirectionEnums.DirectionId.None;
    }
Esempio n. 3
0
    public void InstanceFxRedPack(Vector3 start_position, Vector3 end_position, double amount, int unit)
    {
        Monster.Data.GameData.RedPackCash += (float)amount;
        if (amount > 1)
        {
            Helper.FixUnit(ref amount, ref unit);
        }

        var quantity = 1;

        if (amount > 1)
        {
            quantity = (int)Mathf.Round((float)amount / 3f);
            quantity = Mathf.Clamp(quantity, 1, 10);
        }

        for (int i = 0; i < quantity; i++)
        {
            var fx = PoolManager.Instance.PoolySpawn("FxItem_RedPack");//PoolExtension.GetPool(PoolEnums.PoolId.FxItemRedPack);

            if (fx == null)
            {
                continue;
            }

            fx.transform.position = new Vector3(start_position.x,
                                                start_position.y);

            fx.transform.localScale = Vector3.zero;

            var index = i == quantity - 1;

            var tween = fx.DOScale(1, Durations.DurationScale / 2f).SetEase(Ease.OutBack).SetDelay(i * Durations.DurationScale / 3f);

            tween.OnComplete(() =>
            {
                var tween2 = fx.DOMove(end_position, Durations.DurationMovingLine).SetDelay(Durations.DurationScale / 2f).SetEase(Ease.InBack);

                tween2.OnComplete(() =>
                {
                    PoolExtension.SetPool(PoolEnums.PoolId.FxItemRedPack, fx);

                    //Helper.AddValue(ref PlayerData.Coins, ref PlayerData.CoinUnit, real_coins, real_unit);

                    Instance.InstanceFxFireWork(fx.position);
                    Instance.PostActionEvent(ActionEnums.ActionID.RefreshUIRedPackCash);
                    Instance.PlayAudioSound(AudioEnums.SoundId.Coins);
                    //if (index)
                    //{
                    //    Monster.Data.GameData.RedPackCash++;
                    //}
                });
            }).SetEase(Ease.InBack);
        }
    }
Esempio n. 4
0
    /// <summary>
    /// Instances the pools.
    /// </summary>
    private void InstancePool()
    {
        for (int i = 0; i < poolData.Length; i++)
        {
            var item = poolData[i];

            for (int j = 0; j < item.quantity; j++)
            {
                var poolInstance = Instantiate(item.poolPrefab.gameObject, transform);
                PoolExtension.SetPool(item.poolID, poolInstance.transform);
            }
        }
    }
Esempio n. 5
0
    private void UnBox()
    {
        if (!IsReady)
        {
            return;
        }

        this.PlayAudioSound(AudioEnums.SoundId.BoxOpen);

        GameManager.Instance.SetBaseItemGrid(_ItemData,
                                             GetIndexX(),
                                             GetIndexY());

        PoolExtension.SetPool(_PoolId, transform);

        GameActionManager.Instance.InstanceFxTapBox(transform.position);
        GameActionManager.Instance.InstanceFxFireWork(transform.position);
    }
Esempio n. 6
0
    private void UnBox()
    {
        if (!IsReady)
        {
            return;
        }

        this.PlayAudioSound(AudioEnums.SoundId.BoxOpen);


        GameManager.Instance.SetNodeInGrid(GetIndexX(), GetIndexY(), null);
        GameManager.Instance.SetFreeIndexGrid(GetIndexX(), GetIndexY());


        PoolExtension.SetPool(_PoolId, transform);
        GameActionManager.Instance.InstanceFxTapBox(transform.position);
        GameActionManager.Instance.InstanceFxFireWork(transform.position);
        UIGameManager.Instance.OpenClaimRedPack(RedPackAmount);

        //  RandomGiftManager.Instance.EnableHud();
    }
Esempio n. 7
0
 public void ReturnToPools()
 {
     PoolExtension.SetPool(_carDataProperties.BulletId, transform);
 }
Esempio n. 8
0
    public override void ReturnToPools()
    {
        base.ReturnToPools();

        PoolExtension.SetPool(EnemyEnums.GetPoolEnemy(_RockEnemyId), transform);
    }
Esempio n. 9
0
    public void Enable(Vector3 position, string value)
    {
        if (gameObject.activeSelf == false)
        {
            gameObject.SetActive(true);
        }

        _TextCoins.text    = value;
        transform.position = position;

        transform.DOComplete(true);
        transform.DOMoveY(position.y + 1, Durations.DurationMovingUpFx).OnComplete(() => { PoolExtension.SetPool(_PoolId, transform); });
    }
Esempio n. 10
0
 public override void ReturnToPools()
 {
     PoolExtension.SetPool(EnemyEnums.GetPoolEnemy(_BossEnemyId), transform);
 }
Esempio n. 11
0
    public void Init(Vector3 position, string value)
    {
        text_damage.text     = value;
        transform.position   = position;
        transform.localScale = Vector.Vector3Half;

        transform.DOComplete(true);
        transform.DOScale(1f, Durations.DurationMovingUpFx).SetEase(Ease.OutBack);
        transform.DOMoveY(position.y + 1, Durations.DurationMovingUpFx).OnComplete(() => { PoolExtension.SetPool(PoolId, transform); });
    }
Esempio n. 12
0
 public void ReturnToPools()
 {
     PoolExtension.SetPool(_PoolId, transform);
 }
Esempio n. 13
0
 public void ReturnPools()
 {
     PoolExtension.SetPool(poolID, transform);
 }