Exemplo n.º 1
0
 private Input2.TouchData get_touch_data(int id)
 {
     Input2.TouchData[] touch_data = this.m_touch_data;
     Input2.TouchData   result;
     for (int i = 0; i < touch_data.Length; i++)
     {
         Input2.TouchData touchData = touch_data[i];
         if (touchData.m_id == id)
         {
             result = touchData;
             return(result);
         }
     }
     touch_data = this.m_touch_data;
     for (int i = 0; i < touch_data.Length; i++)
     {
         Input2.TouchData touchData = touch_data[i];
         if (touchData.m_id == -1)
         {
             touchData.m_id = id;
             result         = touchData;
             return(result);
         }
     }
     result = null;
     return(result);
 }
Exemplo n.º 2
0
            internal void frame_update()
            {
                List <Sce.Pss.Core.Input.TouchData> list = this.m_external_data;

                if (!this.m_external_control)
                {
                    list = Sce.Pss.Core.Input.Touch.GetData(this.m_device_index);
                }
                Common.Assert(list != null);
                Input2.TouchData[] touch_data = this.m_touch_data;
                for (int i = 0; i < touch_data.Length; i++)
                {
                    Input2.TouchData touchData = touch_data[i];
                    touchData.m_visited = false;
                }
                this.m_id_set.Clear();
                foreach (Sce.Pss.Core.Input.TouchData current in list)
                {
                    this.m_id_set.Add(current.ID);
                }
                foreach (Sce.Pss.Core.Input.TouchData current in list)
                {
                    Input2.TouchData touchData = this.get_touch_data(current.ID);
                    touchData.m_visited = true;
                    Vector2 pos  = touchData.Pos;
                    bool    down = false;
                    if (!current.Skip)
                    {
                        pos  = new Vector2(current.X, -current.Y) * 2f;
                        down = true;
                    }
                    touchData.frame_update(pos, down);
                }
                touch_data = this.m_touch_data;
                for (int i = 0; i < touch_data.Length; i++)
                {
                    Input2.TouchData touchData = touch_data[i];
                    if (!touchData.m_visited)
                    {
                        touchData.m_id = -1;
                        touchData.frame_update(touchData.Pos, false);
                    }
                }
            }