Пример #1
0
 public void changeVolume(triggerColor.color key)
 {
     if (!isLock && source)
     {
         if (key == triggerColor.color.YELLOW)
         {
             if (source.volume < 1)
             {
                 source.volume += 0.1f;
             }
         }
         else if (key == triggerColor.color.PINK)
         {
             if (source.volume > 0)
             {
                 source.volume -= 0.1f;
             }
         }
         else if (key == triggerColor.color.RED)
         {
             if (source.isPlaying)
             {
                 source.Pause();
             }
             else
             {
                 source.UnPause();
             }
         }
     }
 }
Пример #2
0
 public void increasePwd(triggerColor.color key)
 {
     if (!isOn || !isLock || indexPwd == 5)
     {
         return;
     }
     pwd.Add(key);
     if (indexPwd == 4)
     {
         if (pwd[0] == triggerColor.color.GREEN &&
             pwd[1] == triggerColor.color.PINK &&
             pwd[2] == triggerColor.color.BLUE &&
             pwd[3] == triggerColor.color.RED)
         {
             screen.material = screenOk;
             isLock          = false;
         }
         else
         {
             screen.material = screenFail;
         }
     }
     else
     {
         indexPwd++;
     }
 }
Пример #3
0
    public void changeVideo(triggerColor.color key)
    {
        if (!isLock && player)
        {
            float framerate = player.frameRate;
            float tojump    = framerate * 5;

            if (key == triggerColor.color.PINK)
            {
                if (source.volume > 0)
                {
                    source.volume -= 0.1f;
                }
            }
            else if (key == triggerColor.color.YELLOW)
            {
                if (source.volume < 0)
                {
                    source.volume += 0.1f;
                }
            }
            else if (key == triggerColor.color.RED)
            {
                if (player.isPlaying)
                {
                    player.Pause();
                }
                else
                {
                    player.Play();
                }
            }
            else if (key == triggerColor.color.BLUE && (player.frame - (long)tojump > 0))
            {
                player.frame -= (long)tojump;
            }
            else if (key == triggerColor.color.GREY && ((ulong)(player.frame + (long)tojump) < player.frameCount))
            {
                player.frame += (long)tojump;
            }
            else if (key == triggerColor.color.GREEN)
            {
                if (!source.mute)
                {
                    source.mute = true;
                }
                else
                {
                    source.mute = false;
                }
            }
        }
    }