PUN Classic (v1), Bolt는 휴업 모드입니다. Unity2022에 대해서는 PUN 2에서 서포트하지만, 신기능의 추가는 없습니다. 현재 이용중인 고객님의 PUN 및 Bolt 프로젝트는 중단되지 않고, 퍼포먼스나 성능이 떨어지는 일도 없습니다.
앞으로의 새로운 프로젝트에는 Photon Fusion 또는 Quantum을 사용해 주십시오.
Prefab ID
Each prefab which is compiled gets a unique id which is also referred as the "Prefab ID".
Uses of the Prefab ID
The prefab id can be used for instantiating bolt prefabs with their ID.
If you would like to make a drop system for objects in your game
and you want to transmit a prefab in an event then you just add a new property to your event.
Let's say "ItemToDrop" and define him as "Prefab id" and then do something like:
C#
void DropItem()
{
using(var evnt = DropItemEvent.Raise(Bolt.GlobalTargets.Server))
{
evnt.ItemToDrop = Item.DropPrefab.GetCompoment<BoltEntity>().ModifySettings().prefabid;
//ModifySettings - this isnt for editing the entity, its for getting the modifysettings of it.
}
}
override OnEvent(DropItemEvent evnt)
{
BoltNetwork.Instantiate(evnt.ItemToDrop); //Instantiate a prefab with the prefab id that we transmited in the event.
}
Back to top