예제 #1
0
        void OnWriterState(Writer writer, WriterState writerState)
        {
            if (writerState == WriterState.Start && correctTagCount != 0)
            {
                IntegrationTest.Fail();
            }
            if (writerState == WriterState.Pause && correctTagCount != 2)
            {
                IntegrationTest.Fail();
            }
            if (writerState == WriterState.Resume && correctTagCount != 2)
            {
                IntegrationTest.Fail();
            }
            else if (writerState == WriterState.End && correctTagCount != 4)
            {
                IntegrationTest.Fail();
            }

            if (writerState == WriterState.End)
            {
                if (!receivedInput)
                {
                    IntegrationTest.Fail();
                }

                if (glyphCount != 6)
                {
                    IntegrationTest.Fail();
                }

                IntegrationTest.Pass();
            }
        }
예제 #2
0
파일: SayDialog.cs 프로젝트: snozbot/fungus
		protected Writer GetWriter()
        {
            if (writer != null)
            {
                return writer;
            }

            writer = GetComponent<Writer>();
            if (writer == null)
            {
                writer = gameObject.AddComponent<Writer>();
            }

            return writer;
        }
예제 #3
0
 void OnTextTagToken(Writer writer, TextTagToken token, int index, int maxIndex)
 {
     if (index == 0 && token.type == TokenType.BoldStart)
     {
         correctTagCount++;
     }
     else if (index == 1 && token.type == TokenType.Wait)
     {
         correctTagCount++;
     }
     else if (index == 2 && token.type == TokenType.Words)
     {
         correctTagCount++;
     }
     else if (index == 3 && token.type == TokenType.BoldEnd)
     {
         correctTagCount++;
     }
 }
예제 #4
0
 void OnWriterGlyph(Writer writer)
 {
     glyphCount++;
 }
예제 #5
0
 void OnWriterInput(Writer writer)
 {
     receivedInput = true;
 }
 protected virtual void Awake()
 {
     writer = GetComponent<Writer>();
 }