using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
|
public class ClientDropItemUtility : Singleton<ClientDropItemUtility>
|
{
|
public void Drop(int[] itemIds)
|
{
|
var _center = PlayerDatas.Instance.hero.Pos;
|
int _count = itemIds.Length;
|
int _column = (int)Mathf.Sqrt(_count);
|
int _i = 0;
|
int _j = 0;
|
var _start = _center - Vector3.one * .5f * _column * .5f;
|
int _dropCount = 0;
|
while (_dropCount < _count)
|
{
|
var _dropPos = _start + new Vector3(_j * .5f, 0, _i * .5f);
|
RaycastHit _hit;
|
|
if (!Physics.Raycast(_dropPos + new Vector3(0, 50, 0), Vector3.down, out _hit, 80, LayerUtility.WalkbleMask))
|
{
|
continue;
|
}
|
|
DropItem _item = DropItem.Drop(itemIds[_dropCount], _hit.point, CameraController.Instance.CameraObject);
|
_dropCount += 1;
|
if (_j < _column - 1)
|
{
|
_j = _j + 1;
|
}
|
else
|
{
|
_j = 0;
|
_i = _i + 1;
|
}
|
}
|
}
|
|
public void Drop(int itemID, Vector3 position)
|
{
|
|
}
|
|
private class ClientDropItem
|
{
|
|
}
|
}
|