示例#1
0
        void Awake()
        {
            if (dontDestroyOnLoad)
            {
                if (_manager == null)
                {
                    DontDestroyOnLoad(gameObject);
                }
                else
                {
                    Destroy(gameObject);
                    return;
                }
            }

            var uninstalledMessage = "bHaptics Player is not installed. Plugin is now disabled. Please download here." +
                                     "\nhttp://bhaptics.com/app.html#download";

            _manager = this;
            if (!BhapticsUtils.IsPlayerInstalled())
            {
                Debug.LogError(uninstalledMessage);
                return;
            }

            if (!BhapticsUtils.IsPlayerRunning())
            {
                Debug.Log("bHaptics Player is not running, try launching bHaptics Player.");
                BhapticsUtils.LaunchPlayer(launchPlayerIfNotRunning);
            }
        }
示例#2
0
        void Awake()
        {
            if (dontDestroyOnLoad)
            {
                if (Instance == null)
                {
                    DontDestroyOnLoad(gameObject);
                }
                else
                {
                    Destroy(gameObject);
                    return;
                }
            }

            var uninstalledMessage = "bHaptics Player is not installed. Plugin is now disabled. Please download here." +
                                     "\nhttp://bhaptics.com/app.html#download";

            Instance = this;
            if (!BhapticsUtils.IsPlayerInstalled())
            {
                Debug.LogError(uninstalledMessage);
                return;
            }

            if (!BhapticsUtils.IsPlayerRunning())
            {
                Debug.Log("bHaptics Player is not running, try launching bHaptics Player.");
                BhapticsUtils.LaunchPlayer(launchPlayerIfNotRunning);
            }

            if (Application.platform == RuntimePlatform.Android && BhapticsAndroidManager.Instance == null)
            {
                var bhapticsAndroidManager = Instantiate(bHapticsAndroidManagerPrefab, Vector3.zero, Quaternion.identity);
                bhapticsAndroidManager.name             = "[bHapticsAndroidManager]";
                bhapticsAndroidManager.transform.parent = transform;
            }
        }
示例#3
0
        void Awake()
        {
            var uninstalledMessage = "bHaptics Player is not installed. Plugin is now disabled. Please download here." +
                                     "\nhttp://bhaptics.com/app.html#download";

            _manager = this;
            if (!BhapticsUtils.IsPlayerInstalled())
            {
                Debug.LogError(uninstalledMessage);
                return;
            }

            if (!BhapticsUtils.IsPlayerRunning())
            {
                Debug.Log("bHaptics Player is not running, try launching bHaptics Player.");
                BhapticsUtils.LaunchPlayer(launchPlayerIfNotRunning);
            }

            if (Application.platform == RuntimePlatform.Android)
            {
                Invoke("AndroidStopScan", 3f);
            }
        }