Beispiel #1
0
        // package の version (SemVer)
        public static string GetCreatorKitVersion()
        {
            var type     = MethodBase.GetCurrentMethod().DeclaringType;
            var assembly = Assembly.GetAssembly(type);
            var package  = PackageInfo.FindForAssembly(assembly);

            return(package.version);
        }
Beispiel #2
0
 internal static void CreateLocalizationAssets(string path)
 {
     try
     {
         TutorialManager.DirectoryCopy(
             $"{PackageInfo.FindForAssembly(Assembly.GetExecutingAssembly()).assetPath}/.LocalizationAssets",
             path
             );
         AssetDatabase.Refresh();
     }
     catch (Exception e)
     {
         Debug.LogException(e);
     }
 }
        public void SetUp()
        {
            var assembly = Assembly.Load("Unity.XR.Interaction.Toolkit");

            Assert.That(assembly, Is.Not.Null);

            m_PackageInfo = PackageInfo.FindForAssembly(assembly);
            Assert.That(m_PackageInfo, Is.Not.Null);

            // Parse the major.minor version
            Assert.That(m_PackageInfo.version, Is.Not.Null);
            Assert.That(m_PackageInfo.version, Is.Not.Empty);
            var secondDotIndex = m_PackageInfo.version.IndexOf('.', m_PackageInfo.version.IndexOf('.') + 1);

            Assert.That(secondDotIndex, Is.GreaterThan(0));
            m_MajorMinorVersion = m_PackageInfo.version.Substring(0, secondDotIndex);
        }
        // Returns the correct path (forward slash used as the separator) depending whether we're running the tests locally or as a separate package.
        protected static string GetTestAssetPath(string relativeAssetPath)
        {
            var packagePath = PackageInfo.FindForAssembly(Assembly.GetExecutingAssembly()).assetPath;

            return(Path.Combine($"{packagePath}/Tests/Editor", relativeAssetPath).Replace('\\', '/'));
        }