private void UpdateTaskPanel(DestinationScriptable destination) { if (!destination) { return; } TaskPanel.Instance.GenerateInstance(destination); }
public void GenerateInstance(DestinationScriptable destination) { /* * if (destinationQueue.Count != 0) * { * if (destinationQueue.ElementAt(destinationQueue.Count - 1).name == destination.itemName.GetType().Name) * { * //no consecutive clicking of the same * return; * } * } */ //generate the icon that would appear in the UI Transform transform = Instantiate(slotTemplate, container); //destroy the slot template script Destroy(transform.GetComponent <SlotTemplate>()); //change the game object's name for better understandability transform.name = destination.itemName.GetType().Name; //add the item to the destination queue destinationQueue.Add(transform.gameObject); }