Beispiel #1
0
 public void Done()
 {
     while (activeMessages.Count > 0)
     {
         RespectsFeedElement e = activeMessages[0];
         e.Done();
     }
 }
Beispiel #2
0
    // Update is called once per frame
    private void CreateElements()
    {
        queue = new Queue <RespectsFeedElement>();

        for (int i = 0; i < 10; i++)
        {
            RespectsFeedElement e = Instantiate(prefab, layers[0]);
            e.SetUp(this);
        }
    }
Beispiel #3
0
    public void UseElement(int playerID)
    {
        if (playerID == id)
        {
            return;
        }

        if (queue.Count == 0)
        {
            activeMessages[0].Done();
        }

        RespectsFeedElement e = queue.Dequeue();

        e.transform.SetParent(layers[1]);
        e.transform.SetSiblingIndex(0);

        e.Set(names[playerID], playerColors[playerID]);
        activeMessages.Add(e);
    }
Beispiel #4
0
 public void Add(RespectsFeedElement e)
 {
     queue.Enqueue(e);
     e.transform.SetParent(layers[0]);
     activeMessages.Remove(e);
 }