Beispiel #1
0
        void Awake()
        {
            if (_Instance != null)
            {
                Destroy(gameObject);
                return;
            }
            else
            {
                _Instance = this;
            }

            Init();
        }
        private void InitPlayer()
        {
            if (Application.platform == RuntimePlatform.IPhonePlayer)             // ||Application.platform == RuntimePlatform.WindowsEditor )
            {
                GameObject go = Instantiate(Resources.Load <GameObject>(IOSPrefab), transform);
                Player = go.GetComponent <IOSAudioPlayer>();
                IOSAudioPlayer p = Player as IOSAudioPlayer;

                go.name = "IOSAudioPlayer";
            }
            else if (Application.platform == RuntimePlatform.WindowsPlayer || Application.platform == RuntimePlatform.WindowsEditor || Application.platform == RuntimePlatform.OSXEditor || Application.platform == RuntimePlatform.OSXPlayer)
            {
                GameObject go = Instantiate(Resources.Load <GameObject>(DesktopPrefab), transform);
                Player = go.GetComponent <DesktopAudioPlayer>();
                DesktopAudioPlayer.OnFolderComplete += HandleOnFolderComplete;

                go.name = "DesktopAudioPlayer";
            }

            Initialized = true;
        }