Пример #1
0
    private void AfterReceiveInput()
    {
        // 执行注册的输入回调
        _thisFrameMappedInputList = _inputMapper.GetMappedInputInThisFrame();
        for (int i = 0; i < _thisFrameMappedInputList.Count; i++)
        {
            InputInfo tInfo = _thisFrameMappedInputList[i];
            if (!IsKeyAccessable(tInfo.virtualKey))
            {
                Debug.Log($"{tInfo.virtualKey} 当前被禁用!");
                continue;
            }
            switch (tInfo.inputType)
            {
            case EInputType.Action:
                if (actionInputEventDic.ContainsKey(tInfo.virtualKey))
                {
                    actionInputEventDic[tInfo.virtualKey]?.Invoke(tInfo);
                }
                break;

            case EInputType.State:
                if (stateInputEventDic.ContainsKey(tInfo.virtualKey))
                {
                    stateInputEventDic[tInfo.virtualKey]?.Invoke(tInfo);
                }
                break;
            }
            //--For debug
            if (showDebugInfo)
            {
                Debug.Log(tInfo.ToString());
            }
        }
    }
Пример #2
0
 public override string ToString()
 {
     return(string.Format(
                "{0}({1}\n{2}\n{3}\n{4}, {5}, {6}, {7}",
                nameof(PerformanceReport),
                _created,
                _deviceInfo.ToString(),
                _inputInfo.ToString(),
                "Total: " + _total.Count + " elements",
                "Shader: " + _shader.Count + " elements",
                "Buffer: " + _buffer.Count + " elements",
                "IO: " + _io.Count + " elements"
                ));
 }