public virtual void ReturnToPool() { //if (_ItemData == null) //{ // PoolExtension.SetPool(PoolEnums.PoolId.RedPackBox, transform); // return; //} PoolExtension.SetPool(_ItemData.ItemPoolId, transform); }
public override void ReturnToPools() { base.ReturnToPools(); PoolExtension.SetPool(EnemyEnums.GetPoolEnemy(_VirusEnemyId), transform); direction_left_right = DirectionEnums.DirectionId.None; direction_up_down = DirectionEnums.DirectionId.None; }
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); } }
/// <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); } } }
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); }
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(); }
public void ReturnToPools() { PoolExtension.SetPool(_carDataProperties.BulletId, transform); }
public override void ReturnToPools() { base.ReturnToPools(); PoolExtension.SetPool(EnemyEnums.GetPoolEnemy(_RockEnemyId), transform); }
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); }); }
public override void ReturnToPools() { PoolExtension.SetPool(EnemyEnums.GetPoolEnemy(_BossEnemyId), transform); }
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); }); }
public void ReturnToPools() { PoolExtension.SetPool(_PoolId, transform); }
public void ReturnPools() { PoolExtension.SetPool(poolID, transform); }