Exemplo n.º 1
0
 public string Condition(ContitionContainer c)
 {
     conditionCounter++;
     if (!letterMatrix.ignore)
     {
         if (!letterMatrix.currentBlockBuilded)
         {
             if (conditionsMadeCounter >= conditionCounter)
             {
                 letterMatrix.currentBlock     = null;
                 letterMatrix.specialCondition = true;
                 letterMatrix.currentBlockIndex++;
                 letterMatrix.DestroyBlockAt(0);
             }
             else
             {
                 letterMatrix.specialCondition = false;
                 currentConditionContainer     = c;
             }
         }
     }
     if (conditionsMadeCounter < conditionCounter)
     {
         return("");
     }
     else
     {
         return(conditionsMade[conditionCounter - 1]);
     }
 }
Exemplo n.º 2
0
            public void Shift(float x)
            {
                Line line = FindNearestLine();

                if (line == null)
                {
                    return;
                }

                if (line.lastLetterTransit != null && line.lastLetterTransit.isReached)
                {
                    foreach (GameObject letter in line.letters)
                    {
                        float newX = letter.transform.localPosition.x + x;
                        float newY = letter.transform.localPosition.y;
                        float newZ = matrix.npc.F(newX);
                        letter.transform.localPosition = new Vector3(newX, newY, newZ);
                        letter.transform.localRotation = Quaternion.LookRotation(letter.transform.localPosition - matrix.npc.orientationTransform.localPosition);
                    }
                    Transform tf = line.letters[0].transform;
                    Transform tl = line.letters[line.letters.Count - 1].transform;
                    if (tf.localPosition.x < -matrix.npc.skipDistance || tl.localPosition.x > matrix.npc.skipDistance)
                    {
                        int lineIndex;
                        if (line.isOption)
                        {
                            matrix.optionChoises.Add(line.stringLetters);
                            matrix.choisesMadeCounter++;
                            lineIndex = lines.Count - 1;
                        }
                        else
                        {
                            lineIndex = lines.IndexOf(line);
                        }
                        for (int i = 0; i <= lineIndex; i++)
                        {
                            DestroyLineAt(0);
                        }
                        if (lines.Count == 0)
                        {
                            matrix.currentBlockDone = true;
                            matrix.DestroyBlockAt(0);
                        }
                    }
                }
            }