コード例 #1
0
 private void UpdateTaskPanel(DestinationScriptable destination)
 {
     if (!destination)
     {
         return;
     }
     TaskPanel.Instance.GenerateInstance(destination);
 }
コード例 #2
0
    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);
    }