public virtual Item Init(ItemData item) { foreach (Item existingInteractiveObject in this.gameObject.GetComponents <Item>()) { Destroy(existingInteractiveObject); } itemId = item.id; initialized = true; Item interactiveObject = item.CreateComponent(this.gameObject); if (Initialized != null) { Initialized.Invoke(interactiveObject); } return(interactiveObject); }