示例#1
0
 private void UpdateNextDisplay()
 {
     DestroyAllChild(NextArea);
     int[] nextSeq = game.GetNextSeq();
     for (int i = 0; i < MAX_NEXT; i++)
     {
         int     id     = nextSeq[i];
         Vector3 offset = Vector3.zero;
         if (id == Mino.NameToId("J"))
         {
             offset.x = -0.5f;
         }
         else if (id == Mino.NameToId("I"))
         {
             offset.x = 0.5f;
         }
         else if (id == Mino.NameToId("O"))
         {
             offset.y = 0.5f;
         }
         DisplayUtils.InstChild(Minoes[nextSeq[i] - 1], new Vector3(0, -2.5f * i, 0) + offset, NextArea, 0.8f);
     }
 }
示例#2
0
    public void ApplyNextSeq()
    {
        int  len = nextSeq.Length;
        Mino m   = new Mino();
        bool ValidNextSequence = true;

        Debug.Log(nextSeq);
        foreach (char c in nextSeq)
        {
            if (Mino.NameToId(c.ToString()) == -1)
            {
                ValidNextSequence = false;
            }
        }
        ;
        if (ValidNextSequence)
        {
            nextQueue.Clear();
            foreach (char c in nextSeq)
            {
                nextQueue.Enqueue(m.GetIdInt());
            }
        }
    }