private void FillOffset(List <Vector3> lootOffset, int count, Vector3 dir, LOOTTYPE shape) { shape = LOOTTYPE.INCIRCLE; count -= lootOffset.Count; if (shape == LOOTTYPE.RANDOM) { shape = (LOOTTYPE)UnityEngine.Random.Range(2, (int)(LOOTTYPE.MAX - 1)); } if (shape == LOOTTYPE.GRID) { FillOffsetGrid(lootOffset, count, 3, 2); } else if (shape == LOOTTYPE.ARC) { FillOffsetArc(lootOffset, count, dir, 3, 45); } else if (shape == LOOTTYPE.LINE) { FillOffsetLine(lootOffset, count, dir, 2.5f, 1); } else if (shape == LOOTTYPE.CIRCLE) { FillOffsetCircle(lootOffset, count, 3); } else if (shape == LOOTTYPE.INCIRCLE) { FillOffsetInCircle(lootOffset, count, 3); } else { FillOffsetVerticle(lootOffset, count); } }
public void LootList(Vector3 pos, Vector3 dir, LOOTTYPE shape, List <LootObjData> dataList, List <Vector3> lootOffest) { if (dataList.Count == 0) { return; } if (lootOffest == null) { lootOffest = new List <Vector3>(); } if (lootOffest.Count < dataList.Count) { FillOffset(lootOffest, dataList.Count, dir, shape); } bool haveHighItem = false; bool haveMoney = false; bool haveNormalItem = false; for (int i = 0; i < dataList.Count; i++) { Debug.Log("Loot object [" + dataList[i]._lootId + "] from enemy"); StartLootOneMove(dataList[i], pos, lootOffest[i]); ItemData itemData = getItemData(dataList[i]._lootId); if (itemData != null) { if (itemData.rareLevel >= 2) { haveHighItem = true; } if (itemData.id == "money") { haveMoney = true; } else { haveNormalItem = true; } } } if (dataList.Count > 0) { StartCoroutine(DelayPlaySound(haveNormalItem, haveHighItem, haveMoney, _time)); } }
public void Loot(List <LootObjData> dataList, Vector3 pos, Vector3 dir, LOOTTYPE shape, List <Vector3> lootOffest) { LootList(pos, dir, shape, dataList, lootOffest); }