コード例 #1
0
    protected override void HandleMessage(byte[] bytes)
    {
        var msg = Packet.Deserialize <Message>(bytes);

        switch (msg.action)
        {
        case Action.ShowInstructions:
            ShowInstructions(msg.level);
            break;

        case Action.StartTrial:
            StartTrial(msg);
            break;

        case Action.NextVideo:
            NextVideo(msg);
            break;

        case Action.GiveAnswer:
            ProcessAnswer(msg);
            break;

        case Action.NextTest:
            NextTest(msg);
            break;

        case Action.ShowAnswerImage:
            UpdateUIState(Visibility.DuringResponsePeriod);
            ShowAnswerImage(msg);
            break;

        case Action.StopVideo:
            videoPlayer.gameObject.SetActive(true);
            videoPlayer.clip = null;
            videoPlayer.Stop();

            DelayedAction.CancelAllActions(this);
            ShowInstructions(state.trialLevel);
            break;
        }
    }
コード例 #2
0
 protected override void HandleHide()
 {
     DelayedAction.CancelAllActions(this);
 }