コード例 #1
0
    public static InputBase GetInput(InputManager.eInputSource eInputType)
    {
        InputBase oInputImplementation = null;

        switch (eInputType)
        {
        case InputManager.eInputSource.PLAYER:
            //if(Input.touchSupported)
        {
            oInputImplementation = new InputPlayerTouchContinuous();
        }

            /*else
             * {
             *      oInputImplementation = new InputMouse();
             * }*/
            break;

        case InputManager.eInputSource.AI:
            Debug.LogWarning("AI input not yet available - Replay fallback");
            oInputImplementation = new InputReplay();
            break;

        case InputManager.eInputSource.NETWORK:
            Debug.LogWarning("AI network not yet available - Replay fallback");
            oInputImplementation = new InputReplay();
            break;

        case InputManager.eInputSource.REPLAY:
            oInputImplementation = new InputReplay();
            break;
        }
        ;

        if (oInputImplementation == null)
        {
            Debug.LogError("Input implementation not available!");
        }

        return(oInputImplementation);
    }
コード例 #2
0
    public static InputBase GetInput(InputManager.eInputSource eInputType)
    {
        InputBase oInputImplementation = null;

        switch(eInputType)
        {
        case InputManager.eInputSource.PLAYER:
            if(Input.touchSupported)
            {
                oInputImplementation = new InputPlayerTouchContinuous();
            }
            else
            {
                oInputImplementation = new InputMouse();
            }
            break;
        case InputManager.eInputSource.AI:
            Debug.LogWarning("AI input not yet available - Replay fallback");
            oInputImplementation = new InputReplay();
            break;
        case InputManager.eInputSource.NETWORK:
            Debug.LogWarning("AI network not yet available - Replay fallback");
            oInputImplementation = new InputReplay();
            break;
        case InputManager.eInputSource.REPLAY:
            oInputImplementation = new InputReplay();
            break;
        };

        if(oInputImplementation == null)
        {
            Debug.LogError("Input implementation not available!");
        }

        return oInputImplementation;
    }