Exemplo n.º 1
0
 private void Awake()
 {
     try
     {
         bool licenseGood = LicenseChecker.CheckLicense();
         if (LicenseChecker.CheckLicense())
         {
             licenseUIBlockerRef.SetActive(false);
             foreach (var o in enableObjects)
             {
                 o.SetActive(false);
             }
             Debug.Log("License Pass");
         }
         else
         {
             licenseUIBlockerRef.SetActive(true);
             foreach (var o in enableObjects)
             {
                 o.SetActive(true);
             }
             title.text = LicenseChecker.tempErrorMessage;
             Debug.Log(LicenseChecker.tempErrorMessage);
             info.text = "Please send the file: " + LicenseChecker.DeviceInfoFullPath + " to the developer to get the key.txt file. " +
                         "Then put the file to " + LicenseChecker.LicenseFullPath;
         }
     }
     catch (Exception e)
     {
         Debug.Log("License check error:" + e);
     }
 }
Exemplo n.º 2
0
        void OnGUI()
        {
            EditorGUILayout.LabelField("Device ID");
            deviceID = EditorGUILayout.TextArea(deviceID);

            if (GUILayout.Button("Generate") && !string.IsNullOrEmpty(deviceID))
            {
                key = LicenseChecker.GetCorrectDeviceKey(deviceID);

                System.IO.File.WriteAllText(fullPath, key);
            }
            EditorGUILayout.LabelField("Key: (Also in file: " + fullPath + ")");
            EditorGUILayout.SelectableLabel(key);
        }