public ShelfItem CreateObject() { Debug.Assert(prefabShelfItem != null); ShelfItem o = Object.Instantiate(prefabShelfItem).GetComponent <ShelfItem>(); o.SetName(variableName); return(o); }