코인 드랍 및 먹기(실제 지급x)
This commit is contained in:
parent
7e370da7f0
commit
8110dc549a
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b51ba99f6126d774fb7957f7854279de
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -10,6 +10,7 @@ GameObject:
|
|||
m_Component:
|
||||
- component: {fileID: 3100476459826330930}
|
||||
- component: {fileID: 4893893054232870055}
|
||||
- component: {fileID: 2492904952054004448}
|
||||
m_Layer: 0
|
||||
m_Name: DropItem_Coin
|
||||
m_TagString: Untagged
|
||||
|
|
@ -49,6 +50,28 @@ MonoBehaviour:
|
|||
m_Pierce: 0
|
||||
str_HitEffect:
|
||||
m_ShowTimeOverEffect: 0
|
||||
m_Collider: {fileID: 2492904952054004448}
|
||||
--- !u!65 &2492904952054004448
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6068735123187107113}
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_IsTrigger: 1
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Size: {x: 0.55355626, y: 1, z: 0.12264109}
|
||||
m_Center: {x: -0.005823165, y: 0, z: 0.0038821101}
|
||||
--- !u!1 &8770474071504360176
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -76,7 +99,7 @@ Transform:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8770474071504360176}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0.2, y: 0.2, z: 0.2}
|
||||
m_ConstrainProportionsScale: 0
|
||||
|
|
|
|||
|
|
@ -320,11 +320,54 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: 38f50b30e61fb0341aed3733ef1b8fdd, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
go_Camera: {fileID: 1160234425}
|
||||
volumes:
|
||||
- {fileID: 11400000, guid: ae67e7856b8def24a96cf76c689162b0, type: 2}
|
||||
- {fileID: 11400000, guid: 96e4f5994a1f2d948a293a2d5f2bd1b3, type: 2}
|
||||
m_Volume: {fileID: 1160234426}
|
||||
--- !u!1 &1428745900
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1428745901}
|
||||
- component: {fileID: 1428745902}
|
||||
m_Layer: 0
|
||||
m_Name: DropItemInfo
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1428745901
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1428745900}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &1428745902
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1428745900}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 2a9c4fdffa888b84897a97d0bef9fd6d, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &1671388994
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -422,7 +465,6 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: 7ed190b399bd4be4ebc361c911eb9d95, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
go_Camera: {fileID: 0}
|
||||
m_TotalTime: 0
|
||||
WaveMakeGapTime: 0
|
||||
--- !u!4 &2049409408
|
||||
|
|
@ -537,7 +579,6 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: 68bebb0d1512fbc4180d3cae3ab568f1, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
go_Camera: {fileID: 0}
|
||||
--- !u!4 &2120220235
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -638,3 +679,4 @@ SceneRoots:
|
|||
- {fileID: 663358097}
|
||||
- {fileID: 1671388997}
|
||||
- {fileID: 2049409408}
|
||||
- {fileID: 1428745901}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using UnityEngine;
|
|||
public class FairyActor : Actor
|
||||
{
|
||||
EquipmentTableBase m_FairyTableData;
|
||||
GameObject go_finditem;
|
||||
DropItem go_finditem;
|
||||
float SeekTime = 5f, t;
|
||||
|
||||
byte Status = 0; // 0 아이들, 1 캐릭터 뒤로 이동 중, 2 아이템으로 이동 중
|
||||
|
|
@ -44,8 +44,8 @@ public class FairyActor : Actor
|
|||
switch (Status)
|
||||
{
|
||||
case 0: // 대기 중
|
||||
if (go_finditem == null || !go_finditem.activeInHierarchy)
|
||||
go_finditem = InGameInfo.Ins.Get_NearstDropItem(Get_position());
|
||||
if (DSUtil.CheckNull(go_finditem) || !go_finditem.gameObject.activeInHierarchy)
|
||||
go_finditem = DropItemInfo.Ins.Get_NearestDropItem(Get_position());
|
||||
|
||||
if (t > 0f)
|
||||
{
|
||||
|
|
@ -91,12 +91,12 @@ public class FairyActor : Actor
|
|||
}
|
||||
else if (Complete_Destination())
|
||||
{
|
||||
if (go_finditem != null)
|
||||
if (!DSUtil.CheckNull(go_finditem))
|
||||
{
|
||||
if (go_finditem.activeInHierarchy)
|
||||
if (go_finditem.gameObject.activeInHierarchy)
|
||||
{
|
||||
Play_Attack(Random.Range(0, 2), 1f);
|
||||
if (go_finditem.GetComponent<DropItem>().ItemTouch())
|
||||
if (go_finditem.ItemTouch(this))
|
||||
ServerInfo.Ins.m_ServerData.Add_TitleCondition(46, 47); // 칭호 : 요정은 내 친구, 요정은 내 노예
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -399,7 +399,9 @@ public class MobActor : Actor
|
|||
DungeonInfo.Ins.Add_WaveGold(10); // TODO 정인호 : 웨이브 골드
|
||||
}
|
||||
else
|
||||
sdata.Add_Item(2, 100); // TODO 정인호 : 몹 처치 시 골드 즉시 지급(골드 떨구기 필요)
|
||||
{
|
||||
DropItemInfo.Ins.Drop_DropItem(2, m_MonsterAppearData.n_DropGold, Get_position());
|
||||
}
|
||||
sdata.Add_CollectionMobKill(m_MonsterTableData.n_MonsterID);
|
||||
}
|
||||
base.Set_Die();
|
||||
|
|
|
|||
|
|
@ -39,8 +39,6 @@ public class WizardActor : PCActor
|
|||
{
|
||||
if (other.tag.Equals("House"))
|
||||
MyValue.m_RealCamera.Set_InsideBuilding(true);
|
||||
else if (other.tag.Equals("DropItem"))
|
||||
other.GetComponent<DropItem>().ItemTouch();
|
||||
}
|
||||
private void OnTriggerExit(Collider other)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,27 +1,28 @@
|
|||
using CodeStage.AntiCheat.ObscuredTypes;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
public class DropItem : ProjectileBase
|
||||
{
|
||||
eItem m_Item;
|
||||
eItem[] arr_Item = new eItem[] { eItem.Book, eItem.Fairy, eItem.Extra, eItem.Skill, eItem.Necklace, eItem.Pet, eItem.Ring, eItem.Weapon };
|
||||
List<float> list_rate = new List<float> { 0.125f, 0.125f, 0.125f, 0.125f, 0.125f, 0.125f, 0.125f, 0.125f };
|
||||
public Collider m_Collider;
|
||||
|
||||
ObscuredInt _itemid;
|
||||
int m_itemid
|
||||
{
|
||||
get { return _itemid; }
|
||||
set { _itemid = value; _itemid.RandomizeCryptoKey(); }
|
||||
}
|
||||
ObscuredInt _itemamount;
|
||||
int m_itemamount
|
||||
{
|
||||
get { return _itemamount; }
|
||||
set { _itemamount = value; _itemamount.RandomizeCryptoKey(); }
|
||||
}
|
||||
|
||||
bool IsReady;
|
||||
int m_Magnet;
|
||||
float MagnetUpTime = 0f;
|
||||
Vector3 v3_MagnetUP;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
var split = name.Split('_');
|
||||
m_Item = DSUtil.StringToEnum<eItem>(split[1].Replace("(Clone)", ""));
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
switch (m_Magnet)
|
||||
|
|
@ -53,37 +54,21 @@ public class DropItem : ProjectileBase
|
|||
}
|
||||
}
|
||||
|
||||
public override void Set(ProjectileData _data)
|
||||
public void Set(int itemid, int amount, Vector3 startpos)
|
||||
{
|
||||
base.Set(_data);
|
||||
IsReady = false;
|
||||
m_Magnet = 0;
|
||||
gameObject.SetActive(true);
|
||||
m_itemid = itemid;
|
||||
m_itemamount = amount;
|
||||
|
||||
switch (m_Item)
|
||||
switch (m_itemid)
|
||||
{
|
||||
case eItem.Heart:
|
||||
transform.localScale = Vector3.one * 1.5f;
|
||||
break;
|
||||
case eItem.Gem:
|
||||
transform.localScale = Vector3.one * 0.3f;
|
||||
break;
|
||||
case eItem.Gold:
|
||||
transform.localScale = Vector3.one * 2f;
|
||||
StartCoroutine(Co_Rotation_Y());
|
||||
break;
|
||||
case eItem.Food:
|
||||
case eItem.Seed:
|
||||
StartCoroutine(Co_Rotation_Y());
|
||||
break;
|
||||
default:
|
||||
transform.localScale = Vector3.one * 3f;
|
||||
break;
|
||||
case 2: startpos += Vector3.up * 0.25f; break;
|
||||
}
|
||||
|
||||
_data.v3_StartPos = DSUtil.Get_RandomPos_onNavMesh(_data.shooter.Get_position(), 0.5f);
|
||||
m_Collider.enabled = false;
|
||||
StartCoroutine(Co_Move_Split(() =>
|
||||
{
|
||||
IsReady = true;
|
||||
m_Collider.enabled = true;
|
||||
if (m_Magnet == 0)
|
||||
{
|
||||
var sdata = ServerInfo.Ins.m_ServerData;
|
||||
|
|
@ -99,113 +84,34 @@ public class DropItem : ProjectileBase
|
|||
// }
|
||||
//}
|
||||
}
|
||||
}, _data.shooter.Get_Center_position(), _data.v3_StartPos));
|
||||
//StartCoroutine(Co_Off(20f));
|
||||
}, startpos, DSUtil.Get_RandomPos_onNavMesh(startpos, 2f, 3f)));
|
||||
StartCoroutine(Co_Rotation_Y());
|
||||
StartCoroutine(Co_Off(20f));
|
||||
}
|
||||
|
||||
ItemData itemdata = new ItemData { UICardType = eUICardType.GetItem };
|
||||
public bool ItemTouch()
|
||||
public bool ItemTouch(Actor touchActor)
|
||||
{
|
||||
if (gameObject.activeInHierarchy)
|
||||
if (gameObject.activeInHierarchy && touchActor)
|
||||
{
|
||||
var data = m_ProjecTileData.shooter.Get_MonsterStatTableData();
|
||||
var sdata = ServerInfo.Ins.m_ServerData;
|
||||
var statdata = MyValue.MyPC.Get_StatInfo();
|
||||
|
||||
switch (m_Item)
|
||||
if (touchActor.IsRole(eRole.PC) || touchActor.IsRole(eRole.Fairy))
|
||||
{
|
||||
case eItem.Heart:
|
||||
var heal = 0.05f;
|
||||
ActorInfo.Ins.All_Heal(heal);
|
||||
MessageInfo.Ins.Add_Log(110, heal * 100);
|
||||
break;
|
||||
case eItem.Gem:
|
||||
itemdata.ItemType = m_Item;
|
||||
itemdata.Set_ID(0);
|
||||
itemdata.Amount = Random.Range(1, 4);
|
||||
break;
|
||||
case eItem.Gold: // 확정 드랍으로 변경됨
|
||||
//itemdata.ItemType = m_Item;
|
||||
//itemdata.Set_ID(0);
|
||||
//itemdata.Amount = data.dic_amount[m_Item] + data.dic_amount[m_Item] * statdata.Get_Stat(eStat.GoldDrop);
|
||||
//GameUI.Ins.IngameUI.m_StageResult.Add_Gold(itemdata.Amount);
|
||||
//MessageInfo.Ins.Add_Log(DSUtil.Format("금화 {0:N0}개 획득", itemdata.Amount));
|
||||
break;
|
||||
case eItem.MobDropItem:
|
||||
//if (InGameInfo.Ins.Get_CurStageData().Chapter == 12) // 책 안 나오게
|
||||
// itemdata.ItemType = arr_Item[Random.Range(1, arr_Item.Length)];
|
||||
//else
|
||||
itemdata.ItemType = arr_Item[DSUtil.Get_RandomIndex(list_rate)];
|
||||
itemdata.Amount = 1;
|
||||
if (itemdata.ItemType == eItem.Book)
|
||||
{
|
||||
// TODO 정인호 : 책 페이지 나오는 거 테이블 설정 필요
|
||||
//var pageid = table_bookpage.Ins.Get_RandomPageID(data.dic_itemid[itemdata.ItemType]);
|
||||
//itemdata.ItemType = eItem.Page;
|
||||
//itemdata.Set_ID(pageid);
|
||||
}
|
||||
//else
|
||||
// itemdata.Set_ID(data.dic_itemid[itemdata.ItemType][Random.Range(0, data.dic_itemid[itemdata.ItemType].Count)]);
|
||||
//MessageInfo.Ins.Add_Log(111, MyText.Get_ItemName(itemdata.Get_ID()));
|
||||
break;
|
||||
case eItem.WeaponStone:
|
||||
case eItem.RingStone:
|
||||
case eItem.NeckStone:
|
||||
case eItem.BootsStone:
|
||||
case eItem.FairyStone:
|
||||
itemdata.ItemType = m_Item;
|
||||
itemdata.Set_ID(0);
|
||||
if (data == null) // 광석
|
||||
itemdata.Amount = Math.Truncate(m_ProjecTileData.Amount + m_ProjecTileData.Amount * statdata.Get_Stat(Get_StoneStat(m_Item)));
|
||||
else // 몹
|
||||
{
|
||||
//itemdata.Amount = Math.Truncate(data.dic_amount[m_Item] + data.dic_amount[m_Item] * statdata.Get_Stat(Get_StoneStat(m_Item)));
|
||||
//if (InGameInfo.Ins.Get_CurStageData().Chapter == 103 && m_ProjectTileData.actor_shooter.Get_ID() > 0)
|
||||
// itemdata.Amount *= 10d;
|
||||
}
|
||||
itemdata.Amount = Math.Truncate(itemdata.Amount * Random.Range(0.9f, 1.1f));
|
||||
//MessageInfo.Ins.Add_Log(112, MyText.Get_ItemName(itemdata.Get_ID()), NumberFormatter.FormatNumber(itemdata.Amount));
|
||||
break;
|
||||
case eItem.Food: case eItem.Seed:
|
||||
//itemdata.ItemType = m_Item;
|
||||
//itemdata.Set_ID(data.dic_itemid[itemdata.ItemType][Random.Range(0, data.dic_itemid[itemdata.ItemType].Count)]);
|
||||
//itemdata.Amount = 1;
|
||||
break;
|
||||
}
|
||||
itemdata.Amount.RandomizeCryptoKey();
|
||||
if (m_Item != eItem.Heart)
|
||||
SmallItemGetUI.Ins.Set(itemdata);
|
||||
var sdata = ServerInfo.Ins.m_ServerData;
|
||||
var statdata = touchActor.Get_StatInfo();
|
||||
|
||||
switch (m_Item)
|
||||
{
|
||||
case eItem.Heart: case eItem.Gold: case eItem.Exp:
|
||||
break;
|
||||
default:
|
||||
InGameInfo.Ins.Add_ObtainItem(itemdata);
|
||||
break;
|
||||
// TODO 정인호 : 아이템 지급 코드 필요 (웨이브와 아닌 경우)
|
||||
|
||||
InGameInfo.Ins.Show_Effect("Effect_GetCoin", transform.position);
|
||||
gameObject.SetActive(false);
|
||||
NewGameUI.Ins.m_GuideQuestUI.Add_GuideQuest(ePurpose.GetDropItem);
|
||||
return true;
|
||||
}
|
||||
InGameInfo.Ins.Show_Effect("ItemTouch", transform.position);
|
||||
gameObject.SetActive(false);
|
||||
NewGameUI.Ins.m_GuideQuestUI.Add_GuideQuest(ePurpose.GetDropItem);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool Get_IsReady() { return IsReady; }
|
||||
|
||||
eStat Get_StoneStat(eItem item)
|
||||
public override bool ProcessCollider(Collider other, bool Off_byHit = true, bool noDmg = false)
|
||||
{
|
||||
// TODO 정인호 : 강화석 드랍 없는 듯?
|
||||
//switch (item)
|
||||
//{
|
||||
// case eItem.WeaponStone: return eStat.WeaponStoneDrop;
|
||||
// case eItem.RingStone: return eStat.RingStoneDrop;
|
||||
// case eItem.NeckStone: return eStat.NeckStoneDrop;
|
||||
// case eItem.BootsStone: return eStat.BootsStoneDrop;
|
||||
// case eItem.FairyStone: return eStat.FairyStoneDrop;
|
||||
//}
|
||||
return eStat.None;
|
||||
return ItemTouch(other.GetComponent<Actor>());
|
||||
}
|
||||
|
||||
IEnumerator Co_Rotation_Y()
|
||||
|
|
@ -215,7 +121,7 @@ public class DropItem : ProjectileBase
|
|||
{
|
||||
t += Time.deltaTime * 20f;
|
||||
t = Mathf.Repeat(t, 359.9f);
|
||||
transform.eulerAngles = new Vector3(90f, t, transform.rotation.eulerAngles.z);
|
||||
transform.eulerAngles = new Vector3(0f, t, 0f);
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,88 @@
|
|||
using System.Collections.Generic;
|
||||
using UnityEngine.ResourceManagement.AsyncOperations;
|
||||
using UnityEngine;
|
||||
|
||||
public class DropItemInfo : MonoBehaviourSingletonTemplate<DropItemInfo>
|
||||
{
|
||||
Dictionary<int, List<DropItem>> dic_dropitem = new Dictionary<int, List<DropItem>>();
|
||||
Dictionary<int, AsyncOperationHandle<GameObject>> dic_Handle = new Dictionary<int, AsyncOperationHandle<GameObject>>();
|
||||
Dictionary<int, string> dic_addrPath = new Dictionary<int, string>
|
||||
{
|
||||
{ 2, "Assets/Res_Addr/Obj/DropItem_Coin.prefab" },
|
||||
};
|
||||
List<DropItem> list_dropitems = new List<DropItem>();
|
||||
|
||||
private void Start()
|
||||
{
|
||||
AddrResourceMgr.Ins.LoadObject<GameObject>(dic_addrPath[2], handle =>
|
||||
{
|
||||
if (handle.IsDone && handle.Status == AsyncOperationStatus.Succeeded)
|
||||
{
|
||||
dic_Handle.Add(2, handle);
|
||||
dic_dropitem.Add(2, new List<DropItem> { DSUtil.Get_Clone<DropItem>(dic_Handle[2].Result, transform) });
|
||||
for (int i = 0; i < 29; i++)
|
||||
Make_DropItem(2);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
DropItem Make_DropItem(int id)
|
||||
{
|
||||
var dropitem = DSUtil.Get_Clone<DropItem>(dic_Handle[id].Result, transform);
|
||||
dropitem.gameObject.SetActive(false);
|
||||
dic_dropitem[id].Add(dropitem);
|
||||
return dropitem;
|
||||
}
|
||||
|
||||
public void Drop_DropItem(int itemid, int amount, Vector3 startpos)
|
||||
{
|
||||
if (dic_dropitem.ContainsKey(itemid))
|
||||
{
|
||||
for (int i = 0; i < dic_dropitem[itemid].Count; i++)
|
||||
{
|
||||
var temp = dic_dropitem[itemid][i];
|
||||
if (!temp.gameObject.activeInHierarchy)
|
||||
{
|
||||
temp.Set(itemid, amount, startpos);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var dropitem = Make_DropItem(itemid);
|
||||
dropitem.Set(itemid, amount, startpos);
|
||||
}
|
||||
}
|
||||
|
||||
public List<DropItem> Get_DropItems()
|
||||
{
|
||||
list_dropitems.Clear();
|
||||
foreach (var itemList in dic_dropitem.Values)
|
||||
{
|
||||
list_dropitems.AddRange(itemList.FindAll(item => item.gameObject.activeInHierarchy));
|
||||
}
|
||||
return list_dropitems;
|
||||
}
|
||||
|
||||
public DropItem Get_NearestDropItem(Vector3 _pos)
|
||||
{
|
||||
var items = Get_DropItems();
|
||||
if (items.Count == 0)
|
||||
return null;
|
||||
|
||||
DropItem nearestItem = items[0];
|
||||
float minDistance = Vector3.Distance(_pos, nearestItem.transform.position);
|
||||
|
||||
foreach (var item in items)
|
||||
{
|
||||
float distance = Vector3.Distance(_pos, item.transform.position);
|
||||
if (distance < minDistance)
|
||||
{
|
||||
minDistance = distance;
|
||||
nearestItem = item;
|
||||
}
|
||||
}
|
||||
return nearestItem;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2a9c4fdffa888b84897a97d0bef9fd6d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -394,40 +394,6 @@ public partial class InGameInfo : MyCoroutine
|
|||
|
||||
public void Set_TimeScale(float _scale, float _delay) { Set_Coroutine(() => { Time.timeScale = _scale; }, _delay); }
|
||||
|
||||
public List<GameObject> Get_DropItems()
|
||||
{
|
||||
list_dropitems.Clear();
|
||||
foreach (var item in dic_Skill)
|
||||
{
|
||||
if (DSUtil.IsDropItem(item.Key))
|
||||
{
|
||||
for (int i = 0; i < item.Value.Count; i++)
|
||||
{
|
||||
if (item.Value[i].activeInHierarchy && item.Value[i].GetComponent<DropItem>().Get_IsReady())
|
||||
list_dropitems.Add(item.Value[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return list_dropitems;
|
||||
}
|
||||
public GameObject Get_NearstDropItem(Vector3 _pos)
|
||||
{
|
||||
var items = Get_DropItems();
|
||||
if (items.Count > 0)
|
||||
{
|
||||
GameObject temp = items[0];
|
||||
for (int i = 1; i < items.Count; i++)
|
||||
{
|
||||
float dist_a = Vector3.Distance(_pos, temp.transform.position);
|
||||
float dist_b = Vector3.Distance(_pos, items[i].transform.position);
|
||||
if (dist_b < dist_a)
|
||||
temp = items[i];
|
||||
}
|
||||
|
||||
return temp;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
#region 인게임 제어 (게임 시작, 게임 재시작, 보스 만남, 보스 킬, 보스에게 짐, 컨텐츠 종료 조건)
|
||||
public void Clear_Chapter()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -888,11 +888,6 @@ public static partial class DSUtil
|
|||
return new Vector3(float.Parse(s[0]), float.Parse(s[1]), float.Parse(s[2]));
|
||||
}
|
||||
|
||||
public static bool IsDropItem(eEffect effect)
|
||||
{
|
||||
return effect >= eEffect.DropItem_Heart && effect < eEffect.Max;
|
||||
}
|
||||
|
||||
public static string Get_GradeSpriteName(eItemGrade _Grade)
|
||||
{
|
||||
return Format("grade{0}", (int)_Grade);
|
||||
|
|
|
|||
Loading…
Reference in New Issue