Ejemplo n.º 1
0
        public MediaReference GetCurrentPlatformMediaReference()
        {
            MediaReference result = null;

                #if (UNITY_EDITOR_OSX && UNITY_IOS) || (!UNITY_EDITOR && UNITY_IOS)
            result = GetPlatformMediaReference(Platform.iOS);
                #elif (UNITY_EDITOR_OSX && UNITY_TVOS) || (!UNITY_EDITOR && UNITY_TVOS)
            result = GetPlatformMediaReference(Platform.tvOS);
                #elif (UNITY_EDITOR_OSX || (!UNITY_EDITOR && UNITY_STANDALONE_OSX))
            result = GetPlatformMediaReference(Platform.MacOSX);
                #elif (UNITY_EDITOR_WIN) || (!UNITY_EDITOR && UNITY_STANDALONE_WIN)
            result = GetPlatformMediaReference(Platform.Windows);
                #elif (!UNITY_EDITOR && UNITY_WSA_10_0)
            result = GetPlatformMediaReference(Platform.WindowsUWP);
                #elif (!UNITY_EDITOR && UNITY_ANDROID)
            result = GetPlatformMediaReference(Platform.Android);
                #elif (!UNITY_EDITOR && UNITY_WEBGL)
            result = GetPlatformMediaReference(Platform.WebGL);
                #endif

            if (result == null)
            {
                result = this;
            }

            return(result);
        }
Ejemplo n.º 2
0
        public MediaReference GetPlatformMediaReference(Platform platform)
        {
            MediaReference result = null;

            switch (platform)
            {
            case Platform.iOS:
                result = _iOS;
                break;

            case Platform.tvOS:
                result = _tvOS;
                break;

            case Platform.MacOSX:
                result = _macOS;
                break;

            case Platform.Windows:
                result = _windows;
                break;

            case Platform.WindowsUWP:
                result = _windowsUWP;
                break;

            case Platform.Android:
                result = _android;
                break;

            case Platform.WebGL:
                result = _webGL;
                break;
            }
            return(result);
        }