Exemplo n.º 1
0
        static void OnMessage(BaseMessage bm)
        {
            switch (bm.msg)
            {
            case LocalMsg.OnOpen:
                Console.WriteLine("Connection Open");
                //ApiTest.SetBackground();
                //ApiTest.NextExpression();
                ApiTest.RegisterModelEventListener();
                //ApiTest.SetPosition();
                ApiTest.StartMotion(0, "tap_head");
                //ApiTest.StartMotion(1, "motions/haru_normal_01.mtn");
                break;

            case LocalMsg.OnError:
            case LocalMsg.OnClose:
                Environment.Exit(0);
                break;

            case Msg.OnModelEvent:
                ModelEvent evt = bm.GetData <ModelEvent>();
                if (evt != null)
                {
                    Console.WriteLine(evt.ToString());
                }

                ApiTest.UnregisterModelEventListener();
                break;
            }
        }