예제 #1
0
        // ---------------------
        static public GamepadProfile GetProfile(string deviceName)
        {
            BuiltInGamepadProfileBank bank = Inst();

            return((bank == null) ? null : bank.FindProfile(deviceName));
        }
예제 #2
0
        // -------------------------
        static public GamepadProfile GetGenericProfile()
        {
            BuiltInGamepadProfileBank bank = Inst();

            return((bank == null) ? null : bank.GetInternalGenericProfile());
        }
예제 #3
0
        // -----------------------
        static private BuiltInGamepadProfileBank Inst()
        {
            if (mInst != null)
            {
                return(mInst);
            }

            switch (Application.platform)
            {
            case RuntimePlatform.Android:
                mInst = new BuiltInGamepadProfileBankAndroid();
                break;

            case RuntimePlatform.OSXDashboardPlayer:
            case RuntimePlatform.OSXEditor:
            case RuntimePlatform.OSXPlayer:
#if UNITY_PRE_5_4
            case RuntimePlatform.OSXWebPlayer:
#endif
                mInst = new BuiltInGamepadProfileBankOSX();
                break;

            case RuntimePlatform.WindowsEditor:
            case RuntimePlatform.WindowsPlayer:
#if UNITY_PRE_5_0
            case RuntimePlatform.MetroPlayerARM:
            case RuntimePlatform.MetroPlayerX64:
            case RuntimePlatform.MetroPlayerX86:
#else
            case RuntimePlatform.WSAPlayerARM:
            case RuntimePlatform.WSAPlayerX64:
            case RuntimePlatform.WSAPlayerX86:
#endif

#if UNITY_PRE_5_4
            case RuntimePlatform.WindowsWebPlayer:
#endif

                mInst = new BuiltInGamepadProfileBankWin();
                break;

            case RuntimePlatform.IPhonePlayer:
                mInst = new BuiltInGamepadProfileBankIOS();
                break;

            case RuntimePlatform.WP8Player:
                mInst = new BuiltInGamepadProfileBankWP8();
                break;

            case RuntimePlatform.LinuxPlayer:
                mInst = new BuiltInGamepadProfileBankLinux();
                break;

#if !UNITY_PRE_5_0
            case RuntimePlatform.WebGLPlayer:
                mInst = new BuiltInGamepadProfileBankWebGL();
                break;
#endif
            }

            return(mInst);
        }