Example #1
0
 public static void ConfigureGameEngineVersion(string gameEngineVersion)
 {
     GAThreading.PerformTaskOnGAThread("configureGameEngineVersion", () =>
     {
         if (IsSdkReady(true, false))
         {
             return;
         }
         if (!GAValidator.ValidateEngineVersion(gameEngineVersion))
         {
             GALogger.I("Validation fail - configure sdk version: Sdk version not supported. String: " + gameEngineVersion);
             return;
         }
         GADevice.GameEngineVersion = gameEngineVersion;
     });
 }
Example #2
0
        public void TestValidateEngineVersion()
        {
            Assert.False(GAValidator.ValidateEngineVersion(""));
            Assert.False(GAValidator.ValidateEngineVersion(null));
            Assert.False(GAValidator.ValidateEngineVersion(GATestUtilities.GetRandomString(40)));
            Assert.False(GAValidator.ValidateEngineVersion("uni 1.2.3"));
            Assert.False(GAValidator.ValidateEngineVersion("unity 123456.2.3"));
            Assert.False(GAValidator.ValidateEngineVersion("unity1.2.3"));
            Assert.False(GAValidator.ValidateEngineVersion("unity 1.2.3.4"));
            Assert.False(GAValidator.ValidateEngineVersion("Unity 1.2.3"));
            Assert.False(GAValidator.ValidateEngineVersion("UNITY 1.2.3"));

            Assert.True(GAValidator.ValidateEngineVersion("unity 1.2.3"));
            Assert.True(GAValidator.ValidateEngineVersion("unity 1.2"));
            Assert.True(GAValidator.ValidateEngineVersion("unity 1"));
            Assert.False(GAValidator.ValidateEngineVersion("marmalade 1.2.3"));
            Assert.False(GAValidator.ValidateEngineVersion("xamarin 1.2.3"));
            Assert.False(GAValidator.ValidateEngineVersion("cocos2d 1.2.3"));
            Assert.False(GAValidator.ValidateEngineVersion("unreal 1.2.3"));
        }