public ISavableItem CaptureItem() { ISavableItem s = new ISavableItem(); s.euler_y = trans.eulerAngles.y; s.name = "item_" + indentification; s.position = trans.position; s.id = indentification; return(s); }
public static void InstantiateItem(ISavableItem item) { GameObject prefab = (GameObject)Resources.Load("Prefabs/ItemObject"); GameObject spawned = (GameObject)Instantiate(prefab); IItemObject io = spawned.GetComponent <IItemObject> (); io.indentification = item.id; io.SetWithID(); io.trans.position = item.position; io.trans.eulerAngles = Vector3.up * item.euler_y; }