コード例 #1
0
    public GameObject get_active_flask()
    {
        StackSlotController controller = flaskSlots[activeSlot].GetComponent <StackSlotController>();

        GameObject tmp = controller.flask;

        controller.flask = null;
        return(tmp);
    }
コード例 #2
0
 // Update is called once per frame
 void Update()
 {
     for (int i = 0; i < flaskSlots.Length; i++)
     {
         StackSlotController stackSlot = flaskSlots[i].GetComponent <StackSlotController>();
         if (stackSlot.isEmpty())
         {
             stackSlot.flask = pull_flask();
             if (stackSlot.flask != null)
             {
                 stackSlot.flask.transform.position = stackSlot.transform.position;
                 stackSlot.flask.transform.SetParent(stackSlot.transform);
             }
         }
     }
 }