123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Text;
- using I2.Loc;
- using UnityEngine;
- public static class Product
- {
- public static Product.Type type { get; private set; }
- public static bool supportMultiLanguage
- {
- get
- {
- return Product.type != Product.Type.JpAdult && Product.type != Product.Type.JpPublic;
- }
- }
- public static bool isPublic
- {
- get
- {
- return Product.type == Product.Type.JpPublic || Product.type == Product.Type.EnPublic;
- }
- }
- public static bool isJapan
- {
- get
- {
- return Product.type == Product.Type.JpAdult || Product.type == Product.Type.JpPublic;
- }
- }
- public static bool isEnglish
- {
- get
- {
- return Product.type == Product.Type.EnAdult || Product.type == Product.Type.EnPublic;
- }
- }
- public static Product.Language systemLanguage
- {
- get
- {
- if (!Product.supportMultiLanguage)
- {
- return Product.Language.Japanese;
- }
- string currentLanguage = LocalizationManager.CurrentLanguage;
- return (!(currentLanguage == "English")) ? Product.Language.Japanese : Product.Language.English;
- }
- set
- {
- if (!Product.supportMultiLanguage)
- {
- LocalizationManager.CurrentLanguage = Product.EnumConvert.ToI2LocalizeLanguageName(Product.Language.Japanese);
- return;
- }
- LocalizationManager.CurrentLanguage = Product.EnumConvert.ToI2LocalizeLanguageName(value);
- foreach (LanguageSource languageSource in LocalizationManager.Sources)
- {
- languageSource.LoadAllLanguages(false);
- }
- }
- }
- public static Product.Language defaultLanguage
- {
- get
- {
- return (!Product.supportMultiLanguage) ? Product.Language.Japanese : Product.Language.English;
- }
- }
- public static string gameTitle
- {
- get
- {
- string text = "System/カスタムオーダーメイド3D 2";
- if (Product.isPublic)
- {
- text += "全年齢";
- }
- return LocalizationManager.GetTranslation(text, true, 0, true, false, null, Product.EnumConvert.ToI2LocalizeLanguageName(Product.systemLanguage));
- }
- }
- public static string windowTitel
- {
- get
- {
- string text = Product.gameTitle;
- if (Product.isJapan)
- {
- text = "CUSTOM ORDER MAID 3D 2";
- if (Product.isPublic)
- {
- text += " It's a Night Magic";
- }
- }
- return text;
- }
- }
- public static string gameDataPath
- {
- get
- {
- Product.Type type = Product.type;
- if (type == Product.Type.JpPublic)
- {
- return "_public";
- }
- if (type == Product.Type.EnAdult)
- {
- return "_en";
- }
- if (type != Product.Type.EnPublic)
- {
- return string.Empty;
- }
- return "_enpublic";
- }
- }
- public static bool enabeldAdditionalRelation
- {
- get
- {
- return true;
- }
- }
- public static bool lockDLCSiteLink
- {
- get
- {
- return Product.type == Product.Type.EnPublic && File.Exists(Path.Combine(UTY.gameProjectPath, "platform_others"));
- }
- }
- public static void Initialize(AFileSystemBase fileSystem)
- {
- KeyValuePair<string, Product.Type>[] array = new KeyValuePair<string, Product.Type>[]
- {
- new KeyValuePair<string, Product.Type>("RDFBMTE5RTItMEQxOC00NkM3LUFCNzctRERGNjkyNjNCNzcy", Product.Type.JpAdult),
- new KeyValuePair<string, Product.Type>("Nzc1RjVFNUQtQzc5Ri00NThGLTg4QzYtRTEwQ0JCRTVCRTVB", Product.Type.JpPublic),
- new KeyValuePair<string, Product.Type>("QTZEQUE0MDItNTI4MS00RTMxLUFGOEMtMTY3RUE5M0QwQ0Q5", Product.Type.EnAdult),
- new KeyValuePair<string, Product.Type>("QzhFODY4MkMtRTU1QS00MDZBLTkyREItRjQ5RTE1N0Y4M0VC", Product.Type.EnPublic)
- };
- Encoding encoding = Encoding.GetEncoding("UTF-8");
- Product.type = Product.Type.JpAdult;
- foreach (KeyValuePair<string, Product.Type> keyValuePair in array)
- {
- if (fileSystem.IsExistentFile(encoding.GetString(Convert.FromBase64String(keyValuePair.Key))))
- {
- Product.type = keyValuePair.Value;
- break;
- }
- }
- Debug.Log("ProductType:" + Product.type.ToString());
- Product.systemLanguage = Product.defaultLanguage;
- }
- public static void OnApplicationQuit()
- {
- }
- public enum Type
- {
- JpAdult,
- JpPublic,
- EnAdult,
- EnPublic
- }
- public enum Language
- {
- Japanese,
- English
- }
- public static class EnumConvert
- {
- public static string GetString(Product.Language language)
- {
- if (language == Product.Language.Japanese)
- {
- return "日本語";
- }
- return "英語";
- }
- public static string ToI2LocalizeLanguageName(Product.Language language)
- {
- if (language == Product.Language.Japanese)
- {
- return "Japanese";
- }
- if (language != Product.Language.English)
- {
- return "Japanese";
- }
- return "English";
- }
- public static string GetTerm(Product.Language language)
- {
- return "System/言語/" + Product.EnumConvert.GetString(language);
- }
- }
- }
|