Example #1
0
    // Update is called once per frame
    void Update()
    {
        if (animator.GetFloat("velocidade") > 0)
        {
            meuOlho = estadoOlho.aberto;
        }
        switch (meuOlho)
        {
        case estadoOlho.fechar:
            procedimentoFechar(piscar);
            break;

        case estadoOlho.impacto:
            procedimentoFechar(olhosDeImpacto);
            break;

        case estadoOlho.piscar:
            procedimentoPiscar();
            break;

        case estadoOlho.morto:
            procedimentoFechar(olhosDeMorto);
            break;

        case estadoOlho.aberto:
            if (skinned.materials[materialDosOlhos].mainTextureOffset != piscar[0])
            {
                skinned.materials[materialDosOlhos].mainTextureOffset = piscar[0];
            }
            break;
        }
    }
Example #2
0
    void abrirOlho()
    {
        meuOlho = estadoOlho.piscar;

        /*
           Esse tempo aparentemente maluco e para aproveitar o procedimento de Piscar
            nesse tempo os olhos começam a abrir no procedimento de Piscar
         */
        tempoDosOlhos=piscar.Length*tempoDePiscada+tempoFechadoNoPiscar;
    }
Example #3
0
    void abrirOlho()
    {
        meuOlho = estadoOlho.piscar;

        /*
         * Esse tempo aparentemente maluco e para aproveitar o procedimento de Piscar
         *      nesse tempo os olhos começam a abrir no procedimento de Piscar
         */
        tempoDosOlhos = piscar.Length * tempoDePiscada + tempoFechadoNoPiscar;
    }
Example #4
0
 void procedimentoPiscar()
 {
     if (tempoDosOlhos <= piscar.Length * tempoDePiscada + tempoFechadoNoPiscar)
     {
         procedimentoFechar(piscar);
     }
     else if (tempoDosOlhos >= piscar.Length * tempoDePiscada + tempoFechadoNoPiscar
              &&
              tempoDosOlhos < 2 * piscar.Length + tempoFechadoNoPiscar)
     {
         procedimentoAbrir();
     }
     else
     {
         meuOlho = estadoOlho.aberto;
     }
 }
Example #5
0
 void piscadelas()
 {
     meuOlho = estadoOlho.piscar;
     tempoDosOlhos = 0;
 }
Example #6
0
 void olhoImpacto()
 {
     meuOlho = estadoOlho.impacto;
     tempoDosOlhos = 0;
 }
Example #7
0
 void olhoDeMorto()
 {
     meuOlho = estadoOlho.morto;
     tempoDosOlhos = 0;
 }
Example #8
0
 void fecharOlho()
 {
     meuOlho = estadoOlho.fechar;
     tempoDosOlhos = 0;
 }
Example #9
0
 // Update is called once per frame
 void Update()
 {
     if(animator.GetFloat("velocidade")>0)
         meuOlho = estadoOlho.aberto;
     switch(meuOlho)
     {
     case estadoOlho.fechar:
         procedimentoFechar(piscar);
     break;
     case estadoOlho.impacto:
         procedimentoFechar(olhosDeImpacto);
     break;
     case estadoOlho.piscar:
         procedimentoPiscar();
     break;
     case estadoOlho.morto:
         procedimentoFechar(olhosDeMorto);
     break;
     case estadoOlho.aberto:
         if(skinned.materials[materialDosOlhos].mainTextureOffset != piscar[0])
             skinned.materials[materialDosOlhos].mainTextureOffset = piscar[0];
     break;
     }
 }
Example #10
0
 void procedimentoPiscar()
 {
     if(tempoDosOlhos<=piscar.Length*tempoDePiscada+tempoFechadoNoPiscar)
     {
         procedimentoFechar(piscar);
     }else if(tempoDosOlhos>=piscar.Length*tempoDePiscada+tempoFechadoNoPiscar
              &&
              tempoDosOlhos<2*piscar.Length+tempoFechadoNoPiscar)
     {
         procedimentoAbrir();
     }else
     {
         meuOlho = estadoOlho.aberto;
     }
 }
Example #11
0
 void piscadelas()
 {
     meuOlho       = estadoOlho.piscar;
     tempoDosOlhos = 0;
 }
Example #12
0
 void olhoImpacto()
 {
     meuOlho       = estadoOlho.impacto;
     tempoDosOlhos = 0;
 }
Example #13
0
 void olhoDeMorto()
 {
     meuOlho       = estadoOlho.morto;
     tempoDosOlhos = 0;
 }
Example #14
0
 void fecharOlho()
 {
     meuOlho       = estadoOlho.fechar;
     tempoDosOlhos = 0;
 }