| 1 | /************************************************************************************ |
| 2 | Filename : ONSPVersion.cs |
| 3 | Content : Get version number of plug-in |
| 4 | Copyright : Copyright (c) Facebook Technologies, LLC and its affiliates. All rights reserved. |
| 5 | |
| 6 | Licensed under the Oculus SDK Version 3.5 (the "License"); |
| 7 | you may not use the Oculus SDK except in compliance with the License, |
| 8 | which is provided at the time of installation or download, or which |
| 9 | otherwise accompanies this software in either electronic or hard copy form. |
| 10 | |
| 11 | You may obtain a copy of the License at |
| 12 | |
| 13 | https://developer.oculus.com/licenses/sdk-3.5/ |
| 14 | |
| 15 | Unless required by applicable law or agreed to in writing, the Oculus SDK |
| 16 | distributed under the License is distributed on an "AS IS" BASIS, |
| 17 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 18 | See the License for the specific language governing permissions and |
| 19 | limitations under the License. |
| 20 | ************************************************************************************/ |
| 21 | using UnityEngine; |
| 22 | using System; |
| 23 | using System.Runtime.InteropServices; |
| 24 | |
| 25 | public class ONSPVersion : MonoBehaviour |
| 26 | { |
| 27 | // Import functions |
| 28 | public const string strONSPS = "AudioPluginOculusSpatializer"; |
| 29 | |
| 30 | [DllImport(strONSPS)] |
| 31 | private static extern void ONSP_GetVersion(ref int Major, ref int Minor, ref int Patch); |
| 32 | |
| 33 | /// <summary> |
| 34 | /// Awake this instance. |
| 35 | /// </summary> |
| 36 | void Awake() |
| 37 | { |
| 38 | int major = 0; |
| 39 | int minor = 0; |
| 40 | int patch = 0; |
| 41 | |
| 42 | ONSP_GetVersion(ref major, ref minor, ref patch); |
| 43 | |
| 44 | String version = System.String.Format |
| 45 | ("ONSP Version: {0:F0}.{1:F0}.{2:F0}", major, minor, patch); |
| 46 | |
| 47 | Debug.Log(version); |
| 48 | } |
| 49 | |
| 50 | /// <summary> |
| 51 | /// Start this instance. |
| 52 | /// </summary> |
| 53 | void Start() |
| 54 | { |
| 55 | } |
| 56 | |
| 57 | /// <summary> |
| 58 | /// Update this instance. |
| 59 | /// </summary> |
| 60 | void Update() |
| 61 | { |
| 62 | } |
| 63 | } |