public void SetMilkEffect(Vector2 _pos) { int dropRan = Random.Range(0, 10); if (dropRan <= 0) { int ran = Random.Range(0, GameDataManager.Instance.userData.milkItemList.Count); Debug.Log(ran); MilkItem item = GameDataManager.Instance.userData.milkItemList[ran]; activeMilkNum = activeMilkNum + 1; if (activeMilkNum >= milkEffectList.Count) { activeMilkNum = 0; } if (milkEffectList[activeMilkNum].gameObject.activeInHierarchy == false) { milkEffectList[activeMilkNum].gameObject.SetActive(true); milkEffectList[activeMilkNum].SetMilkEffect(item, _pos); } } }
public void SetBuffItem(MilkItem _item) { effectUI.transform.localPosition = new Vector2(282, 0); milkIcon.sprite = _item.milkSprite; milkNameText.text = _item.type.ToString(); milkTimeGauge.fillAmount = 1; }
public void SetMilkShopItem(MilkItem _item) { milkImage.sprite = _item.milkSprite; milkNameText.text = string.Format("{0} MILK", _item.type); milkLevelText.text = string.Format("LEVEL.{0}", _item.milkLevel); infoNameText.text = string.Format("{0} MILK", _item.type); infoLevelText.text = string.Format("LEVEL.{0}", _item.milkLevel); infoSummaryText.text = _item.milkInfo; }
public void SetMilkEffect(MilkItem _milkItem, Vector2 _pos) { transform.position = _pos; int ranX = Random.Range(-1, 2); int ranY = Random.Range(2, 4); rig.bodyType = RigidbodyType2D.Dynamic; milkItem = _milkItem; sprite.sprite = milkItem.milkSprite; rig.AddForce(new Vector2(ranX, ranY), ForceMode2D.Impulse); }
public void SetMilkItem(MilkItem _item) { if (_item.type == MilkType.SLOW) { isSlowMode = true; slowTime = 0; } else if (_item.type == MilkType.FREZE) { isFrezeMode = true; frezeTime = 0; } else if (_item.type == MilkType.GIANT) { isGiantMode = true; giantTime = 0; } else if (_item.type == MilkType.MONEY) { isMoneyMode = true; moneyTime = 0; } else if (_item.type == MilkType.POWER) { isPowerMode = true; powerTime = 0; } else if (_item.type == MilkType.SHIELD) { isShieldMode = true; shieldTime = 0; } else if (_item.type == MilkType.SPEED) { isSpeedMode = true; speedTime = 0; } }