public void Despawn() { if (Body) { Body.Despawn(); } Body = null; }
public override InteractableItem CreateItem() { PickupableBody body = GetComponent <PickupableBody>(); if (!body) { return(null); } return(new PickupableItem(this, body)); }
public void Spawn(GameObject prefab, Vector3 position) { GameObject instance = GameObject.Instantiate(prefab); instance.transform.position = position; PickupableBody sceneItem = instance.GetComponent <PickupableBody>(); if (sceneItem) { sceneItem.Init(this); } }
public PickupableItem(PickupableSeed seed, PickupableBody body) : base(seed) { Body = body; if (Body) { MainSprite = Body.MainSprite; TopSprite = Body.TopSprite; BottomSprite = Body.BottomSprite; } Icon = seed.Icon; }