Пример #1
0
    public static InputBase GetInput()
    {
        InputBase oInputImplementation = null;

        if (Input.touchSupported)
        {
            oInputImplementation = new InputPlayerTouch();
        }
        else
        {
            oInputImplementation = new InputMouse();
        }

        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 InputPlayerTouch();
            }
            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);
    }
Пример #3
0
	public static InputBase GetInput(InputManager.eInputSource eInputType)
	{
		InputBase oInputImplementation = null;

		switch(eInputType)
		{
		case InputManager.eInputSource.PLAYER:
			if(Input.touchSupported)
			{
				oInputImplementation = new InputPlayerTouch();
			}
			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;
	}