Ejemplo n.º 1
0
    public void Update(float delta)
    {
        _data.Clear();

        if (Input.GetKey(_leftkey))
        {
            _data.Press(InputData.KeyState.Left);
        }
        if (Input.GetKey(_rightkey))
        {
            _data.Press(InputData.KeyState.Right);
        }
        if (Input.GetKey(_upkey))
        {
            _data.Press(InputData.KeyState.Up);
        }
        if (Input.GetKey(_downkey))
        {
            _data.Press(InputData.KeyState.Down);
        }

        if (Input.GetKey(_enterkey))
        {
            _data.Press(InputData.KeyState.Enter);
        }
    }
Ejemplo n.º 2
0
 public void Dispose()
 {
     InputData?.Clear();
     InputData     = null;
     EncryptionKey = null;
     Secret        = null;
     SecretProperties?.Clear();
     SecretProperties = null;
 }
Ejemplo n.º 3
0
    private void RunLogicUpdate(float logicDeltaTime)
    {
        foreach (var item in controllers)
        {
            item.LogicUpdate(logicDeltaTime);
        }

        //更新物理
        Physics.Simulate(logicDeltaTime);

        //清理输入
        InputData.Clear();
    }
Ejemplo n.º 4
0
        static void RESETINPUTMANAGER()
        {
            InputData.Clear();
            FieldInfo[] x = typeof(Keys).GetFields();
            Debug.Log(x.Length);

            foreach (FieldInfo m in x)
            {
                Debug.Log(m.FieldType.ToString());
                if (m.FieldType == typeof(KEY_INFO))
                {
                    InputData.ADD((KEY_INFO)(object)m.GetValue(m));                                  //mをobjectにキャストできない?
                }
                if (m.FieldType == typeof(AXISINFO))
                {
                    InputData.ADD((AXISINFO)(object)m.GetValue(m));                                  //mをobjectにキャストできない?
                }
            }

            new InputManagerGenerator(InputData.axis.ToArray());
        }
Ejemplo n.º 5
0
 // Resets input data for the next FixedUpdate step.
 // To be called after the input data is sent out.
 public void Clear()
 {
     inputData.Clear();
 }
Ejemplo n.º 6
0
 //Clear Data field button
 private void Clear_Click(object sender, EventArgs e)
 {
     InputData.Clear();
 }