コード例 #1
0
ファイル: WaitingManager.cs プロジェクト: katplee/jam-siesta
 public void SetQueueDestination(CustomerController caller)
 {
     foreach (Transform node in transform)
     {
         CustomerNode customerNode = null;
         if (node.TryGetComponent(out customerNode))
         {
             bool target = customerNode.GetOccupant() == caller.gameObject;
             if (target)
             {
                 return;
             }
         }
         customerNode.Queue(caller);
     }
 }
コード例 #2
0
    public Transform GetHighestAvailableNode(CustomerController caller)
    {
        Transform lastNode = null;

        foreach (Transform node in transform)
        {
            CustomerNode customerNode = null;
            if (node.TryGetComponent(out customerNode))
            {
                bool occupied = customerNode.IsOccupied();
                if (!occupied)
                {
                    return(node);
                }
            }
            customerNode.Queue(caller);
            lastNode = node;
        }

        //if there are no more nodes available in the paying line, the last one will be returned
        return(lastNode);
    }